From 803d82ef6f1c0bd6e6d7a22138fcca01d2449740 Mon Sep 17 00:00:00 2001
From: Sebastian <sebastian.karius@informatik.uni-halle.de>
Date: Thu, 7 Nov 2024 14:26:16 +0100
Subject: [PATCH] remove nginx-cors; add tensorflow env

---
 .gitlab-ci.yml                            |  3 --
 docker-compose.yml                        | 10 +-----
 docker/coder-med/Dockerfile               |  5 ++-
 docker/coder-ubuntu_22-python/Dockerfile  |  5 ++-
 docker/nginx-cors/Dockerfile              |  5 ---
 docker/nginx-cors/nginx.conf.template     | 16 ---------
 helm/nginx-cors/.helmignore               | 23 -------------
 helm/nginx-cors/Chart.yaml                | 24 -------------
 helm/nginx-cors/templates/NOTES.txt       |  3 --
 helm/nginx-cors/templates/deployment.yaml | 41 -----------------------
 helm/nginx-cors/templates/ingress.yaml    | 22 ------------
 helm/nginx-cors/templates/service.yaml    | 14 --------
 helm/nginx-cors/values.yaml               |  3 --
 13 files changed, 9 insertions(+), 165 deletions(-)
 delete mode 100644 docker/nginx-cors/Dockerfile
 delete mode 100644 docker/nginx-cors/nginx.conf.template
 delete mode 100644 helm/nginx-cors/.helmignore
 delete mode 100644 helm/nginx-cors/Chart.yaml
 delete mode 100644 helm/nginx-cors/templates/NOTES.txt
 delete mode 100644 helm/nginx-cors/templates/deployment.yaml
 delete mode 100644 helm/nginx-cors/templates/ingress.yaml
 delete mode 100644 helm/nginx-cors/templates/service.yaml
 delete mode 100644 helm/nginx-cors/values.yaml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 85a8156..6d63849 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -39,13 +39,11 @@ helm-package:
     - helm dep build helm/ti-coder
     - helm package helm/ti-coder
     - helm package helm/ti-lamp
-    - helm package helm/nginx-cors
   artifacts:
     paths:
       - vdo-ninja-0.1.2.tgz
       - ti-coder-0.2.6.tgz
       - ti-lamp-0.1.2.tgz
-      - nginx-cors-0.1.4.tgz
     expire_in: 1 hour
 
 helm-publish:
@@ -62,7 +60,6 @@ helm-publish:
     - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@vdo-ninja-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
     - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-coder-0.2.6.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
     - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@ti-lamp-0.1.2.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
-    - 'curl --request POST --user gitlab-ci-token:$CI_JOB_TOKEN --form "chart=@nginx-cors-0.1.4.tgz" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"'
 
 stages:
   - build
diff --git a/docker-compose.yml b/docker-compose.yml
index 7324bf6..af7cee3 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -37,12 +37,4 @@ services:
       dockerfile: Dockerfile
       context: ./docker/php-fpm_83
       cache_from:
-        - ${CI_REGISTRY}/studio-r215/containerize/php-fpm:83
-
-  nginx-cors:
-    image: ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.3
-    build:
-      dockerfile: Dockerfile
-      context: ./docker/nginx-cors
-      cache_from:
-        - ${CI_REGISTRY}/studio-r215/containerize/nginx-cors:1.0.3
\ No newline at end of file
+        - ${CI_REGISTRY}/studio-r215/containerize/php-fpm:83
\ No newline at end of file
diff --git a/docker/coder-med/Dockerfile b/docker/coder-med/Dockerfile
index 8bf9d74..8bb26ae 100644
--- a/docker/coder-med/Dockerfile
+++ b/docker/coder-med/Dockerfile
@@ -59,4 +59,7 @@ USER ubuntu
 WORKDIR /home/ubuntu
 
 # add .local/bin to PATH to be able to directly call python modules installed by pipx
-ENV PATH="${PATH}:/home/ubuntu/.local/bin"
\ No newline at end of file
+ENV PATH="${PATH}:/home/ubuntu/.local/bin"
+
+# prevent tensorflow from allocation all vram
+ENV TF_FORCE_GPU_ALLOW_GROWTH=true
\ No newline at end of file
diff --git a/docker/coder-ubuntu_22-python/Dockerfile b/docker/coder-ubuntu_22-python/Dockerfile
index e8037f8..6db07f2 100644
--- a/docker/coder-ubuntu_22-python/Dockerfile
+++ b/docker/coder-ubuntu_22-python/Dockerfile
@@ -76,4 +76,7 @@ USER coder
 WORKDIR /home/coder
 
 # add .local/bin to PATH to be able to directly call python modules installed by pipx
-ENV PATH="${PATH}:/home/coder/.local/bin"
\ No newline at end of file
+ENV PATH="${PATH}:/home/coder/.local/bin"
+
+# prevent tensorflow from allocation all vram
+ENV TF_FORCE_GPU_ALLOW_GROWTH=true
\ No newline at end of file
diff --git a/docker/nginx-cors/Dockerfile b/docker/nginx-cors/Dockerfile
deleted file mode 100644
index 95e418a..0000000
--- a/docker/nginx-cors/Dockerfile
+++ /dev/null
@@ -1,5 +0,0 @@
-FROM nginx:alpine
-
-WORKDIR /etc/nginx
-COPY nginx.conf.template nginx.conf.template
-CMD [ "/bin/sh" , "-c" , "envsubst < nginx.conf.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'" ]
\ No newline at end of file
diff --git a/docker/nginx-cors/nginx.conf.template b/docker/nginx-cors/nginx.conf.template
deleted file mode 100644
index 6ad8aa9..0000000
--- a/docker/nginx-cors/nginx.conf.template
+++ /dev/null
@@ -1,16 +0,0 @@
-server {
-  listen 80;
-
-  location /playground {
-    add_header Content-Security-Policy "default-src 'self'; connect-src 'self';";
-    add_header Content-Type text/html;
-    return 200 '<html><head><title>Playground</title></head><body>Playground</body></html>';
-  }
-
-  location / {
-    add_header 'Access-Control-Allow-Origin' '*';
-    add_header 'Access-Control-Allow-Headers' 'Authorization,Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range';
-    add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
-    proxy_pass 'https://${API_URL}/';
-  }
-}
\ No newline at end of file
diff --git a/helm/nginx-cors/.helmignore b/helm/nginx-cors/.helmignore
deleted file mode 100644
index 0e8a0eb..0000000
--- a/helm/nginx-cors/.helmignore
+++ /dev/null
@@ -1,23 +0,0 @@
-# Patterns to ignore when building packages.
-# This supports shell glob matching, relative path matching, and
-# negation (prefixed with !). Only one pattern per line.
-.DS_Store
-# Common VCS dirs
-.git/
-.gitignore
-.bzr/
-.bzrignore
-.hg/
-.hgignore
-.svn/
-# Common backup files
-*.swp
-*.bak
-*.tmp
-*.orig
-*~
-# Various IDEs
-.project
-.idea/
-*.tmproj
-.vscode/
diff --git a/helm/nginx-cors/Chart.yaml b/helm/nginx-cors/Chart.yaml
deleted file mode 100644
index 89d39d9..0000000
--- a/helm/nginx-cors/Chart.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-apiVersion: v2
-name: nginx-cors
-description: Nginx reverse proxy with cors set to *
-
-# A chart can be either an 'application' or a 'library' chart.
-#
-# Application charts are a collection of templates that can be packaged into versioned archives
-# to be deployed.
-#
-# Library charts provide useful utilities or functions for the chart developer. They're included as
-# a dependency of application charts to inject those utilities and functions into the rendering
-# pipeline. Library charts do not define any templates and therefore cannot be deployed.
-type: application
-
-# This is the chart version. This version number should be incremented each time you make changes
-# to the chart and its templates, including the app version.
-# Versions are expected to follow Semantic Versioning (https://semver.org/)
-version: 0.1.4
-
-# This is the version number of the application being deployed. This version number should be
-# incremented each time you make changes to the application. Versions are not expected to
-# follow Semantic Versioning. They should reflect the version the application is using.
-# It is recommended to use it with quotes.
-appVersion: "1.0.3"
diff --git a/helm/nginx-cors/templates/NOTES.txt b/helm/nginx-cors/templates/NOTES.txt
deleted file mode 100644
index 04b928e..0000000
--- a/helm/nginx-cors/templates/NOTES.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Installed nginx cors * reverse proxy.
-
-https://{{ .Values.url }}
\ No newline at end of file
diff --git a/helm/nginx-cors/templates/deployment.yaml b/helm/nginx-cors/templates/deployment.yaml
deleted file mode 100644
index f03702b..0000000
--- a/helm/nginx-cors/templates/deployment.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-apiVersion: apps/v1
-kind: Deployment
-
-metadata:
-  name: nginx-cors
-  labels:
-    app: nginx-cors
-
-spec:
-  replicas: 1
-  selector:
-    matchLabels:
-      app: nginx-cors
-  template:
-    metadata:
-      name: nginx-cors
-      labels:
-        app: nginx-cors
-    spec:
-      containers:
-      - name: nginx-cors
-        image: "mcr.informatik.uni-halle.de/studio-r215/containerize/nginx-cors:{{ .Chart.AppVersion }}"
-        resources:
-            requests:
-                memory: "64Mi"
-                cpu: "50m"
-            limits:
-                memory: "128Mi"
-                cpu: "100m"
-        env:
-          - name: API_URL
-            value: {{ .Values.api }}
-        ports:
-        - containerPort: 80
-        readinessProbe:
-          httpGet:
-            path: /playground
-            port: 80
-          initialDelaySeconds: 10
-          periodSeconds: 20
-      restartPolicy: Always
\ No newline at end of file
diff --git a/helm/nginx-cors/templates/ingress.yaml b/helm/nginx-cors/templates/ingress.yaml
deleted file mode 100644
index d634c1b..0000000
--- a/helm/nginx-cors/templates/ingress.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-{{- if .Values.url }}
-apiVersion: networking.k8s.io/v1
-kind: Ingress
-
-metadata:
-  name: nginx-cors-ingress
-  labels:
-    app: nginx-cors
-
-spec:
-  rules:
-  - host: "{{ .Values.url }}.tikube.informatik.uni-halle.de"
-    http:
-      paths:
-      - path: /
-        pathType: Prefix
-        backend:
-          service:
-            name: nginx-cors-service
-            port:
-              number: 80
-{{- end }}
\ No newline at end of file
diff --git a/helm/nginx-cors/templates/service.yaml b/helm/nginx-cors/templates/service.yaml
deleted file mode 100644
index f6a97d9..0000000
--- a/helm/nginx-cors/templates/service.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-apiVersion: v1
-kind: Service
-metadata:
-  name: nginx-cors-service
-  labels:
-    app: nginx-cors
-spec:
-  selector:
-    app: nginx-cors
-  ports:
-    - protocol: TCP
-      port: 80
-      targetPort: 80
-  type: ClusterIP
\ No newline at end of file
diff --git a/helm/nginx-cors/values.yaml b/helm/nginx-cors/values.yaml
deleted file mode 100644
index 9d44236..0000000
--- a/helm/nginx-cors/values.yaml
+++ /dev/null
@@ -1,3 +0,0 @@
-# url definiert den URL Prefix für die Anwendung. Wenn url nicht definiert ist, wird der Ingress nicht erstellt.
-url: ~
-api: ~
\ No newline at end of file
-- 
GitLab