Skip to content
This repository has been archived by the owner on Nov 25, 2022. It is now read-only.

Add argo specifications #173

Merged
merged 17 commits into from
Nov 15, 2021
1 change: 1 addition & 0 deletions .github/ct.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ chart-repos:
- jupyterhub=https://jupyterhub.github.io/helm-chart/
- bitnami=https://charts.bitnami.com/bitnami
- datadoghq=https://helm.datadoghq.com
- argo=https://argoproj.github.io/argo-helm
target-branch: main
debug: true
remote: origin
Expand Down
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,24 @@ kubernetes create namespace test
helm upgrade --install test --set proxy.secretToken=XXXXXXXXXX illumidesk/illumidesk --version 3.2.0 -n test
```

## Steps to setup argo on a new cluster

```bash
helm install argo argo/argo-workflows -n argo --create-namespace
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Abhi94N perhaps it's best to abstract this away by deploying Argo with a sub-chart?

NOTE: after today's review (11.11.2021) this will stay in place since it's a cluster-level resource. We have opened issue #175 and that chart could include the Argo setup as a sub-chart.

```

```bash
helm install argo-events argo/argo-events --set singleNamespace=false --set namespace='' -n argo-events --create-namespace
```

```bash
helm install argo-events-nats nats/nats --set cluster.enabled=true -n argo-events
```

```bash
helm install argo-events-stan nats/stan --set stan.nats.url=nats://argo-events-nats.argo-events.svc.cluster.local:4222 --set stan.clusterID=argo-events-stan --set cluster.enabled=true -n argo-events
```

## Uninstall the Chart

```bash
Expand Down
7 changes: 5 additions & 2 deletions charts/illumidesk/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@ dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 10.1.3
digest: sha256:e4bd5d2770c6a02dba48a0694412284caa2b599da4af2d27a432464229105f83
generated: "2021-09-23T22:33:40.589230523Z"
- name: argo-events
repository: https://argoproj.github.io/argo-helm
version: 1.8.0
digest: sha256:21dd5f662016d7fc3bd84e191ffcd81778014787aafc89e1b846a7c29fa263c7
generated: "2021-10-28T23:42:56.767443+05:30"
5 changes: 4 additions & 1 deletion charts/illumidesk/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: illumidesk
version: 5.9.8
version: 5.10.0
appVersion: 1.2.0
description: An extention of the JupyterHub Chart with additional IllumiDesk resources
icon: https://configs.illumidesk.com/images/illumidesk-80.png
Expand All @@ -15,6 +15,9 @@ dependencies:
version: "10.1.3"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled
- name: argo-events
version: "1.8.0"
repository: https://argoproj.github.io/argo-helm
maintainers:
- name: IllumiDesk Team
email: [email protected]
42 changes: 42 additions & 0 deletions charts/illumidesk/templates/argo_amqp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
apiVersion: v1
kind: Service
metadata:
labels:
component: argo-rabbitmq
name: argo-rabbitmq-service
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: main
port: 5672
- name: management
port: 15672
selector:
app: argo-rabbitmq-task-queue
component: argo-rabbitmq

---
apiVersion: v1
kind: ReplicationController
metadata:
labels:
component: argo-rabbitmq
name: argo-rabbitmq-controller
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
template:
metadata:
labels:
app: argo-rabbitmq-task-queue
component: argo-rabbitmq
spec:
containers:
- image: rabbitmq:3.8.22-management-alpine
name: argo-rabbitmq
ports:
- containerPort: 5672
- containerPort: 15672
resources:
limits:
cpu: 100m
10 changes: 10 additions & 0 deletions charts/illumidesk/templates/argo_bus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: default
namespace: {{ .Release.Namespace }}
spec:
nats:
exotic:
url: nats://argo-events-nats.argo-events.svc:4222
clusterID: argo-events-stan
7 changes: 7 additions & 0 deletions charts/illumidesk/templates/argo_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: argo-config
namespace: {{ .Release.Namespace }}
data:
PARALLEL_AUTOGRADING: "1"
36 changes: 36 additions & 0 deletions charts/illumidesk/templates/argo_event_source.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: autograde-event-source
namespace: {{ .Release.Namespace }}
spec:
amqp:
autograde_events:
# amqp server url
url: amqp://argo-rabbitmq-service.{{ .Release.Namespace }}.svc.cluster.local:5672
# jsonBody specifies that all event body payload coming from this
# source will be JSON
jsonBody: true
# name of the exchange.
exchangeName: {{ .Release.Namespace }}
# exchange type. more info at https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges
exchangeType: topic
# routing key
routingKey: autograde_events
queueDeclare:
name: autograde_events
durable: false
autoDelete: false
exclusive: true
noWait: false
# optional backoff time for connection retries.
# if not provided, default connection backoff time will be used.
connectionBackoff:
# duration in nanoseconds, or strings like "1s", "1m". following value is 10 seconds
duration: 10s
# how many backoffs
steps: 5
# factor to increase on each step.
# setting factor > 1 makes backoff exponential.
factor: 2
jitter: 0.2
33 changes: 33 additions & 0 deletions charts/illumidesk/templates/argo_role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: operate-workflow-sa-{{ .Release.Namespace }}
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: operate-workflow-role-{{ .Release.Namespace }}
rules:
- apiGroups:
- argoproj.io
verbs:
- "*"
resources:
- workflows
- workflowtemplates
- cronworkflows
- clusterworkflowtemplates
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: operate-workflow-role-binding-{{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: operate-workflow-role-{{ .Release.Namespace }}
subjects:
- kind: ServiceAccount
name: operate-workflow-sa-{{ .Release.Namespace }}
namespace: {{ .Release.Namespace }}
74 changes: 74 additions & 0 deletions charts/illumidesk/templates/argo_sensor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: autograde-sensor
namespace: {{ .Release.Namespace }}
spec:
template:
securityContext:
privileged: true
runAsUser: 0
serviceAccountName: operate-workflow-sa-{{ .Release.Namespace }}
dependencies:
- name: autograding-event-dep
eventSourceName: autograde-event-source
eventName: autograde_events
triggers:
- template:
name: autograde-workflow-trigger
k8s:
group: argoproj.io
version: v1alpha1
resource: workflows
operation: create
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: autograde-workflow-
jgwerner marked this conversation as resolved.
Show resolved Hide resolved
namespace: {{ .Release.Namespace }}
spec:
ttlStrategy:
secondsAfterSuccess: 60
synchronization:
semaphore:
configMapKeyRef:
name: argo-config
key: PARALLEL_AUTOGRADING
entrypoint: autograde-worker
volumes:
- name: shared-pv-{{ .Release.Namespace }}
persistentVolumeClaim:
claimName: shared-pvc-{{ .Release.Namespace }}
- name: grader-pv-{{ .Release.Namespace }}
persistentVolumeClaim:
claimName: grader-pvc-{{ .Release.Namespace }}
templates:
- name: autograde-worker
container:
image: illumidesk/grader-notebook:latest
imagePullPolicy: Always
command: [ild]
args: ["process_message", "message"]
securityContext:
privileged: true
runAsNonRoot: true
runAsUser: 10001
env:
jgwerner marked this conversation as resolved.
Show resolved Hide resolved
- name: JUPYTERHUB_API_URL
valueFrom:
configMapKeyRef:
name: hub-illumidesk-cm
key: JUPYTERHUB_API_URL
volumeMounts:
- name: grader-pv-{{ .Release.Namespace }}
mountPath: /home
subPath: illumidesk-courses/{{ .Release.Namespace }}/home
- name: shared-pv-{{ .Release.Namespace }}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed

mountPath: /srv/nbgrader/exchange
subPath: {{ .Release.Namespace }}/exchange
parameters:
- src:
dependencyName: autograding-event-dep
dest: spec.templates.0.container.args.1
7 changes: 7 additions & 0 deletions charts/illumidesk/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,10 @@ graderSetupService:
graderSpawnerMemLimit: ""
# Max Storage allocated for Grader PV and PVCss
graderSpawnerStorage: "2Gi"

argo-events:
namespace:
valueFrom:
configMapKeyRef:
name: hub-illumidesk-cm
key: ORGANIZATION_NAME
Binary file added docs/illumidesk-5.10.0.tgz
Binary file not shown.
Loading