Add earth2studio v4 code-server template

This commit is contained in:
2026-06-03 01:33:02 +00:00
parent d85dcb5c11
commit ffc683a9a7
5 changed files with 203 additions and 3 deletions

View File

@ -62,7 +62,7 @@ source:
type: kustomize
repositoryUrl: https://gitea.example.com/ocdp/ocdp-workload-manifests.git
ref: main
path: packages/code-server/presets/k3s-hami
path: packages/code-server/post-renders/k3s-hami
```
After the template is stored in PostgreSQL and assigned to users or groups, users
@ -88,10 +88,13 @@ apps/
components/
packages/
code-server/
presets/
post-renders/
k3s-hami/
kustomization.yaml
userInputs.yaml
k3s-hami-v4/
kustomization.yaml
userInputs.yaml
tests/
kustomize/
```
@ -111,7 +114,7 @@ source:
type: kustomize
repositoryUrl: https://gitea.example.com/ocdp/ocdp-workload-manifests.git
ref: main
path: packages/code-server/presets/k3s-hami
path: packages/code-server/post-renders/k3s-hami
```
For one deployment, `ocdp-server` stores the Helm chart reference, static Helm

View File

@ -22,6 +22,11 @@ environment-managed choices:
- NodePort Service on port `80`
- `weight` StorageClass PVC mounted at `/models`
`post-renders/k3s-hami-v4/kustomization.yaml` keeps the same platform-managed
settings but uses image `harbor.bwgdi.com/library/earth2studio-demo:v4`. It
also seeds the image's `/workspace` contents into the workspace PVC on first
start so the mounted volume does not hide the demo files baked into the image.
`post-renders/k3s-hami/userInputs.yaml` is the user-facing value contract. Users
only choose CPU, memory, GPU count, and GPU memory. The console renders these
fields as the WorkloadClaim form; the operator receives the resolved values on

View File

@ -0,0 +1,139 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: "{{ namespace }}"
resources:
- rendered.yaml
- weights-pvc.yaml
patches:
- target:
group: apps
version: v1
kind: Deployment
name: "{{ name }}"
patch: |
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
template:
metadata:
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
imagePullSecrets:
- name: regcred
schedulerName: hami-scheduler
securityContext:
fsGroup: 1000
volumes:
- name: data
persistentVolumeClaim:
claimName: "{{ name }}"
- name: model-weights
persistentVolumeClaim:
claimName: "{{ name }}-weights"
initContainers:
- name: seed-workspace
image: harbor.bwgdi.com/library/earth2studio-demo:v4
imagePullPolicy: IfNotPresent
command:
- /bin/bash
- -lc
args:
- |
set -euo pipefail
marker=/workspace-volume/.ocdp-seeded-earth2studio-v4
if [ ! -e "$marker" ]; then
cp -a /workspace/. /workspace-volume/
touch "$marker"
fi
chown -R 1000:0 /workspace-volume
chmod -R g+rwX /workspace-volume
volumeMounts:
- name: data
mountPath: /workspace-volume
containers:
- name: code-server
image: harbor.bwgdi.com/library/earth2studio-demo:v4
imagePullPolicy: IfNotPresent
securityContext:
runAsUser: 1000
command:
- code-server
args:
- --bind-addr
- 0.0.0.0:8080
- --auth
- none
- /workspace
ports:
- name: http
containerPort: 8080
protocol: TCP
env:
- name: HOME
value: /workspace
- name: XDG_CONFIG_HOME
value: /workspace/.config
readinessProbe:
httpGet:
path: /
port: http
livenessProbe:
httpGet:
path: /
port: http
resources:
requests:
cpu: "{{ cpuRequestMillicores }}m"
memory: "{{ memoryRequestMiB }}Mi"
limits:
cpu: "{{ cpuLimitMillicores }}m"
memory: "{{ memoryLimitMiB }}Mi"
nvidia.com/gpu: "{{ gpuCount }}"
nvidia.com/gpumem: "{{ gpuMemoryMiB }}"
volumeMounts:
- name: data
mountPath: /workspace
- name: model-weights
mountPath: /models
- target:
version: v1
kind: Secret
name: "{{ name }}"
patch: |
apiVersion: v1
kind: Secret
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: auth
app.kubernetes.io/part-of: ocdp-workload
annotations: {}
type: Opaque
data:
password: dW51c2Vk
- target:
version: v1
kind: Service
name: "{{ name }}"
patch: |
apiVersion: v1
kind: Service
metadata:
name: "{{ name }}"
labels:
app.kubernetes.io/component: ide
app.kubernetes.io/part-of: ocdp-workload
spec:
type: NodePort
ports:
- name: http
port: 80
targetPort: http
protocol: TCP

View File

@ -0,0 +1,35 @@
cpuRequestMillicores:
label: CPU request
type: number
default: 500
minimum: 0
cpuLimitMillicores:
label: CPU limit
type: number
default: 2000
minimum: 0
memoryRequestMiB:
label: Memory request
type: number
default: 1024
minimum: 0
memoryLimitMiB:
label: Memory limit
type: number
default: 4096
minimum: 0
gpuCount:
label: GPU count
type: number
default: 1
minimum: 0
gpuMemoryMiB:
label: GPU memory
type: number
default: 8192
minimum: 0

View File

@ -0,0 +1,18 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "{{ name }}-weights"
namespace: "{{ namespace }}"
labels:
app.kubernetes.io/name: "{{ name }}"
app.kubernetes.io/component: model-weights
app.kubernetes.io/part-of: ocdp-workload
annotations:
platform.ocdp.io/storage-role: model-weights
spec:
accessModes:
- ReadWriteMany
storageClassName: weight
resources:
requests:
storage: 100Gi