diff --git a/.env b/.env new file mode 100644 index 0000000000000000000000000000000000000000..93e626530f31129609801d8e4bb3e61003ad3362 --- /dev/null +++ b/.env @@ -0,0 +1,9 @@ +BUILDCACHE_OCI_HOST="" +BUILDCACHE_OCI_PASSWORD="" +BUILDCACHE_OCI_PROJECT="" +BUILDCACHE_OCI_USERNAME="" + +CONCRETIZE_OCI_HOST="" +CONCRETIZE_OCI_PASSWORD="" +CONCRETIZE_OCI_PROJECT="" +CONCRETIZE_OCI_USERNAME"" diff --git a/README.md b/README.md index 86ab9c2faabf361a78652d0621fae36e165c8a6c..82058f34da3bba5f11c3d57cd8f45e73cabcb9da 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,50 @@ -# ~~Yashchiki~~Koutakia +# Dedal -For now, this repository provides helpers for the EBRAINS container image build flow. -The lowest spack version which should be used with this library is v0.22.0 +This repository provides functionalities to easily ```managed spack environments``` and ```helpers for the container image build flow```. +The lowest ```spack version``` compatible with this library is ```v0.23.0```. + + + This repository also provied CLI interface. For more informations, after installing this library, call dedal --help. + + +**Setting up the needed environment variables** + The ````<checkout path>\dedal\.env```` file contains the environment variables required for OCI registry used for caching. + Ensure that you edit the ````<checkout path>\dedal\.env```` file to match your environment. + The following provides an explanation of the various environment variables: + + + # OCI Registry Configuration Sample for concretization caches + # ============================= + # The following variables configure the Harbor docker OCI registry (EBRAINS) used for caching. + + # The hostname of the OCI registry. e.g. docker-registry.ebrains.eu + CONCRETIZE__OCI_HOST="docker-registry.ebrains.eu" + + # The project name in the Docker registry. + CONCRETIZE__OCI_PROJECT="concretize_caches" + + # The username used for authentication with the Docker registry. + CONCRETIZE__OCI_USERNAME="robot$concretize-cache-test+user" + + # The password used for authentication with the Docker registry. + CONCRETIZE__OCI_HOST="###ACCESS_TOKEN###" + + + # OCI Registry Configuration Sample for binary caches + # ============================= + # The following variables configure the Harbor docker OCI registry (EBRAINS) used for caching. + + # The hostname of the OCI registry. e.g. docker-registry.ebrains.eu + BUILDCACHE_OCI_HOST="docker-registry.ebrains.eu" + + # The project name in the Docker registry. + BUILDCACHE_OCI_PROJECT="binary-cache-test" + + # The username used for authentication with the Docker registry. + BUILDCACHE_OCI_USERNAME="robot$binary-cache-test+user" + + # The password used for authentication with the Docker registry. + BUILDCACHE_OCI_HOST="###ACCESS_TOKEN###" + +For both concretization and binary caches, the cache version can be changed via the attributes ```cache_version_concretize``` and ```cache_version_build```. +The default values are ```v1```. diff --git a/dedal/spack_factory/SpackOperationUseCache.py b/dedal/spack_factory/SpackOperationUseCache.py index efb9af763af58a0f9e44ab79cab13af56947502e..41a9094ca550f1682082dbee4eced5b8183a9f7a 100644 --- a/dedal/spack_factory/SpackOperationUseCache.py +++ b/dedal/spack_factory/SpackOperationUseCache.py @@ -10,8 +10,8 @@ class SpackOperationUseCache(SpackOperation): This class uses caching for the concretization step and for the installation step. """ - def __init__(self, spack_config: SpackConfig = SpackConfig(), cache_version_concretize='cache', - cache_version_build='cache'): + def __init__(self, spack_config: SpackConfig = SpackConfig(), cache_version_concretize='v1', + cache_version_build='v1'): super().__init__(spack_config, logger=get_logger(__name__)) self.cache_dependency = BuildCacheManager(os.environ.get('CONCRETIZE_OCI_HOST'), os.environ.get('CONCRETIZE_OCI_PROJECT'), diff --git a/dedal/tests/testing_variables.py b/dedal/tests/testing_variables.py index ab95bfa1e02658b30cef40bd6654915a51d33ad3..e441a2864497edbca5e1f50619befe0c1a90863e 100644 --- a/dedal/tests/testing_variables.py +++ b/dedal/tests/testing_variables.py @@ -1,6 +1,6 @@ import os ebrains_spack_builds_git = 'https://gitlab.ebrains.eu/ri/tech-hub/platform/esd/ebrains-spack-builds.git' -SPACK_VERSION = "0.22.0" +SPACK_VERSION = "0.23.0" SPACK_ENV_ACCESS_TOKEN = os.getenv("SPACK_ENV_ACCESS_TOKEN") test_spack_env_git = f'https://oauth2:{SPACK_ENV_ACCESS_TOKEN}@gitlab.ebrains.eu/ri/projects-and-initiatives/virtualbraintwin/tools/test-spack-env.git'