Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OpenEO template #180

Merged
merged 5 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions artifacts/openeo_k8s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
- 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: main
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"
1 change: 1 addition & 0 deletions templates/kubernetes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ metadata:
- k8s_galaxy.yaml
- dydns_egi_update_k8s.yml
- ades.yaml
- openeo.yaml
- proxy_host_k8s.yaml

topology_template:
Expand Down
53 changes: 53 additions & 0 deletions templates/openeo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
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/1.1.0/' ] }
Loading