Commit 7c7c67c0 authored by Daniele Venzano's avatar Daniele Venzano

Add SyntaxNet and Magenta ZApps

parent 78d083f1
stages:
- build
- test
- pull
- deploy
variables:
VERSION: $CI_BUILD_ID
VERSION: $CI_PIPELINE_ID
#standalone:
# image: docker:latest
# stage: deploy
# before_script:
# - mkdir -p /etc/docker/certs.d/$DOCKER_REGISTRY
# - cp /registry-ca.crt /etc/docker/certs.d/$DOCKER_REGISTRY/ca.crt
# - mkdir -p $HOME/.docker
# - echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
# - apk update
# - apk add python findutils bash curl
# script:
# - bash build_all.sh
# - python gen_json_standalone.py
# - bash validate_all.sh
# artifacts:
# paths:
# - "*.json"
# only:
# - master
build:json:
image: python:3-alpine
stage: build
script:
- python gen_json_google.py
artifacts:
paths:
- "*.json"
google:
image: python:alpine
stage: deploy
test:json:
image: python:3-alpine
stage: test
before_script:
- apk update
- apk add bash curl
- pip install requests
script:
- python gen_json_google.py
- bash validate_all.sh
- python validate.py ${ZOE_VALIDATION_URL} *google.json
pull:all:
stage: pull
script:
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull tensorflow/magenta
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull gcr.io/tensorflow/tensorflow:1.3.0-py3
- docker -H ${SWARM} ${SWARM_TLS_OPTIONS} pull tensorflow/syntaxnet
only:
- master
deploy:json:
stage: deploy
script:
- mkdir -p ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}
- cp *.json ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
- cp logo.png ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
- cp README*.md ${ZAPP_SHOP_BASE_PATH}/${CI_PROJECT_NAME}/
artifacts:
paths:
- "*.json"
- logo.png
- "README*.md"
only:
- master
# Tensorflow ZApp
Unmodified [Google TensorFlow](https://www.tensorflow.org/) as generated by Google. This ZApp contains a Jupyter Notebook.
Unmodified [Google TensorFlow](https://www.tensorflow.org/) as generated by Google.
The image used contains TensorFlow 1.3 for Python 3.
The image used contains TensorFlow 1.3 for Python 3 and a Jupyter Notebook.
......@@ -17,7 +17,12 @@ import json
import sys
import os
APP_NAME = 'tf-google'
APPS = [
('tf-google', "gcr.io/tensorflow/tensorflow:1.3.0-py3"),
('stnet-google', "tensorflow/syntaxnet"),
('mag-google', "tensorflow/magenta")
]
ZOE_APPLICATION_DESCRIPTION_VERSION = 3
options = {
......@@ -35,15 +40,13 @@ REGISTRY = os.getenv("DOCKER_REGISTRY", default="docker-engine:5000")
REPOSITORY = os.getenv("REPOSITORY", default="zapps")
VERSION = os.getenv("VERSION", default="latest")
GOOG_IMAGE = "gcr.io/tensorflow/tensorflow:1.3.0-py3"
def goog_tensorflow_service(memory_limit, core_limit):
def goog_tensorflow_service(memory_limit, core_limit, image):
"""
:rtype: dict
"""
service = {
'name': "tf-jupyter",
'image': GOOG_IMAGE,
'image': image,
'monitor': True,
'resources': {
"memory": {
......@@ -82,17 +85,18 @@ def goog_tensorflow_service(memory_limit, core_limit):
if __name__ == '__main__':
app = {
'name': APP_NAME,
'version': ZOE_APPLICATION_DESCRIPTION_VERSION,
'will_end': False,
'size': 512,
'services': [
goog_tensorflow_service(options["memory_limit"]["value"], options["core_limit"]["value"])
]
}
for app_name, image in APPS:
app = {
'name': app_name,
'version': ZOE_APPLICATION_DESCRIPTION_VERSION,
'will_end': False,
'size': 512,
'services': [
goog_tensorflow_service(options["memory_limit"]["value"], options["core_limit"]["value"], image)
]
}
json.dump(app, open("goog_tensorflow.json", "w"), sort_keys=True, indent=4)
json.dump(app, open(app_name + ".json", "w"), sort_keys=True, indent=4)
print("ZApp written")
print("ZApps written")
......@@ -2,17 +2,17 @@
"version": 1,
"zapps": [
{
"category": "Jupyter notebooks",
"name": "TensorFlow notebook",
"description": "goog_tensorflow.json",
"category": "TensorFlow",
"name": "Google TensorFlow notebook",
"description": "tf-google.json",
"readable_descr": "README-goog.md",
"parameters": []
},
{
"category": "Non-interactive",
"name": "Batch TensorFlow",
"description": "goog_tensorflow.json",
"readable_descr": "README-custom.md",
"category": "TensorFlow",
"name": "Google TensorFlow batch",
"description": "tf-google.json",
"readable_descr": "README-batch.md",
"parameters": [
{
"kind": "command",
......@@ -23,6 +23,20 @@
"default": "./my-tf-app/main.py"
}
]
},
{
"category": "TensorFlow",
"name": "DRAGNN SyntaxNet model",
"description": "stnet-google.json",
"readable_descr": "README-syntaxnet.md",
"parameters": []
},
{
"category": "TensorFlow",
"name": "Magenta model",
"description": "magenta-google.json",
"readable_descr": "README-magenta.md",
"parameters": []
}
]
}
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