fastiot.cli.model.project module¶
data model for project configuration
- class fastiot.cli.model.project.CompileSettingsEnum(value)[source]¶
Different settings to define how to compile the library.
- only_compiled = 'only_compiled'¶
- only_source = 'only_source'¶
- all_variants = 'all_variants'¶
- pydantic model fastiot.cli.model.project.ProjectContext[source]¶
This class holds all variables reade from
configure.py
in the project root directory. Use this as for hints to do custom adjustments to yourconfigure.py
. We try to set sensible defaults so that changes should only be needed in rare cases.- Validators:
-
field project_namespace:
str
= ''¶ Namespace of the project used e.g. on the docker registry. This should be your project name.
-
field project_root_dir:
str
= '.'¶ Project root directory. As the cli is intended to be run from the project root directory the default using the current working directory should be fine.
- Validated by:
-
field library_package:
str
= ''¶ Define a python package within your
src
directory containing library methods to be shared between your services. If not specified no library will be built.
-
field library_setup_py_dir:
str
= '.'¶ Path where to find the
setup.py
to build your library for exporting. The default with the current working directory should be fine, if you put yoursetup.py
at the toplevel of your project (common).- Validated by:
-
field services:
List
[Service
] = []¶ Define a list of
fastiot.cli.model.service.ServiceConfig
. If not defined the cli will look for python packages containing amanifest.yaml
and a run.py with the patternsrc/*/*/manifest.yaml
and call this package a FastIoT Service. Be aware of this when creating amanifest.yaml
somewhere, e.g. in your tests.Hint: If you want to override this configuration you may use
fastiot.cli.helper_fn.find_services()
to create a list of services to build by package.
-
field deployments:
Dict
[str
,DeploymentConfig
] = {}¶ Manually define a list of deployments as
fastiot.cli.model.DeploymentConfig
to actually build using the commandfastiot.cli.commands.config.config()
. If left empty all deployment configurations in the pathdeployments
will be used.Hint: You may use
fastiot.cli.helper_fn.find_deployments()
to create a list of deployments according to your special needs.
-
field integration_test_deployment:
str
= ''¶ If you need any services to be started for automatic testing your project you may define the name of this special deployment found within the
fastiot.cli.model.project.ProjectContext.deployments
.
-
field test_package:
str
= ''¶ Name of the package in the
src
directory where automated tests are stored. Common is to use something likemyproject_tests
.
-
field npm_test_dir:
str
= ''¶
-
field build_dir:
str
= 'build'¶ The dir where generated build files (Dockerfiles, Docker-compose files, etc.) are stored. This dir is relative to your project_root_dir.
-
field extensions:
List
[str
] = []¶ Use to add own extensions to the FastIoT CLI. The CLI will try to import your custom infrastructure services as described in Adding custom infrastructure services to your project.
Make sure importing this service will import further commands and
fastiot.cli.model.infrastructure_service.InfrastructureService
. Most of the times this is done filling the__init__.py
correspondingly.
-
field lib_compilation_mode:
CompileSettingsEnum
= CompileSettingsEnum.only_compiled¶ Set to false if you do not want your library to be compiled (and obfuscated), use options from
fastiot.cli.model.project.CompileSettingsEnum
- class property default: ProjectContext[source]¶
Use this method to retrieve the singleton
fastiot.cli.model.project.ProjectContext
- validator default_to_abspath » library_setup_py_dir, project_root_dir[source]¶
- property deployment_names: List[str]¶
Returns a list of all deployment names configured by configuration (
fastiot.cli.model.project.ProjectContext.deployments
) or by convention in deployments dir.
- deployment_dir(name)[source]¶
Returns the deployment build dir for specific deployment
- Return type:
str
- deployment_build_dir(name)[source]¶
Returns the deployment build dir for specific deployment
- Return type:
str