Skip to content

Commit

Permalink
update examples to reflect latest eidf updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AntreasAntoniou authored Feb 16, 2024
1 parent dbcc583 commit f66fd14
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion kubejobs/examples/example_disk_defined_job.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Example usage:
import time

from kubejobs.jobs import KubernetesJob
from kubejobs.jobs import KubernetesJob, create_pvc, KubeQueue

env_vars = {
"DATASET_DIR": "/data/",
Expand All @@ -17,6 +17,7 @@
job = KubernetesJob(
name=f"gate-dev-{unique_id}",
image="ghcr.io/antreasantoniou/gate:latest",
kubernetes_queue_name=KubeQueue.INFORMATICS,
command=["/bin/bash", "-c", "--"],
args=["while true; do sleep 60; done;"],
gpu_type="nvidia.com/gpu",
Expand Down
3 changes: 2 additions & 1 deletion kubejobs/examples/example_docker_in_docker_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from rich import print

from kubejobs.jobs import KubernetesJob
from kubejobs.jobs import KubernetesJob, create_pvc, KubeQueue

# unique id generated using time
unique_id = time.strftime("%Y%m%d%H%M%S")
Expand All @@ -12,6 +12,7 @@
name=f"dind-{unique_id}",
image="docker:dind",
gpu_type="nvidia.com/gpu",
kubernetes_queue_name=KubeQueue.INFORMATICS,
gpu_product="NVIDIA-A100-SXM4-40GB",
gpu_limit=1,
shm_size="100G",
Expand Down
3 changes: 2 additions & 1 deletion kubejobs/examples/example_interactive_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from rich import print

from kubejobs.jobs import KubernetesJob, create_pvc
from kubejobs.jobs import KubernetesJob, create_pvc, KubeQueue

env_vars = {
"DATASET_DIR": "/data/",
Expand All @@ -23,6 +23,7 @@
name=f"debug-kubejobs-{unique_id}",
image="ghcr.io/antreasantoniou/gate:latest",
command=["/bin/bash", "-c", "--"],
kubernetes_queue_name=KubeQueue.INFORMATICS,
args=["while true; do sleep 60; done;"],
gpu_type="nvidia.com/gpu",
gpu_product="NVIDIA-A100-SXM4-40GB",
Expand Down
3 changes: 2 additions & 1 deletion kubejobs/examples/example_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from kubejobs.jobs import (
KubernetesJob,
create_jobs_for_experiments,
create_pvc,
create_pvc, KubeQueue
)

# unique id generated using time
Expand All @@ -20,6 +20,7 @@
image="nvcr.io/nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04",
command=["/bin/bash"],
args=["-c", "df -h"],
kubernetes_queue_name=KubeQueue.INFORMATICS,
gpu_type="nvidia.com/gpu",
gpu_product="NVIDIA-A100-SXM4-80GB",
gpu_limit=2,
Expand Down
3 changes: 3 additions & 0 deletions kubejobs/examples/example_storage_write_read.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from rich import print

from kubejobs.jobs import KubernetesJob as Job
from kubejobs.jobs import KubeQueue
from kubejobs.jobs import create_pvc

# Create PVC if not created
Expand All @@ -12,6 +13,7 @@
image="ubuntu:20.04",
command=["/bin/bash", "-c"],
args=["echo 'Hello, World!' > /mnt/data/sample.txt"],
kubernetes_queue_name=KubeQueue.INFORMATICS,
volume_mounts={
"dataset-disk": {
"pvc": "datasets-pvc-0",
Expand All @@ -28,6 +30,7 @@
image="ubuntu:20.04",
command=["/bin/bash", "-c"],
args=["cat /mnt/data/sample.txt"],
kubernetes_queue_name=KubeQueue.INFORMATICS,
volume_mounts={
"dataset-disk": {
"pvc": "datasets-pvc-0",
Expand Down

0 comments on commit f66fd14

Please sign in to comment.