Skip to content

Commit

Permalink
make: build/publish production images target
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego Rodriguez committed Apr 10, 2020
1 parent ededf8a commit cdbacc2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
30 changes: 29 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ help:
@echo ' MINIKUBE_DRIVER Which vm driver to use for Minikube? [default=virtualbox]'
@echo ' MINIKUBE_MEMORY How much memory to allocate for Minikube? [default=3072]'
@echo ' MINIKUBE_KUBERNETES Which Kubernetes version to use with Minikube? [default=v1.16.3]'
@echo ' PUBLISH_IMAGES Should the production images be pushed to the registry? [0|1, default=0]'
@echo ' TIMECHECK Checking frequency in seconds when bringing cluster up and down? [default=5]'
@echo ' TIMEOUT Maximum timeout to wait when bringing cluster up and down? [default=300]'
@echo ' SERVER_URL Setting a customized REANA Server hostname? [e.g. "https://example.org"; default is Minikube IP]'
Expand Down Expand Up @@ -150,7 +151,7 @@ deploy: # Deploy/redeploy previously built REANA cluster.
if [ $$(docker images | grep -c '<none>') -gt 0 ]; then \
docker images | grep '<none>' | awk '{print $$3;}' | xargs docker rmi; \
fi && \
helm install ${TRUNC_INSTANCE_NAME} helm/reana $(addprefix --set , ${CLUSTER_FLAGS}) --wait && \
helm install ${TRUNC_INSTANCE_NAME} helm/reana $(addprefix --set , ${CLUSTER_FLAGS}) -f helm/reana-dev/values.yaml --wait && \
waited=0 && while true; do \
waited=$$(($$waited+${TIMECHECK})); \
if [ $$waited -gt ${TIMEOUT} ];then \
Expand Down Expand Up @@ -200,4 +201,31 @@ test: # Run unit tests on the REANA package.
sphinx-build -qnNW -b doctest docs docs/_build/doctest
helm lint helm/reana

prod-build:
@echo -e "\033[1;32m[$$(date +%Y-%m-%dT%H:%M:%S)]\033[1;33m reana:\033[0m\033[1m make prod-build\033[0m"
source ${HOME}/.virtualenvs/${INSTANCE_NAME}/bin/activate && \
minikube docker-env --profile ${INSTANCE_NAME} > /dev/null && eval $$(minikube docker-env --profile ${INSTANCE_NAME}) && \
echo "Upgrading REANA to lastest master ..." && \
reana-dev git-upgrade -c CLUSTER && \
echo "Cleaning components directories ..." && \
reana-dev git-clean -c CLUSTER && \
echo "Building images with no cache ..." && \
BUILT_IMAGES_FILE_PATH=$(shell echo `pwd`/reana-images-`git describe --dirty`.txt) && \
reana-dev docker-build -c CLUSTER --no-cache \
-b COMPUTE_BACKENDS=kubernetes,htcondorcern,slurmcern \
-u "${GITHUB_USER}" -t auto \
--output-component-versions $$BUILT_IMAGES_FILE_PATH \
$(addprefix --exclude-components , ${EXCLUDE_COMPONENTS}) && \
echo "Building reanahub/krb5 image" && \
REANA_KRB5_IMAGE_NAME=$(shell cd ../reana-job-controller && echo reanahub/krb5:`git describe --dirty`) && \
cd ../reana-job-controller && \
docker build --file krb5/Dockerfile --tag $$REANA_KRB5_IMAGE_NAME . && \
echo $$REANA_KRB5_IMAGE_NAME >> $$BUILT_IMAGES_FILE_PATH && \
echo "The following images have been built:" && \
cat$$BUILT_IMAGES_FILE_PATH && \
if [ "${PUBLISH_IMAGES}" -eq 1 ]; then \
cat $$BUILT_IMAGES_FILE_PATH | xargs -L 1 docker push; \
fi && \
rm $$BUILT_IMAGES_FILE_PATH

# end of file
18 changes: 18 additions & 0 deletions helm/reana-dev/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# REANA components pointing to `latest`, locally built master branch
components:
reana_server:
image: reanahub/reana-server
reana_workflow_controller:
image: reanahub/reana-workflow-controller
reana_workflow_engine_cwl:
image: reanahub/reana-workflow-engine-cwl
reana_workflow_engine_yadage:
image: reanahub/reana-workflow-engine-yadage
reana_workflow_engine_serial:
image: reanahub/reana-workflow-engine-serial
reana_job_controller:
image: reanahub/reana-job-controller
reana_message_broker:
image: reanahub/reana-message-broker
reana_ui:
image: reanahub/reana-ui

0 comments on commit cdbacc2

Please sign in to comment.