diff --git a/k8s/flux.cue b/k8s/flux.cue index dfc48e463..105d7972b 100644 --- a/k8s/flux.cue +++ b/k8s/flux.cue @@ -2,6 +2,18 @@ bundle: { apiVersion: "v1alpha1" name: "codebattle" instances: { + "gateway": { + module: url: "oci://ghcr.io/stefanprodan/modules/flux-helm-release" + namespace: "flux-system" + values: { + repository: url: "oci://registry-1.docker.io/envoyproxy" + chart: { + name: "gateway-helm" + version: "v1.3.0" + } + sync: targetNamespace: "codebattle" + } + } "cert-manager": { module: url: "oci://ghcr.io/stefanprodan/modules/flux-helm-release" namespace: "flux-system" @@ -22,18 +34,6 @@ bundle: { } } } - "gateway": { - module: url: "oci://ghcr.io/stefanprodan/modules/flux-helm-release" - namespace: "flux-system" - values: { - repository: url: "oci://registry-1.docker.io/envoyproxy" - chart: { - name: "gateway-helm" - version: "v1.3.0" - } - sync: targetNamespace: "codebattle" - } - } "codebattle": { module: url: "file://timoni/kustomize-oci" namespace: "flux-system" diff --git a/k8s/timoni/codebattle/templates/config.cue b/k8s/timoni/codebattle/templates/config.cue index 70b56fa6e..b23ac6f53 100644 --- a/k8s/timoni/codebattle/templates/config.cue +++ b/k8s/timoni/codebattle/templates/config.cue @@ -57,6 +57,7 @@ import ( tolerations?: [...corev1.#Toleration] affinity?: corev1.#Affinity topologySpreadConstraints?: [...corev1.#TopologySpreadConstraint] + nodeSelector?: [string]: string ingress: { enable: *false | bool diff --git a/k8s/timoni/codebattle/templates/deployment.cue b/k8s/timoni/codebattle/templates/deployment.cue index 039912141..40930db55 100644 --- a/k8s/timoni/codebattle/templates/deployment.cue +++ b/k8s/timoni/codebattle/templates/deployment.cue @@ -80,6 +80,9 @@ import ( if #config.affinity != _|_ { affinity: #config.affinity } + if #config.nodeSelector != _|_ { + nodeSelector: #config.nodeSelector + } } } } diff --git a/k8s/timoni/codebattle/values.cue b/k8s/timoni/codebattle/values.cue index 7f8243318..dd20ab20c 100644 --- a/k8s/timoni/codebattle/values.cue +++ b/k8s/timoni/codebattle/values.cue @@ -18,6 +18,6 @@ values: { digest: "" } } - env: { - } + env: {} + nodeSelector: app: "codebattle" } diff --git a/k8s/timoni/runner/templates/deployment.cue b/k8s/timoni/runner/templates/deployment.cue index 97868f1d1..9e953f650 100644 --- a/k8s/timoni/runner/templates/deployment.cue +++ b/k8s/timoni/runner/templates/deployment.cue @@ -46,6 +46,15 @@ import ( successThreshold: 1 } resources: #config.resources + securityContext: privileged: true + volumeMounts: [{ + name: "tmp" + mountPath: "/tmp" + }] + }] + volumes: [{ + name: "tmp" + emptyDir: medium: "Memory" }] } } diff --git a/k8s/timoni/runners.cue b/k8s/timoni/runners.cue index b770ace6c..ddb7e3b4e 100644 --- a/k8s/timoni/runners.cue +++ b/k8s/timoni/runners.cue @@ -1,38 +1,86 @@ runners: { - "python": { - image: "codebattle/python" - version: "3.12.2" - lang: "python" + "clojure": { + image: "codebattle/clojure" + version: "1.11.2.3" + lang: "clojure" replicas: 1 } "cpp": { image: "codebattle/cpp" version: "20" lang: "cpp" - replicas: 0 + replicas: 7 } "csharp": { image: "codebattle/csharp" version: "8.0.201" lang: "csharp" - replicas: 0 + replicas: 1 } - "java": { - image: "codebattle/java" - version: "21" - lang: "java" - replicas: 0 + "dart": { + image: "codebattle/dart" + version: "3.3.1" + lang: "dart" + replicas: 1 + } + "elixir": { + image: "codebattle/elixir" + version: "1.18.2" + lang: "elixir" + replicas: 1 } "golang": { image: "codebattle/golang" version: "1.22.1" lang: "golang" - replicas: 0 + replicas: 1 + } + "haskell": { + image: "codebattle/haskell" + version: "9.4.7" + lang: "haskell" + replicas: 1 + } + "java": { + image: "codebattle/java" + version: "21" + lang: "java" + replicas: 1 + } + "js": { + image: "codebattle/js" + version: "20.11.1" + lang: "js" + replicas: 1 } "kotlin": { image: "codebattle/kotlin" version: "1.9.23" lang: "kotlin" - replicas: 0 + replicas: 1 + } + "php": { + image: "codebattle/php" + version: "8.3.3" + lang: "php" + replicas: 1 + } + "python": { + image: "codebattle/python" + version: "3.12.2" + lang: "python" + replicas: 3 + } + "ruby": { + image: "codebattle/ruby" + version: "3.3.0" + lang: "ruby" + replicas: 1 + } + "rust": { + image: "codebattle/rust" + version: "1.76.0" + lang: "rust" + replicas: 1 } }