Skip to content

Commit

Permalink
fix: Fix for memory
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Christie committed Mar 13, 2024
1 parent 5735188 commit e2d5cfb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/jote/compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,9 @@ def __init__(
):
# Memory must have a Mi or Gi suffix.
# For docker-compose we translate to 'm' and 'g'
self._memory: str = "1g"
if memory.endswith("Mi"):
self._memory: str = f"{memory[:-2]}m"
self._memory = f"{memory[:-2]}m"
elif memory.endswith("Gi"):
self._memory = f"{memory[:-2]}g"
assert self._memory
Expand Down
5 changes: 1 addition & 4 deletions src/jote/jote.py
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,7 @@ def _run_a_test(
job_image = f"{job_definition.image.name}:{job_definition.image.tag}"
job_image_memory: str = job_definition.image["memory"]
if job_image_memory is None:
job_image_memory = "1G"
elif job_image_memory.lower().endswith("i"):
# Strip trailing kubernetes 'i' - not liked by compose
job_image_memory = job_image_memory[:-1]
job_image_memory = "1Gi"
job_image_cores: int = job_definition.image["cores"]
if job_image_cores is None:
job_image_cores = 1
Expand Down

0 comments on commit e2d5cfb

Please sign in to comment.