From 5e11b39c76d9f31e5fbc5c6edc920a80ca10e978 Mon Sep 17 00:00:00 2001 From: Domenic Gosein <87760323+goseind@users.noreply.github.com> Date: Tue, 7 Feb 2023 10:59:21 +0100 Subject: [PATCH 1/4] add reana tf resources #19 --- iac/tf/cluster/main-helm.tf | 22 ++++++++++++---------- iac/tf/cluster/main-k8s.tf | 4 ++-- iac/tf/cluster/main-openstack.tf | 8 ++++---- iac/tf/cluster/reana/values.yaml | 12 ++++++++++++ iac/tf/cluster/variables.tf | 2 +- 5 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 iac/tf/cluster/reana/values.yaml diff --git a/iac/tf/cluster/main-helm.tf b/iac/tf/cluster/main-helm.tf index 04520017..49b0af44 100644 --- a/iac/tf/cluster/main-helm.tf +++ b/iac/tf/cluster/main-helm.tf @@ -91,13 +91,15 @@ resource "helm_release" "jupyterhub-chart" { # Reana -/* module "reana" { - source = "../modules/reana" - - ns-name = var.ns-reana - release-suffix = var.resource-suffix - storage-backend = "chepfs" - share-id = data.openstack_sharedfilesystem_share_v2.share_1_reana.id - share-access-id = openstack_sharedfilesystem_share_access_v2.share_access_2.id - cephfs-type = var.cephfs-type -} */ +resource "helm_release" "reana-chart" { + name = "reana-${var.resource-suffix}" + repository = "https://reanahub.github.io/reana/" + chart = "reana" + version = "0.9.0" + namespace = var.ns-reana + + values = [ + "${file("reana/values.yaml")}" + ] + +} diff --git a/iac/tf/cluster/main-k8s.tf b/iac/tf/cluster/main-k8s.tf index af842c38..4bcd2e4f 100644 --- a/iac/tf/cluster/main-k8s.tf +++ b/iac/tf/cluster/main-k8s.tf @@ -35,11 +35,11 @@ resource "kubernetes_namespace_v1" "ns_jupyterhub" { } } -/* resource "kubernetes_namespace_v1" "ns_reana" { +resource "kubernetes_namespace_v1" "ns_reana" { metadata { name = var.ns-reana } -} */ +} # Secrets (locally created and enrypted with kubeseal and then applied as a ready manifest) diff --git a/iac/tf/cluster/main-openstack.tf b/iac/tf/cluster/main-openstack.tf index 3f54ea21..b5f7ba61 100644 --- a/iac/tf/cluster/main-openstack.tf +++ b/iac/tf/cluster/main-openstack.tf @@ -6,9 +6,9 @@ data "openstack_containerinfra_clustertemplate_v1" "cluster_template" { name = var.cluster-template-name } -data "openstack_sharedfilesystem_share_v2" "share_1_reana" { +/* data "openstack_sharedfilesystem_share_v2" "share_1_reana" { name = var.reana-share-name -} +} */ # Resources @@ -50,7 +50,7 @@ resource "openstack_containerinfra_cluster_v1" "openstack_cluster" { } } -/* resource "openstack_sharedfilesystem_share_v2" "share_1_reana" { +resource "openstack_sharedfilesystem_share_v2" "share_1_reana" { name = var.reana-share-name description = "Share for reana" share_proto = "CEPHFS" @@ -63,4 +63,4 @@ resource "openstack_sharedfilesystem_share_access_v2" "share_access_2" { access_type = "cephx" access_to = var.reana-share-name access_level = "rw" -} */ \ No newline at end of file +} \ No newline at end of file diff --git a/iac/tf/cluster/reana/values.yaml b/iac/tf/cluster/reana/values.yaml new file mode 100644 index 00000000..66f16d18 --- /dev/null +++ b/iac/tf/cluster/reana/values.yaml @@ -0,0 +1,12 @@ +shared_storage: # or `infrastructure_storage` + backend: cephfs + volume_size: 1000 + access_modes: ReadWriteMany + cephfs: + provisioner: manila-provisioner + type: "Meyrin CephFS" + availability_zone: nova + os_secret_name: os-trustee + os_secret_namespace: kube-system + cephfs_os_share_id: 1c8a0cef-988b-4614-b072-33f75f9a084c + cephfs_os_share_access_id: b0a39b58-9b44-4961-b041-53978552970d diff --git a/iac/tf/cluster/variables.tf b/iac/tf/cluster/variables.tf index 97a2ec0f..bcacfcc0 100644 --- a/iac/tf/cluster/variables.tf +++ b/iac/tf/cluster/variables.tf @@ -35,7 +35,7 @@ variable "logging-producer" { variable "reana-share-name" { description = "The reana share name" type = string - default = "reana_sh1" + default = "cvre-reana" } variable "cephfs-type" { From ca9d68459ff120d4b611c1fc96adf4867557f51d Mon Sep 17 00:00:00 2001 From: Domenic Gosein <87760323+goseind@users.noreply.github.com> Date: Tue, 7 Feb 2023 11:00:18 +0100 Subject: [PATCH 2/4] upgrade tf helm provider #19 --- iac/tf/cluster/providers.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/iac/tf/cluster/providers.tf b/iac/tf/cluster/providers.tf index 57ad8426..ad5759cb 100644 --- a/iac/tf/cluster/providers.tf +++ b/iac/tf/cluster/providers.tf @@ -15,7 +15,7 @@ terraform { } helm = { source = "hashicorp/helm" - version = "2.7.1" + version = "2.8.0" } } } From 4f51b0aaa5a2052c11e5ddb3b0df3791263e2de5 Mon Sep 17 00:00:00 2001 From: Domenic Gosein <87760323+goseind@users.noreply.github.com> Date: Tue, 7 Feb 2023 11:02:01 +0100 Subject: [PATCH 3/4] upgrade tf helm provider lock file #19 --- iac/tf/cluster/.terraform.lock.hcl | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/iac/tf/cluster/.terraform.lock.hcl b/iac/tf/cluster/.terraform.lock.hcl index 95dcf50f..dfd95336 100644 --- a/iac/tf/cluster/.terraform.lock.hcl +++ b/iac/tf/cluster/.terraform.lock.hcl @@ -2,21 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/helm" { - version = "2.7.1" - constraints = "2.7.1" + version = "2.8.0" + constraints = "2.8.0" hashes = [ - "h1:11oWNeohjD8Fy9S7WQSKY3GmDZi7gVdMRp8/Wqxn410=", - "zh:13e2467092deeff01c4cfa2b54ba4510aa7a9b06c58f22c4215b0f4333858364", - "zh:4549843db4fdf5d8150e8c0734e67b54b5c3bcfc914e3221e6952f428fb984d2", - "zh:55b5f83ed52f93dd00a73c33c948326052efd700350c19e63bb1679b12bfcda6", - "zh:749397e41393289eb0ef6efd0a75911d29b8aa7f48e5d6813b4b350dad91acbd", - "zh:7a4a2c95b055f6c8e70d1fc7a4cc4fd6e4f04845be36e40d42d31dfc13db37b8", - "zh:8143e5b8218857052505c805b570889b862c618ce6cbfbddb98938ff7a5901d3", - "zh:856d94b3b34d6204d66c6de4feab4737c74dba037ad64e4c613e8eec61d17f1a", - "zh:b9b037f1edda209022df1c7fc906786970524873e27b061f3355cb9bbed2cf08", - "zh:c433b27f52a0600490af07f8b217ab0b1048ba347d68e6fe478aba18634e78d9", - "zh:da133748368c6e27b433cd7faeb7b800536c8651e7af0415452901dfc7577dbf", - "zh:eecc63c2dec8aafa2ffd7426800c3e1a5e31e848be01ea9511ad0184dce15945", + "h1:abRryu69lsIGXctqjMVoaKqi74eE12Vzd2FLpds1/PI=", + "zh:1e42d1a04c07d4006844e477ca32b5f45b04f6525dbbbe00b6be6e6ec5a11c54", + "zh:2f87187cb48ccfb18d12e2c4332e7e822923b659e7339b954b7db78aff91529f", + "zh:391fe49b4d2dc07bc717248a3fc6952189cfc49c596c514ad72a29c9a9f9d575", + "zh:89272048e1e63f3edc3e83dfddd5a9fd4bd2a4ead104e67de1e14319294dedf1", + "zh:a5a057c3435a854389ce8a1d98a54aaa7cbab68aca7baa436a605897aa70ff7e", + "zh:b1098e53e1a8a3afcd325ecd0328662156b3d9c3d80948f19ba3a4eb870cee2b", + "zh:b676f949e8274a2b6c3fa41f5428ea597125579c7b93bb50bb73a5e295a7a447", + "zh:cdf7e9460f28c2dbfe49a79a5022bd0d474ff18120d340738aa35456ba77ebca", + "zh:e24b59b4ed1c593facbf8051ec58550917991e2e017f3085dac5fb902d9908cb", + "zh:e3b5e1f5543cac9d9031a028f1c1be4858fb80fae69f181f21e9465e366ebfa2", + "zh:e9fddc0bcdb28503078456f0088851d45451600d229975fd9990ee92c7489a10", "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", ] } From 338a0122fbf36143e103768b5fc6f2cc25146a41 Mon Sep 17 00:00:00 2001 From: Domenic Gosein <87760323+goseind@users.noreply.github.com> Date: Tue, 7 Feb 2023 11:32:27 +0100 Subject: [PATCH 4/4] manually install reana chart #19 --- iac/tf/cluster/main-helm.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iac/tf/cluster/main-helm.tf b/iac/tf/cluster/main-helm.tf index 49b0af44..81c75a4a 100644 --- a/iac/tf/cluster/main-helm.tf +++ b/iac/tf/cluster/main-helm.tf @@ -91,6 +91,9 @@ resource "helm_release" "jupyterhub-chart" { # Reana +# manual helm install due to tf helm error +# helm install --devel reana-cvre reanahub/reana --wait --version 0.9.0 --values reana/values.yaml -n reana + resource "helm_release" "reana-chart" { name = "reana-${var.resource-suffix}" repository = "https://reanahub.github.io/reana/"