1+ apiVersion : apps/v1
2+ kind : Deployment
3+ metadata :
4+ name : code-server-deployment
5+ labels :
6+ app : code-server
7+ spec :
8+ replicas : 1
9+ selector :
10+ matchLabels :
11+ app : code-server
12+ template :
13+ metadata :
14+ labels :
15+ app : code-server
16+ spec :
17+ initContainers :
18+ - name : init-file-on-volume
19+ image : eoepca/pde-code-server:1.0.0
20+ command :
21+ - sh
22+ - ' -c'
23+ - sh /opt/init/.init.sh
24+ volumeMounts :
25+ - name : workspace-volume
26+ mountPath : /workspace
27+ - name : init
28+ mountPath : /opt/init/.init.sh
29+ subPath : init
30+ resources :
31+ limits :
32+ cpu : ' 2'
33+ memory : ' 4Gi'
34+ requests :
35+ cpu : ' 2'
36+ memory : ' 2Gi'
37+ imagePullPolicy : IfNotPresent
38+ containers :
39+ - name : code-server
40+ image : eoepca/pde-code-server:1.0.0
41+ securityContext :
42+ privileged : true
43+ command : ["/bin/bash", "-c"]
44+ args :
45+ - >
46+ code-server --auth none --bind-addr 0.0.0.0:8080 --user-data-dir /workspace /workspace/quickwin
47+ ports :
48+ - containerPort : 8080
49+ name : web
50+ volumeMounts :
51+ - name : workspace-volume
52+ mountPath : /workspace
53+ - name : bash-login
54+ mountPath : /workspace/.bash_login
55+ subPath : bash-login
56+ - name : bash-rc
57+ mountPath : /workspace/.bashrc
58+ subPath : bash-rc
59+ env :
60+ - name : XDG_CONFIG_HOME
61+ value : /workspace/.local
62+ - name : XDG_DATA_HOME
63+ value : /workspace/.local/share/
64+ - name : XDG_RUNTIME_DIR
65+ value : /workspace/.local
66+ - name : CWLTOOL_OPTIONS
67+ value : " --podman"
68+ - name : AWS_DEFAULT_REGION
69+ value : " us-east-1"
70+ - name : AWS_ACCESS_KEY_ID
71+ value : " test"
72+ - name : AWS_SECRET_ACCESS_KEY
73+ value : " test"
74+ resources :
75+ limits :
76+ cpu : ' 2'
77+ memory : ' 6442450944'
78+ requests :
79+ cpu : ' 1'
80+ memory : ' 4294967296'
81+ volumes :
82+ - name : workspace-volume
83+ persistentVolumeClaim :
84+ claimName : code-server-pvc
85+ - name : init
86+ configMap :
87+ name : init
88+ defaultMode : 420
89+ - name : bash-login
90+ configMap :
91+ name : bash-login
92+ defaultMode : 420
93+ - name : bash-rc
94+ configMap :
95+ name : bash-rc
96+ defaultMode : 420
97+ ---
98+ apiVersion : v1
99+ kind : PersistentVolumeClaim
100+ metadata :
101+ name : code-server-pvc
102+ spec :
103+ accessModes :
104+ - ReadWriteOnce
105+ resources :
106+ requests :
107+ storage : 20Gi
108+ ---
109+ apiVersion : v1
110+ kind : Service
111+ metadata :
112+ name : code-server-service
113+ spec :
114+ selector :
115+ app : code-server
116+ ports :
117+ - name : web
118+ port : 8080
119+ targetPort : 8080
120+ type : ClusterIP
121+ ---
122+ apiVersion : v1
123+ kind : ConfigMap
124+ metadata :
125+ name : init
126+ data :
127+ init : >-
128+ #!/bin/bash
129+
130+ set -x
131+
132+ cd /workspace
133+
134+ git clone 'https://github.com/eoap/quickwin.git'
135+
136+ code-server --install-extension ms-python.python
137+
138+ code-server --install-extension redhat.vscode-yaml
139+
140+ code-server --install-extension sbg-rabix.benten-cwl
141+
142+ code-server --install-extension ms-toolsai.jupyter
143+
144+ ln -s /workspace/.local/share/code-server/extensions /workspace/extensions
145+
146+ mkdir -p /workspace/User/
147+
148+ echo '{"workbench.colorTheme": "Visual Studio Dark"}' > /workspace/User/settings.json
149+
150+ python -m venv /workspace/.venv
151+
152+ source /workspace/.venv/bin/activate
153+
154+ /workspace/.venv/bin/python -m pip install --no-cache-dir rasterio click pystac loguru pyproj shapely scikit-image pystac rio_stac ipykernel stactools[validate]
155+
156+ /workspace/.venv/bin/python -m ipykernel install --user --name quickwin_env --display-name "Python (Quickwin)"
157+
158+ export AWS_DEFAULT_REGION="us-east-1"
159+
160+ export AWS_ACCESS_KEY_ID="test"
161+
162+ export AWS_SECRET_ACCESS_KEY="test"
163+
164+ aws s3 mb s3://results --endpoint-url=http://localstack:4566
165+
166+ ---
167+ apiVersion : v1
168+ kind : ConfigMap
169+ metadata :
170+ name : bash-rc
171+ data :
172+ bash-rc : >-
173+ alias ll="ls -l"
174+
175+ alias aws="aws --endpoint-url=http://localstack:4566"
176+
177+ source /workspace/.venv/bin/activate
178+ ---
179+ apiVersion : v1
180+ kind : ConfigMap
181+ metadata :
182+ name : bash-login
183+ data :
184+ bash-login : >-
185+ source /workspace/.bashrc
0 commit comments