From a104cae848a3f13cb99c4a945b66d40481b19feb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= <valtri@civ.zcu.cz>
Date: Mon, 22 Apr 2024 15:13:08 +0000
Subject: [PATCH] Create ephemeral storage

---
 cesnet-central/deployments/fullhub.yaml | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/cesnet-central/deployments/fullhub.yaml b/cesnet-central/deployments/fullhub.yaml
index 0d190dd..f075781 100644
--- a/cesnet-central/deployments/fullhub.yaml
+++ b/cesnet-central/deployments/fullhub.yaml
@@ -39,6 +39,12 @@ singleuser:
         # sizeLimit problematic in this environment,
         # not needed for remote mounts
         empty_dir:
+      - name: scratch
+        ephemeral:
+          volumeClaimTemplate:
+            spec:
+              accessModes: [ "ReadWriteOnce" ]
+              storageClassName: local-path
     extraVolumeMounts:
       - name: cvmfs-host
         mountPath: "/cvmfs:shared"
@@ -46,9 +52,11 @@ singleuser:
         mountPath: '/mnt/b2drop:shared'
       - name: owncloud
         mountPath: '/mnt/owncloud:shared'
+      - name: scratch
+        mountPath: '/scratch'
   lifecycleHooks:
     postStart:
-      exec: { "command": ["/bin/sh", "-c", "ln -snf /mnt/b2drop $HOME/b2drop; ln -snf /mnt/owncloud $HOME/owncloud; ln -snf /cvmfs $HOME/cvmfs; mkdir -p /home/jovyan/.notebookCheckpoints"] }
+      exec: { "command": ["/bin/sh", "-c", "ln -snf /mnt/b2drop $HOME/b2drop; ln -snf /mnt/owncloud $HOME/owncloud; for d in cvmfs scratch; do if ! test -e $HOME/$d; then ln -snf /$d $HOME/$d; fi; done; mkdir -p /home/jovyan/.notebookCheckpoints"] }
   memory:
     limit: 6G
     guarantee: 128M
-- 
GitLab