Commit 0a65bc46 authored by Daniele Venzano's avatar Daniele Venzano

Initial commit

parents
Pipeline #8113 failed with stages
in 1 minute and 4 seconds
# Created by .ignore support plugin (hsz.mobi)
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
.idea/
state.zoe
/zoe*.conf
zoepass.csv
stages:
- test
- build
- push
- deploy
variables:
VERSION: 7375
REPOSITORY: zapps
before_script:
- mkdir -p $HOME/.docker
- echo $DOCKER_AUTH_CONFIG > $HOME/.docker/config.json
test:build:
stage: test
script:
- docker build --build-arg VERSION=${VERSION} -t ${REPOSITORY}/pydatasci:${VERSION} pydatasci/
test:json:
image: python:3-alpine
stage: test
before_script:
- pip install requests
script:
- python gen_json.py
- python /scripts/validate.py ${ZOE_VALIDATION_URL} pydatasci.json
artifacts:
paths:
- boinc.json
.build_template: &build_def
stage: build
script:
- docker -H ${BUILD_HOST}.containers.bigfoot.eurecom.fr:2375 $DOCKER_TLS_OPTIONS build --build-arg VERSION=${VERSION} -t ${REPOSITORY}/pydatasci:${VERSION} pydatasci/
only:
- master
push:hub:
stage: push
script:
- docker push ${REPOSITORY}/pydatasci:${VERSION}
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
build:bf7:
<<: *build_def
variables:
BUILD_HOST: bf7
build:bf8:
<<: *build_def
variables:
BUILD_HOST: bf8
build:bf9:
<<: *build_def
variables:
BUILD_HOST: bf9
build:bf10:
<<: *build_def
variables:
BUILD_HOST: bf10
build:bf12:
<<: *build_def
variables:
BUILD_HOST: bf12
build:bf13:
<<: *build_def
variables:
BUILD_HOST: bf13
build:bf14:
<<: *build_def
variables:
BUILD_HOST: bf14
build:bf15:
<<: *build_def
variables:
BUILD_HOST: bf15
build:bf16:
<<: *build_def
variables:
BUILD_HOST: bf16
build:bf17:
<<: *build_def
variables:
BUILD_HOST: bf17
build:bf18:
<<: *build_def
variables:
BUILD_HOST: bf18
build:bf19:
<<: *build_def
variables:
BUILD_HOST: bf19
build:bf20:
<<: *build_def
variables:
BUILD_HOST: bf20
build:bf21:
<<: *build_def
variables:
BUILD_HOST: bf21
build:bf22:
<<: *build_def
variables:
BUILD_HOST: bf22
build:deepfoot1:
<<: *build_def
variables:
BUILD_HOST: deepfoot1
# Notebook for Data Science
This ZApp contains a Jupyter Notebook with a Python 3.6 kernel and the following libraries:
* Tensorflow 1.8.0
* Pytorch and TorchVision 0.4.0
* pandas, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh
# Copyright (c) 2016, Daniele Venzano
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Python DS notebook ZApp description generator."""
import json
import sys
import os
APP_NAME = 'pydatasci'
ZOE_APPLICATION_DESCRIPTION_VERSION = 3
options = {
'memory_limit': {
'value': 6 * (1024**3),
'description': 'Memcached memory limit (bytes)'
},
'core_limit': {
'value': 2,
'description': 'Number of cores to allocate'
}
}
REPOSITORY = os.getenv("REPOSITORY", default="zapps")
VERSION = os.getenv("VERSION", default="latest")
IMAGE = REPOSITORY + '/pydatasci:' + VERSION
def nb_service(memory_limit, core_limit):
"""
:rtype: dict
"""
mem_limit_mb = memory_limit / (1024**2)
service = {
'name': "py-notebook",
'image': IMAGE,
'monitor': True,
'resources': {
"memory": {
"min": memory_limit,
"max": memory_limit
},
"cores": {
"min": core_limit,
"max": core_limit
}
},
'ports': [
{
"name": "Jupyter Notebook interface",
"port_number": 8888,
"protocol": "tcp",
"url_template": "http://{ip_port}/"
}
],
'environment': [],
'volumes': [],
'command': None,
'total_count': 1,
'essential_count': 1,
'startup_order': 0,
'replicas': 1
}
return service
if __name__ == '__main__':
app = {
'name': APP_NAME,
'version': ZOE_APPLICATION_DESCRIPTION_VERSION,
'will_end': False,
'size': 512,
'services': [
nb_service(options["memory_limit"]["value"], options["core_limit"]["value"])
]
}
json.dump(app, open("pydatasci.json", "w"), sort_keys=True, indent=4)
print("ZApp written")
logo.png

12.5 KB

{
"version": 1,
"zapps": [
{
"category": "Data science",
"readable_descr": "README-datascience.md",
"name": "Data science notebook",
"description": "datasci-notebook.json",
"parameters": [],
"guest_access": true
}
]
}
{
"name": "pydatasci",
"services": [
{
"command": null,
"environment": [],
"essential_count": 1,
"image": "zapps/pydatasci:latest",
"monitor": true,
"name": "py-notebook",
"ports": [
{
"name": "Jupyter Notebook interface",
"port_number": 8888,
"protocol": "tcp",
"url_template": "http://{ip_port}/"
}
],
"replicas": 1,
"resources": {
"cores": {
"max": 2,
"min": 2
},
"memory": {
"max": 8589934592,
"min": 8589934592
}
},
"startup_order": 0,
"total_count": 1,
"volumes": []
}
],
"size": 512,
"version": 3,
"will_end": false
}
\ No newline at end of file
ARG VERSION=test
FROM zapps/jupyter:${VERSION}
RUN pip install --upgrade pip \
tensorflow \
pandas \
matplotlib \
scipy \
seaborn \
scikit-learn \
scikit-image \
sympy \
cython \
patsy \
statsmodel \
cloudpickle \
dill \
numba \
bokeh \
torch \
torchvision
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