diff --git a/README.md b/README.md
index dd4fe7d..fc9c470 100644
--- a/README.md
+++ b/README.md
@@ -9,30 +9,321 @@ This repository contains Helm charts for SciLifeLab Serve.
If you are using SciLifeLab Serve and notice a bug or if there is a feature you would like to be added feel free to [create an issue](https://github.com/ScilifelabDataCentre/serve/issues/new/choose) with a bug report or feature request.
## How to deploy
+
+### Prerequisites
+
+- A Kubernetes cluster version **1.28.6**
+- Helm 3
+- A storage class for dynamic provisioning of persistent volumes
+
+If you are going to run this on a remote cluster, then you probably don't need to think about this
+as these things will be provided by your cloud provider.
+
+But in case of a local deployment, navigate to the next section.
+
+#### Setup for local deployment
+
+If you are going to run this locally, you need to have a Kubernetes cluster running on your machine.
+You can use [Rancher Desktop](https://rancherdesktop.io/) for this purpose.
+
+Follow their instruction to install Rancher Desktop, and then start it.
+
+Recommended settings for Rancher Desktop:
+- `Preferences > Kubernetes` select kubernetes version `1.28.6`.
+- `Preferences > Container Engine` select `containerd` as the container engine.
+- `Preferences > Virtual Machine > Emulation` select `QEMU`
+ - If you are running on an M3 Mac select `VZ`
+- `Preferences > Virtual Machine > Hardware` select `4 CPUs` and `16 GB` of memory.
+
+##### Serve image
+
+By default, the image is pulled from the public registry. This image is the one we are using in production.
+So you don't need to build the image yourself if you want to just try it out locally.
+
+But if you want to develop, you need to build the image yourself.
+
+**Building image for Rancher Desktop**
+
+Rancher Desktop brings a number of tools when you install it.
+One of them is `nerdctl` which is a drop-in replacement for `docker` and `docker-compose`.
+
+Rancher Desktop also brings a local registry that you can use to push images to.
+And this registry can be accessed from your Kubernetes cluster and used as if you were using docker.
+
+See [Serve](https://github.com/ScilifelabDataCentre/serve/) repository for up-to-date instructions on
+how to build the image for local development.
+
+But this setup expects that you have an image tagged `mystudio` built using `nerdctl` and pushed to the `k8s.io` namespace.
+
+### Deploying
+
+> Using the following you'll make sure that your Rancher Desktop installation is working as expected using the default settings.
+> These instructions are almost the same as the ones you would use for a remote cluster except for the storage class.
+> If it doesn't work you should debug your installation and contact team members for help.
+
+**Outcomes of this section**
+- You'll prepare your environment for the proper local deployment of Serve;
+- Running instance of Serve on your local machine available on [http://studio.127.0.0.1.nip.io/](http://studio.127.0.0.1.nip.io/).
+
+
+
First, clone this repository
+
+```bash
+$ git clone https://github.com/ScilifelabDataCentre/serve-charts.git
+```
+
+Then navigate to the `serve-charts/serve` folder
+
+```bash
+$ cd serve-charts/serve
```
-git clone https://github.com/ScilifelabDataCentre/serve-charts.git
+
+Now you need to create an override file for the `values.yaml` file.
+
+Create a file called `values-local.yaml` and add the following content:
+
+```yaml filename="values-local.yaml"
+# https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors
+# for local development
+storageClass: &storage_class local-path
+#storage access mode
+access_mode: &access_mode ReadWriteOnce
+accessmode: *access_mode
+
+global:
+ studio:
+ superuserPassword: "Test@12345"
+ superuserEmail: "admin@sll.se"
+ storageClass: *storage_class
+ postgresql:
+ storageClass: *storage_class
+
+studio:
+ # Only locally on a debug environment
+ debug: true
+ storage:
+ storageClass: *storage_class
+ media:
+ storage:
+ storageClass: *storage_class
+ accessModes: *access_mode
+
+postgresql:
+ primary:
+ persistence:
+ storageClass: *storage_class
+ accessModes:
+ - *access_mode
```
-Then navigate to the `serve-charts/serve` folder, and run
+This is necessary because the default values are set for a production environment. Specifically, the storage class
+has to change because the default storage class is not available in a Rancher Desktop environment.
+```bash
+$ helm dependency update
+# The following command will install the chart with the values from values.yaml and values-local.yaml
+# values-local.yaml will override the values from values.yaml
+$ helm install serve . -f values.yaml -f values-local.yaml
```
-helm dependency update
-helm install serve .
+
+As a result you should have a running instance of Serve on your local machine available on [http://studio.127.0.0.1.nip.io/](http://studio.127.0.0.1.nip.io/).
+
+#### Swapping default docker image with the one built locally
+
+
+ TJ;DR Just commands
+
+ ```bash
+ $ git clone https://github.com/ScilifelabDataCentre/serve-charts.git
+ $ cd serve-charts/serve
+ $ cat < values-local.yaml
+environment: "local"
+# Path will be mounted using rancher desktop to the /app path in the container
+source_code_path: "/Users/nikch187/Projects/sll/serve"
+# https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors
+# for local development
+storageClass: &storage_class local-path
+#storage access mode
+access_mode: &access_mode ReadWriteOnce
+accessmode: *access_mode
+
+global:
+ studio:
+ superuserPassword: "Test@12345"
+ superuserEmail: "admin@sll.se"
+ storageClass: *storage_class
+ postgresql:
+ storageClass: *storage_class
+
+studio:
+ # Only locally on a debug environment
+ debug: true
+ storage:
+ storageClass: *storage_class
+ media:
+ storage:
+ storageClass: *storage_class
+ accessModes: *access_mode
+
+ # We use pull policy Never because see the following link:
+ # https://github.com/rancher-sandbox/rancher-desktop/issues/952#issuecomment-993135128
+ static:
+ image: mystudio
+ pullPolicy: Never
+
+ image:
+ repository: mystudio
+ pullPolicy: Never
+
+ securityContext:
+ # Disables security context for local development
+ # Essentially allow the container to run as root
+ enabled: false
+
+ readinessProbe:
+ enabled: false
+
+ livenessProbe:
+ enabled: false
+
+postgresql:
+ primary:
+ persistence:
+ storageClass: *storage_class
+ accessModes:
+ - *access_mode
+ EOF
+ $ helm upgrade serve . -f values.yaml -f values-local.yaml
+ ```
+
+
+**Outcomes of this section:**
+- Instead of a Django server, you'll have an ssh server running for the [PyCharm setup](https://github.com/ScilifelabDataCentre/serve/?tab=readme-ov-file#deploy-serve-for-local-development-with-rancher-desktop)
+- You'll have a host machine's folder with the [Serve](https://github.com/ScilifelabDataCentre/serve/) code mounted to the container;
+
+Now that everything is running, you can swap the default image with the one you built locally.
+
+> See the [Serve image section](https://github.com/ScilifelabDataCentre/serve/?tab=readme-ov-file#deploy-serve-for-local-development-with-rancher-desktop) for instructions on how to build the image.
+
+Go back to the `values-local.yaml` file update it with the following content:
+
+```yaml filename="values-local.yaml"
+environment: "local"
+
+# Path will be mounted using rancher desktop to the /app path in the container
+source_code_path: "/absolute/path/to/your/serve"
+# https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors
+# ...
+studio:
+ # Append the following to the end of the studio section
+
+ # We use pull policy Never because see the following link:
+ # https://github.com/rancher-sandbox/rancher-desktop/issues/952#issuecomment-993135128
+ static:
+ image: mystudio
+ pullPolicy: Never
+
+ image:
+ repository: mystudio
+ pullPolicy: Never
+
+ securityContext:
+ # Disables security context for local development
+ # Essentially allow the container to run as root
+ enabled: false
+
+ readinessProbe:
+ enabled: false
+
+ livenessProbe:
+ enabled: false
```
-Depending on your storageclass, you might have to set this aswell.
-For instance, if you use `microk8s`, them you run
+
+ Full content of the values-local.yaml file
+
+```yaml
+ environment: "local"
+ # Path will be mounted using rancher desktop to the /app path in the container
+ source_code_path: "/Users/nikch187/Projects/sll/serve"
+ # https://helm.sh/docs/chart_template_guide/yaml_techniques/#yaml-anchors
+ # for local development
+ storageClass: &storage_class local-path
+ #storage access mode
+ access_mode: &access_mode ReadWriteOnce
+ accessmode: *access_mode
+
+ global:
+ studio:
+ superuserPassword: "Test@12345"
+ superuserEmail: "admin@sll.se"
+ storageClass: *storage_class
+ postgresql:
+ storageClass: *storage_class
+
+ studio:
+ # Only locally on a debug environment
+ debug: true
+ storage:
+ storageClass: *storage_class
+ media:
+ storage:
+ storageClass: *storage_class
+ accessModes: *access_mode
+
+ # We use pull policy Never because see the following link:
+ # https://github.com/rancher-sandbox/rancher-desktop/issues/952#issuecomment-993135128
+ static:
+ image: mystudio
+ pullPolicy: Never
+
+ image:
+ repository: mystudio
+ pullPolicy: Never
+
+ securityContext:
+ # Disables security context for local development
+ # Essentially allow the container to run as root
+ enabled: false
+
+ readinessProbe:
+ enabled: false
+
+ livenessProbe:
+ enabled: false
+
+ postgresql:
+ primary:
+ persistence:
+ storageClass: *storage_class
+ accessModes:
+ - *access_mode
+ ```
+
+
+
+After doing this run the following command to upgrade the deployment:
+```bash
+helm upgrade serve . -f values.yaml -f values-local.yaml
```
-helm install --set global.postgresql.storageClass=microk8s-hostpath serve .
+
+Now you can proceed to [set up PyCharm](https://github.com/ScilifelabDataCentre/serve?tab=readme-ov-file#pycharm-setup)
+
+If you don't want to set up PyCharm, you can just run Django from the container.
+
+```bash
+$ kubectl get po
+# Get the name of the studio pod
+$ kubectl exec -it -- /bin/bash
+# Now you are inside the container
+$ sh scripts/run_web.sh
```
-All resources will by default be created in the default namespace.
-Serve will be avaliable at https://studio.127.0.0.1.nip.io
-Obs that you might have to make changes to your particular ingress controller (nginx is supported in this chart) to connect to the URL.
-If the ingress does not work for any reason, you can try to port-forward the studio service port to your localhost.
+Please note, that the folder you are in, `/app`, is the folder where the code is mounted.
+It means that you can make changes to the code on your host machine and see the changes in the container.
## Deploy an SSL certificate
@@ -84,10 +375,10 @@ studio:
inactive_users: false #Users that sign-up can be inactive by default if desired
csrf_trusted_origins: "https://studio.127.0.0.1.nip.io:8082" #extra trusted origin for django server, for example if you port-forward to port 8082
image: # using a local image registry with hostname k3d-registry
- repository: k3d-registry:35187/stackn:develop #This image can be built from Dockerfile (https://github.com/scaleoutsystems/stackn)
+ repository: k3d-registry:35187/serve:develop #This image can be built from Dockerfile (https://github.com/scaleoutsystems/serve)
pullPolicy: Always # used to ensure that each time we redeploy always pull the latest image
static:
- image: k3d-registry:35187/stackn-nginx:develop #This image can be built from Dockerfile.nginx (https://github.com/scaleoutsystems/stackn)
+ image: k3d-registry:35187/serve-nginx:develop #This image can be built from Dockerfile.nginx (https://github.com/scaleoutsystems/serve)
media:
storage:
accessModes: ReadWriteOnce
diff --git a/apps/custom-app/templates/deployment.yaml b/apps/custom-app/templates/deployment.yaml
index 95723ad..83b1e55 100644
--- a/apps/custom-app/templates/deployment.yaml
+++ b/apps/custom-app/templates/deployment.yaml
@@ -28,10 +28,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
seccompProfile:
diff --git a/apps/custom-app/values.yaml b/apps/custom-app/values.yaml
index a3879e2..af6c814 100644
--- a/apps/custom-app/values.yaml
+++ b/apps/custom-app/values.yaml
@@ -22,9 +22,6 @@ service:
name: customapp-svc
port: 80
-imagePullSecrets:
- - name: regcred
-
ingress:
secretName: prod-ingress
diff --git a/apps/dash/templates/deployment.yaml b/apps/dash/templates/deployment.yaml
index 5f71b08..beda770 100644
--- a/apps/dash/templates/deployment.yaml
+++ b/apps/dash/templates/deployment.yaml
@@ -28,10 +28,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/dash/values.yaml b/apps/dash/values.yaml
index e89640f..ffba171 100644
--- a/apps/dash/values.yaml
+++ b/apps/dash/values.yaml
@@ -18,9 +18,6 @@ service:
name: dashapp-svc
port: 80
-imagePullSecrets:
- - name: regcred
-
ingress:
secretName: prod-ingress
diff --git a/apps/jupyter-lab/templates/deployment.yaml b/apps/jupyter-lab/templates/deployment.yaml
index 16c308a..bacfc35 100644
--- a/apps/jupyter-lab/templates/deployment.yaml
+++ b/apps/jupyter-lab/templates/deployment.yaml
@@ -81,10 +81,6 @@ spec:
- name: {{ $key }}
mountPath: /home/jovyan/work/{{ $key }}
{{- end }}
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
volumes:
diff --git a/apps/jupyter-lab/values.yaml b/apps/jupyter-lab/values.yaml
index 33a3527..aaf7fdf 100644
--- a/apps/jupyter-lab/values.yaml
+++ b/apps/jupyter-lab/values.yaml
@@ -19,9 +19,6 @@ global:
apps:
volumek8s:
-imagePullSecrets:
- - name: regcred
-
minio:
access_key: minio
secret_key: minio123
diff --git a/apps/mlflow/chart/values.yaml b/apps/mlflow/chart/values.yaml
index 97fad01..a8a2e45 100644
--- a/apps/mlflow/chart/values.yaml
+++ b/apps/mlflow/chart/values.yaml
@@ -22,9 +22,6 @@ s3:
service:
port:
-imagePullSecrets:
- - name: regcred
-
ingress:
v1beta1: false
secretName: prod-ingress
diff --git a/apps/python-serve/chart/templates/deployment.yaml b/apps/python-serve/chart/templates/deployment.yaml
index f35e023..33871ff 100644
--- a/apps/python-serve/chart/templates/deployment.yaml
+++ b/apps/python-serve/chart/templates/deployment.yaml
@@ -27,10 +27,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/python-serve/chart/values.yaml b/apps/python-serve/chart/values.yaml
index fbabd29..b7fe70f 100644
--- a/apps/python-serve/chart/values.yaml
+++ b/apps/python-serve/chart/values.yaml
@@ -16,9 +16,6 @@ appconfig:
service:
name: pythonserve-svc
-imagePullSecrets:
- - name: regcred
-
ingress:
secretName: prod-ingress
diff --git a/apps/pytorch-serve/chart/values.yaml b/apps/pytorch-serve/chart/values.yaml
index 033bdfc..b42757b 100644
--- a/apps/pytorch-serve/chart/values.yaml
+++ b/apps/pytorch-serve/chart/values.yaml
@@ -42,9 +42,6 @@ model_card:
enabled: false
path: model-card
-imagePullSecrets:
- - name: regcred
-
ingress:
podSecurityContext:
diff --git a/apps/rstudio/templates/deployment.yaml b/apps/rstudio/templates/deployment.yaml
index 6b09467..ba96e87 100644
--- a/apps/rstudio/templates/deployment.yaml
+++ b/apps/rstudio/templates/deployment.yaml
@@ -28,10 +28,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/rstudio/values.yaml b/apps/rstudio/values.yaml
index e3beb34..7e58bbb 100644
--- a/apps/rstudio/values.yaml
+++ b/apps/rstudio/values.yaml
@@ -19,9 +19,6 @@ service:
name: rstudio-svc
port: 80
-imagePullSecrets:
- - name: regcred
-
ingress:
v1beta1: false
secretName: prod-ingress
diff --git a/apps/shiny/templates/deployment.yaml b/apps/shiny/templates/deployment.yaml
index 9357339..19f7214 100644
--- a/apps/shiny/templates/deployment.yaml
+++ b/apps/shiny/templates/deployment.yaml
@@ -28,10 +28,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/shiny/values.yaml b/apps/shiny/values.yaml
index 49a507c..7edac64 100644
--- a/apps/shiny/values.yaml
+++ b/apps/shiny/values.yaml
@@ -19,9 +19,6 @@ service:
name: shiny-svc
port: 80
-imagePullSecrets:
- - name: regcred
-
ingress:
secretName: prod-ingress
diff --git a/apps/tensorflow-serve/chart/values.yaml b/apps/tensorflow-serve/chart/values.yaml
index 87fb906..a8cdf5b 100644
--- a/apps/tensorflow-serve/chart/values.yaml
+++ b/apps/tensorflow-serve/chart/values.yaml
@@ -40,9 +40,6 @@ model_card:
enabled: false
path: model-card
-imagePullSecrets:
- - name: regcred
-
ingress:
podSecurityContext:
diff --git a/apps/tissuumaps/templates/deployment.yaml b/apps/tissuumaps/templates/deployment.yaml
index 1f0f5a7..a458df0 100644
--- a/apps/tissuumaps/templates/deployment.yaml
+++ b/apps/tissuumaps/templates/deployment.yaml
@@ -28,10 +28,6 @@ spec:
type: app
pod: {{ .Values.appname }}
spec:
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/tissuumaps/values.yaml b/apps/tissuumaps/values.yaml
index d84c914..1229e3e 100644
--- a/apps/tissuumaps/values.yaml
+++ b/apps/tissuumaps/values.yaml
@@ -21,9 +21,6 @@ service:
targetport: 80
port: 80
-imagePullSecrets:
- - name: regcred
-
ingress:
secretName: prod-ingress
diff --git a/apps/volumek8s/values.yaml b/apps/volumek8s/values.yaml
index c29e83d..3474e0c 100644
--- a/apps/volumek8s/values.yaml
+++ b/apps/volumek8s/values.yaml
@@ -1,3 +1,6 @@
+# locally
+# accessModes: ReadWriteOnce
+# remote
accessModes: ReadWriteMany
storageClass: default
@@ -9,4 +12,7 @@ project:
volume:
size: 10Mi
storageClass: false
+# locally
+# accessModes: ReadWriteOnce
+# remote
accessModes: ReadWriteMany
diff --git a/apps/vscode/templates/deployment.yaml b/apps/vscode/templates/deployment.yaml
index 6d1d85e..5aa9adc 100644
--- a/apps/vscode/templates/deployment.yaml
+++ b/apps/vscode/templates/deployment.yaml
@@ -32,10 +32,6 @@ spec:
affinity:
{{ .Values.affinity | toYaml | nindent 8 | trim }}
{{ end }}
- {{- with .Values.imagePullSecrets }}
- imagePullSecrets:
- {{- toYaml . | nindent 8 }}
- {{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
diff --git a/apps/vscode/values.yaml b/apps/vscode/values.yaml
index ba8e539..8dc9297 100644
--- a/apps/vscode/values.yaml
+++ b/apps/vscode/values.yaml
@@ -30,9 +30,6 @@ service:
port: 80
targetport: 8080
-imagePullSecrets:
- - name: regcred
-
ingress:
v1beta1: false
secretName: prod-ingress
diff --git a/serve/templates/celery-beat-deployment.yaml b/serve/templates/celery-beat-deployment.yaml
index 71ce6d4..dba1638 100644
--- a/serve/templates/celery-beat-deployment.yaml
+++ b/serve/templates/celery-beat-deployment.yaml
@@ -121,8 +121,6 @@ spec:
- mountPath: /app/studio/settings.py
subPath: settings.py
name: {{ .Release.Name}}-settings-configmap
- imagePullSecrets:
- - name: ghcrsecret
restartPolicy: Always
volumes:
- name: {{ .Release.Name}}-settings-configmap
diff --git a/serve/templates/celery-flower-deployment.yaml b/serve/templates/celery-flower-deployment.yaml
index a6e7089..d77a4fe 100644
--- a/serve/templates/celery-flower-deployment.yaml
+++ b/serve/templates/celery-flower-deployment.yaml
@@ -103,8 +103,6 @@ spec:
- mountPath: /app/studio/settings.py
subPath: settings.py
name: {{ .Release.Name}}-settings-configmap
- imagePullSecrets:
- - name: ghcrsecret
restartPolicy: Always
volumes:
{{- if .Values.chartcontroller.addSecret }}
diff --git a/serve/templates/celery-worker-deployment.yaml b/serve/templates/celery-worker-deployment.yaml
index 1a8e735..bd9e8a7 100644
--- a/serve/templates/celery-worker-deployment.yaml
+++ b/serve/templates/celery-worker-deployment.yaml
@@ -127,8 +127,6 @@ spec:
- mountPath: /app/studio/settings.py
subPath: settings.py
name: {{ .Release.Name}}-settings-configmap
- imagePullSecrets:
- - name: ghcrsecret
restartPolicy: Always
volumes:
{{- if .Values.chartcontroller.addSecret }}
diff --git a/serve/templates/event-listener-deployment.yaml b/serve/templates/event-listener-deployment.yaml
index 62fc082..5939dee 100644
--- a/serve/templates/event-listener-deployment.yaml
+++ b/serve/templates/event-listener-deployment.yaml
@@ -71,8 +71,6 @@ spec:
requests:
cpu: {{ .Values.eventListener.resources.requests.cpu }}
memory: {{ .Values.eventListener.resources.requests.memory }}
- imagePullSecrets:
- - name: ghcrsecret
restartPolicy: Always
volumes:
status: {}
diff --git a/serve/templates/media-vol.yaml b/serve/templates/media-vol.yaml
index f39274f..c541a4e 100644
--- a/serve/templates/media-vol.yaml
+++ b/serve/templates/media-vol.yaml
@@ -6,7 +6,7 @@ metadata:
"helm.sh/resource-policy": keep
spec:
accessModes:
- - {{ .Values.studio.media.storage.accessModes | default "ReadWriteMany"}}
+ - {{ .Values.studio.media.storage.accessModes }}
storageClassName: {{ include "stackn.studio.media.storageclass" . }}
resources:
requests:
diff --git a/serve/templates/nginx-deployment.yaml b/serve/templates/nginx-deployment.yaml
index 3e25624..5eef53b 100644
--- a/serve/templates/nginx-deployment.yaml
+++ b/serve/templates/nginx-deployment.yaml
@@ -60,6 +60,4 @@ spec:
requests:
cpu: {{ .Values.studio.static.resources.requests.cpu }}
memory: {{ .Values.studio.static.resources.requests.memory }}
- imagePullSecrets:
- - name: ghcrsecret
diff --git a/serve/templates/studio-deployment.yaml b/serve/templates/studio-deployment.yaml
index 73dcaa9..e8eda3e 100644
--- a/serve/templates/studio-deployment.yaml
+++ b/serve/templates/studio-deployment.yaml
@@ -54,9 +54,17 @@ spec:
containers:
- args:
- sh
+ {{ if eq .Values.environment "local" }}
+ - -c
+ - "/usr/sbin/sshd -D"
+ {{ else }}
- scripts/run_web.sh
+ {{ end }}
ports:
- containerPort: 8080
+ {{- if eq .Values.environment "local" }}
+ - containerPort: 22
+ {{- end }}
env:
- name: DEBUG
{{- if .Values.studio.debug }}
@@ -144,6 +152,10 @@ spec:
- name: mediavol
mountPath: {{ .Values.studio.media.mount_path }}
{{ end }}
+ {{ if eq .Values.environment "local" }}
+ - mountPath: /app
+ name: sourcecode
+ {{ end }}
resources:
limits:
cpu: {{ .Values.studio.resources.limits.cpu }}
@@ -175,9 +187,7 @@ spec:
initialDelaySeconds: {{ .Values.studio.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.studio.livenessProbe.periodSeconds }}
{{- end }}
- imagePullSecrets:
- - name: ghcrsecret
-
+
restartPolicy: Always
volumes:
{{- if .Values.chartcontroller.addSecret }}
@@ -196,3 +206,9 @@ spec:
persistentVolumeClaim:
claimName: {{ .Release.Name }}-{{ .Values.studio.media.storage.claimName }}
{{ end }}
+ {{ if eq .Values.environment "local" }}
+ - hostPath:
+ path: {{ .Values.source_code_path }}
+ type: Directory
+ name: sourcecode
+ {{ end }}
diff --git a/serve/templates/studio-service.yaml b/serve/templates/studio-service.yaml
index 39c2e8b..7c672ab 100644
--- a/serve/templates/studio-service.yaml
+++ b/serve/templates/studio-service.yaml
@@ -7,6 +7,11 @@ spec:
- name: "8080"
port: 8080
targetPort: 8080
+ {{- if eq .Values.environment "local" }}
+ - name: ssh
+ port: 22
+ targetPort: 22
+ {{- end }}
selector:
name: {{ .Release.Name }}-{{ .Values.studio.servicename }}
status:
diff --git a/serve/templates/studio-settings-configmap.yaml b/serve/templates/studio-settings-configmap.yaml
index a73c6a0..fc40a95 100644
--- a/serve/templates/studio-settings-configmap.yaml
+++ b/serve/templates/studio-settings-configmap.yaml
@@ -423,10 +423,10 @@ data:
VERSION = {{ .Values.studio.version | quote }}
MIGRATION_MODULES = {
- 'apps': 'apps.migrations',
- 'models': 'models.migrations',
- 'portal': 'portal.migrations',
- 'projects': 'projects.migrations',
+ "apps": "apps.migrations",
+ "models": "models.migrations",
+ "portal": "portal.migrations",
+ "projects": "projects.migrations",
"common": "common.migrations",
}
diff --git a/serve/values.yaml b/serve/values.yaml
index 9a6049b..2cff2ba 100644
--- a/serve/values.yaml
+++ b/serve/values.yaml
@@ -2,19 +2,28 @@
# Declare variables to be passed into STACKn templates.
# REQUIREMENT:
-# - set a storage class with ability to serve ReadWriteMany
+# - set a storage class with ability to serve ReadWriteOnce
# Name: storageClassName, and/or set anchor &śtorage_class
# Description: Set a storage class for the resources that are reused for multi-mount-points in cluster. To reduce wasteful copying we allow to use the same dataset volume to be mounted multiple times.
-# Default: microk8s-hostpath, use nfs-client for docker-for-desktop
+# Default: microk8s-hostpath, use local-path for k3s/Rancher Desktop
#Set global values to overide default
+environment: "remote"
+# Template for remote development
+# Storage class used by the KTH cluster
+storageClass: &storage_class ontap-nas
+#storageClass: &storage_class local-path
+#storage access mode
+access_mode: &access_mode ReadWriteMany
+#access_mode: &access_mode ReadWriteOnce
+
global:
studio:
superUser: "" ##these are currently not handled by stackn: default: admin
superuserPassword: ""
superuserEmail: "" ##these are currently not handled by stackn: default: admin@test.com
existingSecret: ""
- storageClass: ""
+ storageClass: *storage_class
postgresql:
auth:
username: studio
@@ -22,10 +31,9 @@ global:
postgresPassword: ""
database: studio
existingSecret: ""
- storageClass:
-
-
+ storageClass: *storage_class
+namespace: default
existingSecret: ""
serviceAccount:
create: true
@@ -78,7 +86,7 @@ studio:
replicas: 1
strategy:
type: Recreate
- image: ghcr.io/scilifelabdatacentre/serve/serve-ingress:develop-20240326
+ image: ghcr.io/scilifelabdatacentre/serve/serve-ingress:develop-20240417
pullPolicy: IfNotPresent
resources:
limits:
@@ -87,8 +95,8 @@ studio:
requests:
cpu: "100m"
memory: "256Mi"
- image:
- repository: ghcr.io/scilifelabdatacentre/serve/serve-studio:develop-20240326
+ image:
+ repository: ghcr.io/scilifelabdatacentre/serve/serve-studio:develop-20240417
pullPolicy: IfNotPresent
resources:
limits:
@@ -98,12 +106,12 @@ studio:
cpu: "400m"
memory: "2Gi"
storage:
- storageClass: ""
+ storageClass: *storage_class
media:
storage:
- storageClass: ""
+ storageClass: *storage_class
size: "5Gi"
- accessModes: ReadWriteMany
+ accessModes: *access_mode
claimName: studio-media
mountStudio: false
mount_path: /app/media/
@@ -159,13 +167,11 @@ studio:
#kubernetes config
kubeconfig: ""
-#storage access mode
-accessmode: ReadWriteMany
-
+accessmode: *access_mode
#the cluster domain name (default usually cluster.local)
cluster_domain: cluster.local
-# Enable ingress if you want your to access the studio solution from a kubernetes host/localhost.
+# Enable ingress if you want to access the studio solution from a kubernetes host/localhost.
domain: studio.127.0.0.1.nip.io
session_cookie_domain: .127.0.0.1.nip.io
ingress:
@@ -203,8 +209,8 @@ postgresql:
enabled: true
size: "10Gi"
accessModes:
- - ReadWriteMany
- storageClass:
+ - *access_mode
+ storageClass: *storage_class
podLabels: {"app":"stackn-studio"}
redis:
@@ -223,21 +229,10 @@ rabbitmq:
persistence:
enabled: true
-
-
-# Will be added in future realease, for now keep "enabled:false"
+# Will be added in future release, for now keep "enabled:false"
postgresql-ha:
enabled: false
-### DEPLOY SECRETS WITH private helm chart 'secrets' from platform/secrets
-## Name: imagePullSecret
-## Description: Secret to pull images from our private repository.
-imagePullSecrets:
- - name: regcred
-
-## to create a regcred
-## kubectl create secret docker-registry regcred --docker-server= --docker-username= --docker-password=
-
celeryWorkers:
replicas: 2
resources: