Commit 1083470c authored by Daniele Venzano's avatar Daniele Venzano

Add ZApp version with GPU label

parent fa10e4e2
Pipeline #5557 failed with stages
in 24 seconds
......@@ -33,6 +33,7 @@ test:json:
- pip install requests
script:
- python /scripts/validate.py ${ZOE_VALIDATION_URL} pytorch-notebook.json
- python /scripts/validate.py ${ZOE_VALIDATION_URL} pytorch-notebook-gpu.json
push:all:
stage: push
......
......@@ -23,7 +23,8 @@ REPOSITORY = os.getenv("REPOSITORY", default="zapps")
VERSION = os.getenv("VERSION", default="latest")
UPSTREAM_NOTEBOOKS = [
("pytorch-notebook", REPOSITORY + "/pytorch:" + VERSION)
("pytorch-notebook", REPOSITORY + "/pytorch:" + VERSION, [])
("pytorch-notebook-gpu", REPOSITORY + "/pytorch:" + VERSION, ['gpu'])
]
ZOE_APPLICATION_DESCRIPTION_VERSION = 3
......@@ -39,7 +40,7 @@ options = {
}
}
def jupyter_service(memory_limit, core_limit, image):
def jupyter_service(memory_limit, core_limit, image, labels):
"""
:rtype: dict
"""
......@@ -77,19 +78,21 @@ def jupyter_service(memory_limit, core_limit, image):
'replicas': 1,
'startup_order': 0
}
if len(labels) > 0:
service['labels'] = labels
return service
if __name__ == '__main__':
for app_name, image in UPSTREAM_NOTEBOOKS:
for app_name, image, labels in UPSTREAM_NOTEBOOKS:
app = {
'name': app_name,
'version': ZOE_APPLICATION_DESCRIPTION_VERSION,
'will_end': False,
'size': 512,
'services': [
jupyter_service(options["memory_limit"]["value"], options["core_limit"]["value"], image)
jupyter_service(options["memory_limit"]["value"], options["core_limit"]["value"], image, labels)
]
}
......
......@@ -8,6 +8,14 @@
"description": "pytorch-notebook.json",
"parameters": [],
"logo": "pytorch.png"
},
{
"category": "Machine learning",
"readable_descr": "README-pytorch.md",
"name": "PyTorch notebook with GPU",
"description": "pytorch-notebook-gpu.json",
"parameters": [],
"logo": "pytorch.png"
}
]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment