Commit 5531c6ba authored by Daniele Venzano's avatar Daniele Venzano

Create a file with the list of images for easier deployment

parent 737e9154
Pipeline #10370 passed with stages
in 43 seconds
......@@ -34,6 +34,7 @@ test:json:
- manifest.json
- logo.png
- README-datascience.md
- images
push:hub:
stage: push
......
......@@ -40,7 +40,7 @@ VERSION = os.getenv("VERSION", default="latest")
IMAGE = REPOSITORY + '/pydatasci:' + VERSION
IMAGE_GPU = REPOSITORY + '/pydatasci-gpu:' + VERSION
def nb_service(memory_limit, core_limit, image):
def nb_service(memory_limit, core_limit, image, gpu=False):
"""
:rtype: dict
"""
......@@ -75,6 +75,8 @@ def nb_service(memory_limit, core_limit, image):
'startup_order': 0,
'replicas': 1
}
if gpu:
service['labels'] = ['gpu']
return service
......@@ -98,11 +100,14 @@ if __name__ == '__main__':
'will_end': False,
'size': 512,
'services': [
nb_service(options["memory_limit"]["value"], options["core_limit"]["value"], IMAGE_GPU)
nb_service(options["memory_limit"]["value"], options["core_limit"]["value"], IMAGE_GPU, gpu=True)
]
}
json.dump(app, open("pydatasci-gpu.json", "w"), sort_keys=True, indent=4)
with open('images', 'w') as fp:
fp.write(IMAGE + '\n')
fp.write(IMAGE_GPU + '\n')
print("ZApp written")
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