-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
david.fischak@eodc.eu
committed
Feb 27, 2025
1 parent
ca596b7
commit 4219fc3
Showing
12 changed files
with
1,087 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM busybox:stable | ||
|
||
RUN mkdir --parents /kernels/julia_kubernetes /kernels/python_kubernetes | ||
|
||
COPY ./julia_kubernetes /kernels/julia_kubernetes | ||
|
||
COPY ./python_kubernetes /kernels/python_kubernetes | ||
|
||
CMD ["sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /usr/bin/env bash | ||
|
||
|
||
set -x | ||
|
||
docker build --tag "ghcr.io/eodcgmbh/eodc-jeg-kernels/jeg-kernelspecs:beta" . | ||
|
||
set +x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"language": "julia", | ||
"display_name": "Julia on Kubernetes for EODC", | ||
"metadata": { | ||
"process_proxy": { | ||
"class_name": "enterprise_gateway.services.processproxies.k8s.KubernetesProcessProxy", | ||
"config": { | ||
"image_name": "ghcr.io/eodcgmbh/eodc-jeg-kernels/jeg-julia-kernel:beta" | ||
} | ||
}, | ||
"debugger": true | ||
}, | ||
"env": {}, | ||
"argv": [ | ||
"python", | ||
"/usr/local/share/jupyter/kernels/julia_kubernetes/scripts/launch_kubernetes.py", | ||
"--RemoteProcessProxy.kernel-id", | ||
"{kernel_id}", | ||
"--RemoteProcessProxy.port-range", | ||
"{port_range}", | ||
"--RemoteProcessProxy.response-address", | ||
"{response_address}", | ||
"--RemoteProcessProxy.public-key", | ||
"{public_key}" | ||
] | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# This file defines the Kubernetes objects necessary for kernels to run witihin Kubernetes. | ||
# Substitution parameters are processed by the launch_kubernetes.py code located in the | ||
# same directory. Some values are factory values, while others (typically prefixed with 'kernel_') can be | ||
# provided by the client. | ||
# | ||
# This file can be customized as needed. No changes are required to launch_kubernetes.py provided kernel_ | ||
# values are used - which be automatically set from corresponding KERNEL_ env values. Updates will be required | ||
# to launch_kubernetes.py if new document sections (i.e., new k8s 'kind' objects) are introduced. | ||
# | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "{{ kernel_pod_name }}" | ||
namespace: "{{ kernel_namespace }}" | ||
labels: | ||
kernel_id: "{{ kernel_id }}" | ||
app: enterprise-gateway | ||
component: kernel | ||
source: kernel-pod.yaml | ||
spec: | ||
restartPolicy: Never | ||
serviceAccountName: "{{ kernel_service_account_name }}" | ||
# NOTE: that using runAsGroup requires that feature-gate RunAsGroup be enabled. | ||
# WARNING: Only using runAsUser w/o runAsGroup or NOT enabling the RunAsGroup feature-gate | ||
# will result in the new kernel pod's effective group of 0 (root)! although the user will | ||
# correspond to the runAsUser value. As a result, BOTH should be uncommented AND the feature-gate | ||
# should be enabled to ensure expected behavior. In addition, 'fsGroup: 100' is recommended so | ||
# that /home/jovyan can be written to via the 'users' group (gid: 100) irrespective of the | ||
# "kernel_uid" and "kernel_gid" values. | ||
{% if kernel_uid is defined or kernel_gid is defined %} | ||
securityContext: | ||
{% if kernel_uid is defined %} | ||
runAsUser: {{ kernel_uid | int }} | ||
{% endif %} | ||
{% if kernel_gid is defined %} | ||
runAsGroup: {{ kernel_gid | int }} | ||
{% endif %} | ||
fsGroup: 100 | ||
{% endif %} | ||
containers: | ||
- image: "{{ kernel_image }}" | ||
name: "{{ kernel_pod_name }}" | ||
env: | ||
# Add any custom envs here that aren't already configured for the kernel's environment | ||
# - name: MY_CUSTOM_ENV | ||
# value: "my_custom_value" | ||
{% if kernel_cpus is defined or kernel_memory is defined or kernel_gpus is defined or kernel_cpus_limit is defined or kernel_memory_limit is defined or kernel_gpus_limit is defined %} | ||
resources: | ||
{% if kernel_cpus is defined or kernel_memory is defined or kernel_gpus is defined %} | ||
requests: | ||
{% if kernel_cpus is defined %} | ||
cpu: "{{ kernel_cpus }}" | ||
{% endif %} | ||
{% if kernel_memory is defined %} | ||
memory: "{{ kernel_memory }}" | ||
{% endif %} | ||
{% if kernel_gpus is defined %} | ||
nvidia.com/gpu: "{{ kernel_gpus }}" | ||
{% endif %} | ||
{% endif %} | ||
{% if kernel_cpus_limit is defined or kernel_memory_limit is defined or kernel_gpus_limit is defined %} | ||
limits: | ||
{% if kernel_cpus_limit is defined %} | ||
cpu: "{{ kernel_cpus_limit }}" | ||
{% endif %} | ||
{% if kernel_memory_limit is defined %} | ||
memory: "{{ kernel_memory_limit }}" | ||
{% endif %} | ||
{% if kernel_gpus_limit is defined %} | ||
nvidia.com/gpu: "{{ kernel_gpus_limit }}" | ||
{% endif %} | ||
{% endif %} | ||
{% endif %} | ||
{% if kernel_working_dir is defined %} | ||
workingDir: "{{ kernel_working_dir }}" | ||
{% endif %} | ||
volumeMounts: | ||
# Define any "unconditional" mounts here, followed by "conditional" mounts that vary per client | ||
- mountPath: /tmp/kernel-logs | ||
name: log-volume | ||
readOnly: false | ||
{% if kernel_volume_mounts %} | ||
{% for volume_mount in kernel_volume_mounts %} | ||
- {{ volume_mount }} | ||
{% endfor %} | ||
{% endif %} | ||
volumes: | ||
# Define any "unconditional" volumes here, followed by "conditional" volumes that vary per client | ||
- name: log-volume | ||
hostPath: | ||
path: /host | ||
type: DirectoryOrCreate | ||
{% if kernel_volumes %} | ||
{% for volume in kernel_volumes %} | ||
- {{ volume }} | ||
{% endfor %} | ||
{% endif %} |
Oops, something went wrong.