From ef7e67e3e3636c3990a5b051bc48d1af86715490 Mon Sep 17 00:00:00 2001
From: Athanasios Karmas <karmas@athenarc.gr>
Date: Tue, 12 Apr 2022 10:36:41 +0000
Subject: [PATCH] add some operational instructions

---
 ...lly_create_new_Spack_installation_root.txt | 19 +++++++++++++++++++
 ...ase_create_new_Spack_installation_root.txt | 19 +++++++++++++++++++
 2 files changed, 38 insertions(+)
 create mode 100644 operations/experimental_release_manually_create_new_Spack_installation_root.txt
 create mode 100644 operations/regular_release_create_new_Spack_installation_root.txt

diff --git a/operations/experimental_release_manually_create_new_Spack_installation_root.txt b/operations/experimental_release_manually_create_new_Spack_installation_root.txt
new file mode 100644
index 00000000..9b399647
--- /dev/null
+++ b/operations/experimental_release_manually_create_new_Spack_installation_root.txt
@@ -0,0 +1,19 @@
+## Experimental release: Process to create new Spack installation root in case we want to update the Spack release
+
+**the process contains many manual steps**
+
+1. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_INSTALLATION_ROOT_{env} variable to the **new name**
+2. Start a new OKD job with [$OP == "manualFixing"] from CLI with `oc create -f simplejob.yml`
+3. Connect to the running pod to get access to the NFS partition
+4. Execute `mkdir -p {site}_INSTALLATION_ROOT_{env}`
+5. Execute `cd {site}_INSTALLATION_ROOT_{env}`
+6. Execute all commands of [$OP == "create"] from "ebrains-spack-build-env>bin/deploy-build-env.sh". 
+- Right after the git clone command, Set the git commit of the Spack instance to the desired one.
+- Right after the previous action go to "spack/etc/spack" and create "packages.yaml" with content:
+```
+packages:
+  all:
+    target: [x86_64]
+```
+- Right after the `spack compiler find` command install also the appropriate python with `spack install python@3.8.11 %gcc@10.3.0`
+7. Create the appropriate LAB_KERNEL_PATH if it does not exist
diff --git a/operations/regular_release_create_new_Spack_installation_root.txt b/operations/regular_release_create_new_Spack_installation_root.txt
new file mode 100644
index 00000000..57a79b32
--- /dev/null
+++ b/operations/regular_release_create_new_Spack_installation_root.txt
@@ -0,0 +1,19 @@
+## Regular release of EBRAINS tools: Process to create new Spack installation root in case we want to update the Spack release without breaking the existing packages
+
+1. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_INSTALLATION_ROOT_{env} variable to the **new name**
+2. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_OPERATION_{env} variable to **"create"**
+3. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_LAB_KERNEL_PATH_{env} variable to the **desired path**
+4. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_SPACKIFIED_ENV_{env} variable to the **appropriate name**
+5. Run the build pipeline
+6. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_OPERATION_{env} variable to **"manualFixing"** and run the build pipeline. This will create an OpenShift job that will not do any actual operation just loop forever, to give us the time to connect to the running pod and manually set the Spack instance to the commit we want for Spack to be. 
+- We set the appropriate commit to the Spack instance
+- Right after the previous action go to "spack/etc/spack" and create "packages.yaml" with content:
+```
+packages:
+  all:
+    target: [x86_64]
+```
+- Right after the previous action install also the appropriate python with `spack install python@3.8.11 %gcc@10.3.0`
+- Then disconnect and kill the OpenShift job. 
+7. In the Gitlab repository go to CI/CD > Variables > Expand and set the appropriate {site}_OPERATION_{env} variable to **"update"**
+8. Run the build pipeline
-- 
GitLab