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

Add SyntaxNet and Magenta ZApps

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