-
Notifications
You must be signed in to change notification settings - Fork 8
CI Conda Docker build
- First, update the version in the setup.py file for both the base image and the plugins and the entire image.
- Next, create a new environment.yml file that defines the dependencies of the project and its plugins. This can be done by running the Python command
python conda_recipe/generate_environment_yml.py
. - Once the changes have been made, they should be pushed to the repository.
- Next, run the pipeline. This will require specifying two variables:
CI_BUILD
, which indicates what should be built depending on whether it is the develpment or main branch andBIM2SIM_BASE_VERSION
, which specifies which version of the base BIM2ISM image should be used on which the plugins will be installed. The default value is*
. - Check the pipeline and let Conda and Docker build. If everything builds successfully, the release can be triggered manually.
CI_TRIGGER: environment_bim2sim_main CI_TRIGGER: environment_bim2sim_dev
Introduction:
This document outlines the process of creating Conda packages for the Bim2Sim project. The Bim2Sim project is a Python-based software application that requires a set of dependencies to function properly. These dependencies are packaged as Conda packages and can be installed on different operating systems.
Package Versioning:
The versions of the packages are defined in the setup.py files, and they are automatically transferred to the meta.yaml files using a script. Conda packages that are necessary for Bim2Sim are retrieved from the environment.yml file and added to the meta.yaml files.
Package Management:
Changes or new packages must be added to the appropriate file, either requirements.txt, dependency_requirements.txt, or conda_requirements.txt. The requirements.txt file should only contain Python packages that are not available in Anaconda. The dependency_requirements.txt file should contain packages that are not available in PyPI but are available on GitHub or other sources. It is recommended to include Conda packages in the conda_requirements.txt file whenever possible.
Environment Management:
To create the environment.yml files, run the command python conda_recipe/generate_environment_yml.py
. This script generates three types of environments:
Type 1: Contains only the packages required by Bim2Sim but not Bim2Sim itself. This type of environment is suitable for working on Bim2Sim.
Type 2: Contains Bim2Sim on the current main branch.
Type 3: Contains Bim2Sim on the development branch.
It is recommended to use the environment.yml files to work with the Bim2Sim packages because they include PyPI packages and provide a ready-to-use environment. It is also recommended to use mamba (https://github.com/conda-forge/miniforge#mambaforge) for installation, as it is much faster than the standard conda installer. The environment can be created using the command mamba env create -f $ENV_FILE
. Bim2Sim can also be installed using the command mamba install -c bim2sim bim2sim
, but it may not include all PyPI packages.
Conclusion:
The Bim2Sim Conda packages and environment can be found at https://anaconda.org/bim2sim. This document provides an overview of the package and environment management process and recommends best practices for working with the Bim2Sim packages.
CI_COMMAND | bim2sim/ Docker Version | Job |
---|---|---|
Conda package/ docker Image | ||
if: $CI_BUILD =~ ci_build_main |
bim2sim_base==* bim2sim_aixlib==* bim2sim_cfd==* bim2sim_energyplus==* bim2sim_hkesim==* bim2sim_lca==* bim2sim_teaser==* bim2sim==* bim2sim-base--debian dymola-bim2sim-base--debian bim2sim--debian bim2sim-aixlib--debian bim2sim-cfd--debian bim2sim-energyplus--debian bim2sim-hkesim--debian bim2sim-lca--debian bim2sim-teaser--debian dymola-bim2sim-teaser--debian |
conda_build_bim2sim:base:main build_conda_plugin:aixlib:main: build_conda_plugin:cfd:main: build_conda_plugin:energyplus:main: build_conda_plugin:hkesim:main: build_conda_plugin:lca:main: build_conda_plugin:teaser:main: build_conda_bim2sim:total:main: docker_build_bim2sim:base:main: docker_build_bim2sim:env_dymola_base:main: docker_build_total:main: docker_build_plugin:aixlib:main docker_build_plugin:cfd:main: docker_build_plugin:energyplus:main: docker_build_plugin:hkesim:main: docker_build_plugin:lca:main: docker_build_plugin:teaser:main: docker_build_plugin:dymola_teaser:main: |
if: $CI_BUILD =~ ci_build_dev |
bim2sim_base==.dev bim2sim_aixlib==.dev bim2sim_cfd==.dev bim2sim_energyplus==.dev bim2sim_hkesim==.dev bim2sim_lca==.dev bim2sim_teaser==.dev bim2sim==.dev bim2sim-base-.dev-debian dymola-bim2sim-base-.dev-debian bim2sim-.dev-debian bim2sim-aixlib-.dev-debian bim2sim-cfd-.dev-debian bim2sim-energyplus-.dev-debian bim2sim-hkesim-.dev-debian bim2sim-lca-.dev-debian bim2sim-teaser-.dev-debian dymola-bim2sim-teaser-.dev-debian |
conda_build_bim2sim:base:dev build_conda_plugin:aixlib:dev: build_conda_plugin:cfd:dev: build_conda_plugin:energyplus:dev: build_conda_plugin:hkesim:dev: build_conda_plugin:lca:dev: build_conda_plugin:teaser:dev: build_conda_bim2sim:total:dev: docker_build_bim2sim:base:dev: docker_build_bim2sim:env_dymola_base:dev: docker_build_total:dev: docker_build_plugin:aixlib:dev docker_build_plugin:cfd:dev: docker_build_plugin:energyplus:dev: docker_build_plugin:hkesim:dev: docker_build_plugin:lca:main: docker_build_plugin:teaser:dev: docker_build_plugin:dymola_teaser:dev: |
Conda Packages/ docker Image | ||
Only bim2sim_base | ||
if: $CI_BUILD =~ ci_build_base_main |
bim2sim_base==* bim2sim-base:-debian dymola-bim2sim-base--debian |
conda_build_bim2sim:base:main docker_build_bim2sim:base:main docker_build_bim2sim:env_dymola_base:main: |
if: $CI_BUILD =~ ci_build_conda_main |
bim2sim_base==* bim2sim_aixlib==* bim2sim_cfd==* bim2sim_energyplus==* bim2sim_hkesim==* bim2sim_lca==* bim2sim_teaser==* bim2sim==* |
conda_build_bim2sim:base:main build_conda_plugin:aixlib:main: build_conda_plugin:cfd:main: build_conda_plugin:energyplus:main: build_conda_plugin:hkesim:main: build_conda_plugin:lca:main: build_conda_plugin:teaser:main: build_conda_bim2sim:total:main: |
if: $CI_BUILD =~ ci_build_conda_dev |
bim2sim_base==.dev bim2sim_aixlib==.dev bim2sim_cfd==.dev bim2sim_energyplus==.dev bim2sim_hkesim==.dev bim2sim_lca==.dev bim2sim_teaser==.dev bim2sim==.dev |
conda_build_bim2sim:base:dev build_conda_plugin:aixlib:dev: build_conda_plugin:cfd:dev: build_conda_plugin:energyplus:dev: build_conda_plugin:hkesim:dev: build_conda_plugin:lca:dev: build_conda_plugin:teaser:dev: build_conda_bim2sim:total:dev: |
if: $CI_BUILD =~ ci_build_base_dev |
bim2sim_base==.dev bim2sim-base-.dev-debian dymola-bim2sim-base-*.dev-debian |
conda_build_bim2sim:base:dev docker_build_bim2sim:base:dev: docker_build_bim2sim:env_dymola_base:dev: |
if: $CI_BUILD =~ ci_build_plugin_main |
bim2sim_aixlib==* bim2sim_cfd==* bim2sim_energyplus==* bim2sim_hkesim==* bim2sim_lca==* bim2sim_teaser==* bim2sim-aixlib--debian bim2sim-cfd--debian bim2sim-energyplus--debian bim2sim-hkesim--debian bim2sim-lca--debian bim2sim-teaser--debian dymola-bim2sim-teaser |
build_conda_plugin:aixlib:main: build_conda_plugin:cfd:main: build_conda_plugin:energyplus:main: build_conda_plugin:hkesim:main: build_conda_plugin:lca:main: build_conda_plugin:teaser:main: docker_build_plugin:aixlib:main docker_build_plugin:cfd:main: docker_build_plugin:energyplus:main: docker_build_plugin:hkesim:main: docker_build_plugin:lca:main: docker_build_plugin:teaser:main: docker_build_plugin:dymola_teaser:main: |
if: $CI_BUILD =~ ci_build_plugin_aixlib_main |
bim2sim_aixlib==* bim2sim-aixlib-*-debian |
build_conda_plugin:aixlib:main: docker_build_plugin:aixlib:main |
Only Conda / Docker Plugins | ||
if: $CI_BUILD =~ /ci_build_plugin_dev/ |
bim2sim_aixlib==.dev bim2sim_cfd==.dev bim2sim_energyplus==.dev bim2sim_hkesim==.dev bim2sim_lca==.dev bim2sim_teaser==.dev bim2sim-aixlib-.dev-debian bim2sim-cfd-.dev-debian bim2sim-energyplus-.dev-debian bim2sim-hkesim-.dev-debian bim2sim-lca-.dev-debian bim2sim-teaser-.dev-debian dymola-bim2sim-teaser-*.dev-debian |
build_conda_plugin:aixlib:dev: build_conda_plugin:cfd:dev: build_conda_plugin:energyplus:dev: build_conda_plugin:hkesim:dev: build_conda_plugin:lca:dev: build_conda_plugin:teaser:dev: docker_build_plugin:aixlib:dev: docker_build_plugin:cfd:dev: docker_build_plugin:energyplus:dev: docker_build_plugin:hkesim:dev: docker_build_plugin:lca:dev: docker_build_plugin:teaser:dev: docker_build_plugin:dymola_teaser:dev: |
if: $CI_BUILD =~ /ci_build_plugin_aixlib_dev/ |
bim2sim_aixlib==.dev bim2sim-aixlib-.dev-debian |
build_conda_plugin:aixlib:dev: docker_build_plugin:aixlib:dev: |
if: $CI_BUILD =~ /ci_build_plugin_energyplus_dev/ |
bim2sim_energyplus==.dev bim2sim-energyplus-.dev-debian |
build_conda_plugin:energyplus:dev: docker_build_plugin:energyplus:dev: |
if: $CI_BUILD =~ /ci_build_plugin_energyplus_main/ |
bim2sim_energyplus== bim2sim-energyplus--debian |
build_conda_plugin:energyplus:main: docker_build_plugin:energyplus:main: |
if: $CI_BUILD =~ ci_build_plugin_cfd_main |
bim2sim_cfd== bim2sim-cfd--debian |
build_conda_plugin:cfd:main: docker_build_plugin:cfd:main: |
if: $CI_BUILD =~ /ci_build_plugin_cfd_dev/ |
bim2sim_cfd==.dev bim2sim-cfd-.dev-debian |
build_conda_plugin:cfd:dev: docker_build_plugin:cfd:dev: |
if: $CI_BUILD =~ / ci_build_plugin_hkesim_main/ |
bim2sim_cfd==* bim2sim-hkesim-*-debian |
build_conda_plugin:cfd:main: docker_build_plugin:hkesim:main: |
if: $CI_BUILD =~ / ci_build_plugin_hkesim_dev/ |
bim2sim_hkesim bim2sim-hkesim-*-debian |
build_conda_plugin:hkesim:main docker_release_plugin:hkesim:main |
if: $CI_BUILD =~ /ci_build_plugin_lca_dev/ |
bim2sim_lca==.dev bim2sim-lca-.dev-debian |
build_conda_plugin:lca:dev: docker_build_plugin:lca:dev: |
if: $CI_BUILD =~ / ci_build_plugin_lca_main/ |
bim2sim_lca==* bim2sim-lca-*-debian |
build_conda_plugin:lca:main: docker_build_plugin:lca:main: |
if: $CI_BUILD =~ /ci_build_plugin_teaser_main/ |
bim2sim_teaser==* bim2sim-teaser--debian dymola-bim2sim-teaser--debian |
build_conda_plugin:teaser:main: docker_build_plugin:teaser:main: docker_build_plugin:dymola_teaser:main: |
if: $CI_BUILD =~ /ci_build_plugin_teaser_dev/ |
bim2sim_teaser==.dev dymola-bim2sim-teaser-.dev-debian |
build_conda_plugin:teaser:dev: docker_build_plugin:dymola_teaser:dev: |
Only bim2sim with all plugins | ||
if: $CI_BUILD =~ /ci_build_total_main/ |
bim2sim==* bim2sim-*-debian |
build_conda_bim2sim:total:main: docker_build_total:main: |
if: $CI_BUILD =~ /ci_build_total_dev/ |
bim2sim==.dev bim2sim-.dev-debian |
build_conda_bim2sim:total:dev: docker_build_total:dev: |
Only Docker Image | ||
if: $CI_BUILD =~ /ci_build_docker_main/ |
bim2sim-base--debian dymola-bim2sim-base--debian bim2sim--debian bim2sim-aixlib--debian bim2sim-cfd--debian bim2sim-energyplus--debian bim2sim-hkesim--debian bim2sim-lca--debian bim2sim-teaser--debian dymola-bim2sim-teaser--debian |
docker_build_bim2sim:base:main: docker_build_bim2sim:env_dymola_base:main: docker_build_total:main: docker_build_plugin:aixlib:main docker_build_plugin:cfd:main: docker_build_plugin:energyplus:main: docker_build_plugin:hkesim:main: docker_build_plugin:lca:main: docker_build_plugin:teaser:main: docker_build_plugin:dymola_teaser:main: |
if: $CI_BUILD =~ /ci_build_docker_dev/ |
bim2sim-base-.dev-debian dymola-bim2sim-base-.dev-debian bim2sim-.dev-debian bim2sim-aixlib-.dev-debian bim2sim-cfd-.dev-debian bim2sim-energyplus-.dev-debian bim2sim-hkesim-.dev-debian bim2sim-lca-.dev-debian bim2sim-teaser-.dev-debian dymola-bim2sim-teaser-.dev-debian |
docker_build_bim2sim:base:dev: docker_build_bim2sim:env_dymola_base:dev: docker_build_total:dev: docker_build_plugin:aixlib:dev docker_build_plugin:cfd:dev: docker_build_plugin:energyplus:dev: docker_build_plugin:hkesim:dev: docker_build_plugin:lca:main: docker_build_plugin:teaser:dev: docker_build_plugin:dymola_teaser:dev: |