Skip to content

Commit

Permalink
fix #8
Browse files Browse the repository at this point in the history
  • Loading branch information
pminervini committed Dec 13, 2023
1 parent bb40d90 commit 9ae4518
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions kubejobs/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def __init__(
user_email: Optional[str] = None,
labels: Optional[dict] = None,
annotations: Optional[dict] = None,
namespace: Optional[str] = None
):
self.name = name

Expand Down Expand Up @@ -176,6 +177,8 @@ def __init__(
logger.info(f"labels {self.labels}")
logger.info(f"annotations {self.annotations}")

self.namespace = namespace

def _add_shm_size(self, container: dict):
"""Adds shared memory volume if shm_size is set."""
if self.shm_size:
Expand Down Expand Up @@ -319,6 +322,9 @@ def generate_yaml(self):
if self.job_deadlineseconds:
job["spec"]["activeDeadlineSeconds"] = self.job_deadlineseconds

if self.namespace:
job["metadata"]["namespace"] = self.namespace

if not (
self.gpu_type is None
or self.gpu_limit is None
Expand Down

0 comments on commit 9ae4518

Please sign in to comment.