diff --git a/Makefile b/Makefile index 900f7cca..6f41ee2b 100644 --- a/Makefile +++ b/Makefile @@ -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]' @@ -150,7 +151,7 @@ deploy: # Deploy/redeploy previously built REANA cluster. if [ $$(docker images | grep -c '') -gt 0 ]; then \ docker images | grep '' | 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 \ @@ -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 diff --git a/helm/reana-dev/values.yaml b/helm/reana-dev/values.yaml new file mode 100644 index 00000000..aa2581ba --- /dev/null +++ b/helm/reana-dev/values.yaml @@ -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 \ No newline at end of file