From 4c8d6b78ecd3f861180b6f1ee2c5b2414de9ba69 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 4 Sep 2024 12:53:54 +0200 Subject: [PATCH 1/5] Add OpenEO template --- artifacts/openeo_k8s.yml | 83 +++++++++++++++++++++++++++++++++++++++ templates/kubernetes.yaml | 1 + templates/openeo.yaml | 54 +++++++++++++++++++++++++ 3 files changed, 138 insertions(+) create mode 100644 artifacts/openeo_k8s.yml create mode 100644 templates/openeo.yaml diff --git a/artifacts/openeo_k8s.yml b/artifacts/openeo_k8s.yml new file mode 100644 index 0000000..57b0d36 --- /dev/null +++ b/artifacts/openeo_k8s.yml @@ -0,0 +1,83 @@ +--- +- hosts: localhost + connection: local + vars: + stac_url: "{{ openeo_stac_url | default('https://stac.eodc.eu/api/v1') }}" + tasks: + - name: Create OpenEO Helm values file + copy: + dest: /tmp/openeo_config.yaml + mode: '644' + content: | + global: + env: + alembicDir: "/opt/openeo_argoworkflows_api/psql" + apiDns: 127.0.0.1:8000 + apiTLS: false + apiTitle: "OpenEO ArgoWorkflows" + apiDescription: "A K8S deployment of the openeo api for argoworkflows." + oidcUrl: "https://aai.egi.eu/auth/realms/egi" + odicOrganisation: "egi" + oidcRoles: ["developer"] + stacCatalogueUrl: "{{ stac_url }}" + workspaceRoot: "/user_workspaces" + executorImage: "ghcr.io/eodcgmbh/openeo-argoworkflows:executor-2024.7.1" + image: + repository: ghcr.io/eodcgmbh/openeo-argoworkflows + # Overrides the image tag whose default is the chart appVersion. + tag: "api-2024.7.2" + persistence: + capacity: "8Gi" + ingress: + enabled: true + className: "nginx" + hosts: + - host: openeo.{{ public_ip_address }}.nip.io + paths: + - path: / + pathType: ImplementationSpecific + + - name: Install git + package: + name: git + state: present + + - name: Download Helm chart + git: + repo: https://github.com/eodcgmbh/charts + dest: /opt/eodcgmbh-charts + version: master + force: false + + - name: Install Helm repositories + command: helm repo add {{ item.name }} {{ item.url }} + environment: + KUBECONFIG: "/etc/kubernetes/admin.conf" + register: helm_repo + changed_when: "'already exists' not in helm_repo.stdout" + loop: + - { name: "bitnami", url: "https://charts.bitnami.com/bitnami" } + - { name: "argo", url: "https://argoproj.github.io/argo-helm" } + - { name: "dask", url: "https://helm.dask.org" } + + - name: Install Helm dependencies + command: helm dependency build + args: + chdir: /opt/eodcgmbh-charts/eodc/openeo-argo + creates: /opt/eodcgmbh-charts/eodc/openeo-argo/charts + environment: + KUBECONFIG: "/etc/kubernetes/admin.conf" + + - name: Create namespace + command: kubectl create namespace openeo + environment: + KUBECONFIG: "/etc/kubernetes/admin.conf" + failed_when: false + register: namespace + changed_when: "'AlreadyExists' not in namespace.stdout" + + - name: Install OpenEO Helm chart + command: helm upgrade -n openeo --install openeo /opt/eodcgmbh-charts/eodc/openeo-argo --values /tmp/openeo_config.yaml + environment: + KUBECONFIG: "/etc/kubernetes/admin.conf" + diff --git a/templates/kubernetes.yaml b/templates/kubernetes.yaml index 36d0478..c7a0547 100644 --- a/templates/kubernetes.yaml +++ b/templates/kubernetes.yaml @@ -44,6 +44,7 @@ metadata: - k8s_galaxy.yaml - dydns_egi_update_k8s.yml - ades.yaml + - openeo_k8s.yml - proxy_host_k8s.yaml topology_template: diff --git a/templates/openeo.yaml b/templates/openeo.yaml new file mode 100644 index 0000000..05ae790 --- /dev/null +++ b/templates/openeo.yaml @@ -0,0 +1,54 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +imports: + - grycap_custom_types: https://raw.githubusercontent.com/grycap/tosca/main/custom_types.yaml + +description: Deploy OpenEO on top of a Kubernetes Virtual Cluster. + +metadata: + template_version: "1.0.0" + template_name: OpenEO + display_name: Deploy OpenEO on top of a Kubernetes Virtual Cluster + icon: images/openeo.png + tabs: + OpenEO: openeo_.* + parents: + - kubernetes.yaml + +topology_template: + + inputs: + openeo_stac_url: + type: string + description: OpenEO STAC Catalogue URL + default: "https://stac.eodc.eu/api/v1'" + + node_templates: + + openeo: + type: tosca.nodes.ec3.Application + capabilities: + endpoint: + properties: + ports: + http: + protocol: tcp + source: 80 + https: + protocol: tcp + source: 443 + interfaces: + Standard: + configure: + implementation: https://raw.githubusercontent.com/grycap/tosca/main/artifacts/openeo_k8s.yml + inputs: + openeo_stac_url: { get_input: openeo_stac_url } + public_ip_address: { get_attribute: [ front, public_address, 0 ] } + requirements: + - host: front + - dependency: lrms_front_end + + outputs: + openeo_endpoint: + value: { concat: [ 'https://openeo.', get_attribute: [ front, public_address, 0 ], '.nip.io/' ] } + From 6f808cbb2181e518134c2ec381d5a017d8283015 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 4 Sep 2024 12:57:23 +0200 Subject: [PATCH 2/5] Add OpenEO template --- templates/kubernetes.yaml | 2 +- templates/openeo.yaml | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/kubernetes.yaml b/templates/kubernetes.yaml index c7a0547..d15fc68 100644 --- a/templates/kubernetes.yaml +++ b/templates/kubernetes.yaml @@ -44,7 +44,7 @@ metadata: - k8s_galaxy.yaml - dydns_egi_update_k8s.yml - ades.yaml - - openeo_k8s.yml + - openeo.yaml - proxy_host_k8s.yaml topology_template: diff --git a/templates/openeo.yaml b/templates/openeo.yaml index 05ae790..964e2a7 100644 --- a/templates/openeo.yaml +++ b/templates/openeo.yaml @@ -50,5 +50,4 @@ topology_template: outputs: openeo_endpoint: - value: { concat: [ 'https://openeo.', get_attribute: [ front, public_address, 0 ], '.nip.io/' ] } - + value: { concat: [ 'https://openeo.', get_attribute: [ front, public_address, 0 ], '.nip.io/' ] } From 28777698da004c7d85475f798aea59b319d71d74 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 4 Sep 2024 13:06:30 +0200 Subject: [PATCH 3/5] Fix branch name --- artifacts/openeo_k8s.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/artifacts/openeo_k8s.yml b/artifacts/openeo_k8s.yml index 57b0d36..b9f9a59 100644 --- a/artifacts/openeo_k8s.yml +++ b/artifacts/openeo_k8s.yml @@ -46,7 +46,7 @@ git: repo: https://github.com/eodcgmbh/charts dest: /opt/eodcgmbh-charts - version: master + version: main force: false - name: Install Helm repositories @@ -80,4 +80,3 @@ command: helm upgrade -n openeo --install openeo /opt/eodcgmbh-charts/eodc/openeo-argo --values /tmp/openeo_config.yaml environment: KUBECONFIG: "/etc/kubernetes/admin.conf" - From 92e535fbc3e16a00246a1047700f851cb05e9a94 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 4 Sep 2024 13:15:12 +0200 Subject: [PATCH 4/5] Fix spaces --- artifacts/openeo_k8s.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/artifacts/openeo_k8s.yml b/artifacts/openeo_k8s.yml index b9f9a59..d565f90 100644 --- a/artifacts/openeo_k8s.yml +++ b/artifacts/openeo_k8s.yml @@ -31,11 +31,11 @@ ingress: enabled: true className: "nginx" - hosts: - - host: openeo.{{ public_ip_address }}.nip.io - paths: - - path: / - pathType: ImplementationSpecific + hosts: + - host: openeo.{{ public_ip_address }}.nip.io + paths: + - path: / + pathType: ImplementationSpecific - name: Install git package: From cecfc36807638c26ab8d42e0e4d6a2d271c3eb71 Mon Sep 17 00:00:00 2001 From: Miguel Caballer Date: Wed, 4 Sep 2024 13:30:11 +0200 Subject: [PATCH 5/5] Fix output url --- templates/openeo.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/openeo.yaml b/templates/openeo.yaml index 964e2a7..a1f6e80 100644 --- a/templates/openeo.yaml +++ b/templates/openeo.yaml @@ -50,4 +50,4 @@ topology_template: outputs: openeo_endpoint: - value: { concat: [ 'https://openeo.', get_attribute: [ front, public_address, 0 ], '.nip.io/' ] } + value: { concat: [ 'https://openeo.', get_attribute: [ front, public_address, 0 ], '.nip.io/1.1.0/' ] }