Commit 604319c0 authored by Daniele Venzano's avatar Daniele Venzano

Update image and gitlab CI

parent 415b58d5
Pipeline #4763 failed with stages
in 34 seconds
......@@ -12,30 +12,28 @@ variables:
image: docker:latest
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
build:spark2-jupyter-notebook:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-jupyter-notebook:${VERSION} docker/spark2-jupyter-notebook
- docker build -t ${REPOSITORY}/spark2-jupyter-notebook:${VERSION} docker/spark2-jupyter-notebook
build:spark2-master:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-master:${VERSION} docker/spark2-master
- docker build -t ${REPOSITORY}/spark2-master:${VERSION} docker/spark2-master
build:spark2-worker:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-worker:${VERSION} docker/spark2-worker
- docker build -t ${REPOSITORY}/spark2-worker:${VERSION} docker/spark2-worker
build:spark2-submit:
stage: build
script:
- docker build -t ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-submit:${VERSION} docker/spark2-submit
- docker build -t ${REPOSITORY}/spark2-submit:${VERSION} docker/spark2-submit
build:json:
image: python:3-alpine
......@@ -52,15 +50,25 @@ test:json:
before_script:
- pip install requests
script:
- python validate.py ${ZOE_VALIDATION_URL} spark*.json
- python scripts/validate.py ${ZOE_VALIDATION_URL} spark*.json
push:all:
stage: push
script:
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-submit:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-master:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-worker:${VERSION}
- docker push ${DOCKER_REGISTRY}/${REPOSITORY}/spark2-jupyter-notebook:${VERSION}
- /scripts/distribute_docker_image.sh ${REPOSITORY}/spark2-submit:${VERSION}
- /scripts/distribute_docker_image.sh ${REPOSITORY}/spark2-master:${VERSION}
- /scripts/distribute_docker_image.sh ${REPOSITORY}/spark2-worker:${VERSION}
- /scripts/distribute_docker_image.sh ${REPOSITORY}/spark2-jupyter-notebook:${VERSION}
only:
- master
push:hub:
stage: push
script:
- docker push ${REPOSITORY}/spark2-submit:${VERSION}
- docker push ${REPOSITORY}/spark2-master:${VERSION}
- docker push ${REPOSITORY}/spark2-worker:${VERSION}
- docker push ${REPOSITORY}/spark2-jupyter-notebook:${VERSION}
only:
- master
......
......@@ -57,14 +57,13 @@ options = {
}
}
REGISTRY = os.getenv("DOCKER_REGISTRY", default="docker-engine:5000")
REPOSITORY = os.getenv("REPOSITORY", default="zapps")
VERSION = os.getenv("VERSION", default="latest")
MASTER_IMAGE = REGISTRY + "/" + REPOSITORY + "/spark2-master:" + VERSION
WORKER_IMAGE = REGISTRY + "/" + REPOSITORY + "/spark2-worker:" + VERSION
NOTEBOOK_IMAGE = REGISTRY + "/" + REPOSITORY + "/spark2-jupyter-notebook:" + VERSION
SUBMIT_IMAGE = REGISTRY + "/" + REPOSITORY + "/spark2-submit:" + VERSION
MASTER_IMAGE = REPOSITORY + "/spark2-master:" + VERSION
WORKER_IMAGE = REPOSITORY + "/spark2-worker:" + VERSION
NOTEBOOK_IMAGE = REPOSITORY + "/spark2-jupyter-notebook:" + VERSION
SUBMIT_IMAGE = REPOSITORY + "/spark2-submit:" + VERSION
def spark_master_service(mem_limit):
"""
......
#!/usr/bin/python
import json
import sys
import requests
URL = sys.argv[1]
files = sys.argv[2:]
for f in files:
data = json.load(open(f, encoding="utf-8"))
data_req = { "application": data }
r = requests.post(URL, json=data_req)
if r.status_code != 200:
rep = r.json()
print(rep['message'])
sys.exit(1)
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