From 53ed5b0e1d60656c639c878c06d2f65428e42156 Mon Sep 17 00:00:00 2001
From: adrianciu <adrianciu25@gmail.com>
Date: Fri, 21 Feb 2025 10:49:01 +0200
Subject: [PATCH] esd-spack-installation: README
---
.env | 9 ++++
README.md | 52 +++++++++++++++++--
dedal/spack_factory/SpackOperationUseCache.py | 4 +-
dedal/tests/testing_variables.py | 2 +-
4 files changed, 61 insertions(+), 6 deletions(-)
create mode 100644 .env
diff --git a/.env b/.env
new file mode 100644
index 00000000..93e62653
--- /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 86ab9c2f..82058f34 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 efb9af76..41a9094c 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 ab95bfa1..e441a286 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'
--
GitLab