Skip to content

Commit

Permalink
SS 841 Add new app type TissUUmaps (#150)
Browse files Browse the repository at this point in the history
* Added a new chart and app fixture for the TissUUmaps app type. 

Co-authored-by: Viktor Sandström <[email protected]>
  • Loading branch information
alfredeen and sandstromviktor authored Feb 13, 2024
1 parent 96ad470 commit 4de2778
Show file tree
Hide file tree
Showing 10 changed files with 374 additions and 1 deletion.
5 changes: 5 additions & 0 deletions charts/apps/tissuumaps/chart/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
appVersion: "0.1"
description: A Helm chart tissuumaps apps
name: tissuumaps App
version: 0.0.1
76 changes: 76 additions & 0 deletions charts/apps/tissuumaps/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.appname }}
namespace: {{ .Values.namespace }}
spec:
replicas: 1
selector:
matchLabels:
release: {{ $.Release.Name }}
app: {{ .Values.appname }}
project: {{ $.Values.project.slug }}
type: app
pod: {{ .Values.appname }}
template:
metadata:
annotations:
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
# prometheus.io/port: "8501"
labels:
release: {{ $.Release.Name }}
app: {{ .Values.appname }}
project: {{ $.Values.project.slug }}
networking/allow-internet-egress: "true"
networking/allow-egress-to-studio-web: "true"
type: app
pod: {{ .Values.appname }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
automountServiceAccountToken: false
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Values.appname }}
image: {{ .Values.appconfig.image }}
imagePullPolicy: Always
ports:
- containerPort: {{ .Values.service.targetport }}
securityContext:
{{- toYaml .Values.securityContext | nindent 10 }}
resources:
{{- toYaml .Values.flavor | nindent 10 }}
{{- if .Values.apps.volumeK8s }}
volumeMounts:
{{- range $key, $value := .Values.apps.volumeK8s }}
- name: {{ $key }}
mountPath: {{ $.Values.appconfig.path }}
{{- end }}
{{- end }}
- name: tmp-empty
mountPath: /tmp
- name: {{ .Release.Name }}-tissuumaps-configmap
mountPath: /tissuumaps.cfg
subPath: tissuumaps.cfg
terminationGracePeriodSeconds: 30
dnsPolicy: ClusterFirst
{{ if .Values.apps.volumeK8s }}
volumes:
{{- range $key, $value := .Values.apps.volumeK8s }}
- name: {{ $key }}
persistentVolumeClaim:
claimName: {{ $value.release }}
{{- end }}
{{ end }}
- name: tmp-empty
emptyDir: {}
- name: {{ .Release.Name }}-tissuumaps-configmap
configMap:
name: {{ .Release.Name }}-tissuumaps-configmap
items:
- key: tissuumaps.cfg
path: tissuumaps.cfg
28 changes: 28 additions & 0 deletions charts/apps/tissuumaps/chart/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ .Release.Name }}-ingress
namespace: {{ .Values.namespace }}
labels:
io.kompose.service: {{ .Release.Name }}-ingress
annotations:
{{ if ne .Values.permission "public" }}
nginx.ingress.kubernetes.io/auth-url: "{{ .Values.global.protocol }}://{{ .Values.global.auth_domain }}:8080/auth/?release={{ .Values.release }}"
nginx.ingress.kubernetes.io/auth-signin: "https://{{ .Values.global.domain }}/accounts/login/?next=$scheme%3A%2F%2F$host"
{{- end }}
spec:
rules:
- host: {{ .Release.Name }}.{{ .Values.global.domain }}
http:
paths:
- path: /
backend:
service:
name: {{ .Values.service.name }}
port:
number: {{ .Values.service.port }}
pathType: ImplementationSpecific
tls:
- secretName: {{ .Values.ingress.secretName }}
hosts:
- {{ .Values.global.domain }}
14 changes: 14 additions & 0 deletions charts/apps/tissuumaps/chart/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.service.name }}
namespace: {{ .Values.namespace }}
labels:
run: {{ .Release.Name }}-tissuumaps
spec:
ports:
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetport }}
selector:
release: {{ $.Release.Name }}
11 changes: 11 additions & 0 deletions charts/apps/tissuumaps/chart/templates/tissuumaps-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-tissuumaps-configmap
namespace: {{ .Values.namespace }}
data:
tissuumaps.cfg: |-
READ_ONLY = True
PLUGIN_FOLDER = "/mnt/data/plugins/"
SLIDE_DIR = "/mnt/data/shared/"
DEFAULT_PROJECT = "project.tmap"
40 changes: 40 additions & 0 deletions charts/apps/tissuumaps/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace: default
appname: tissuumaps
project:
name: project
slug: project-slug

global:
protocol: TCP

apps:
volumek8s:

appconfig:
#port: 80 Instead uses the port and target port defined in the fixture
image: docker.io/cavenel/tissuumaps:3.2.0.4 # ghcr.io/tissuumaps/tissuumaps:3
path: /mnt/data/

service:
name: tissuumaps-svc

imagePullSecrets:
- name: regcred

ingress:
secretName: prod-ingress

podSecurityContext:
seccompProfile:
type: RuntimeDefault
fsGroup: 1000

securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
allowPrivilegeEscalation: false
privileged: false
capabilities:
drop:
- all
49 changes: 49 additions & 0 deletions charts/apps/tissuumaps/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"category": "serve",
"description": "",
"name": "Dash App",
"priority": "400",
"settings": {
"appconfig": {
"image": {
"default": "registry/repository/image:tag",
"title": "Image",
"type": "string"
},
"meta": {
"title": "Configurations"
},
"port": {
"default": "8000",
"title": "Port",
"type": "number"
}
},
"default_values": {
"port": "80",
"targetport": "8000"
},
"flavor": "one",
"logs": [
"serve"
],
"permissions": {
"private": {
"option": "true",
"value": "false"
},
"project": {
"option": "true",
"value": "true"
},
"public": {
"option": "true",
"value": "false"
}
}
},
"slug": "tissuumaps",
"table_field": {
"url": "https://{{ release }}.{{ global.domain }}"
}
}
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ services:
event-listener:
user: "${UID}:${GID}"
container_name: event-listener
image: ghcr.io/scilifelabdatacentre/serve-event-listener/event-listener:v0.1.3
image: ghcr.io/scilifelabdatacentre/serve-event-listener/event-listener:v0.1.5
environment:
- KUBECONFIG=/cluster.conf
- DEBUG=True
Expand Down
46 changes: 46 additions & 0 deletions fixtures/apps_fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -825,5 +825,51 @@
},
"model": "apps.apps",
"pk": 27
},
{
"fields": {
"category": "serve",
"chart": "apps/tissuumaps/chart",
"created_on": "2023-08-25T21:34:37.815Z",
"description": "Apps built with the TissUUmaps image.",
"logo": "tissuumaps-logo.svg",
"name": "TissUUmaps App",
"priority": "400",
"settings": {
"apps": {
"Persistent Volume": "one"
},
"default_values": {
"port": "80",
"targetport": "80"
},
"flavor": "one",
"logs": [
"serve"
],
"permissions": {
"private": {
"option": "true",
"value": "false"
},
"project": {
"option": "true",
"value": "true"
},
"public": {
"option": "false",
"value": "false"
}
},
"publishable": "true"
},
"slug": "tissuumaps",
"table_field": {
"url": "https://{{ release }}.{{ global.domain }}"
},
"updated_on": "2023-08-25T19:45:03.927Z"
},
"model": "apps.apps",
"pk": 28
}
]
104 changes: 104 additions & 0 deletions static/images/logos/apps/tissuumaps-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4de2778

Please sign in to comment.