diff --git a/.travis.yml b/.travis.yml index cdbf30ec..e5afa1fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -43,6 +43,7 @@ script: - make $MAKE_ARGS gen-certs - make $MAKE_ARGS build - make $MAKE_ARGS docker-build + - make $MAKE_ARGS docker-tag-local - make $MAKE_ARGS create-volumes # deploy services - make $MAKE_ARGS deploy diff --git a/Makefile b/Makefile index 28350e68..f5ab29ef 100644 --- a/Makefile +++ b/Makefile @@ -58,6 +58,10 @@ ifeq ($(IMAGE_NAME),databroker_s3) IMAGE_DIR := databroker/s3 endif +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET = -$(TARGET) # Main targets @@ -75,27 +79,59 @@ build: $(addprefix build-, $(SERVICES)) docker-build-images: $(addprefix docker-build-, $(IMAGES)) docker-build: ## Build the Docker images for all services -docker-build: docker-build-images docker-build-ui docker-build-logcollectors +docker-build: docker-build-base docker-build-images docker-build-ui docker-build-logcollectors + +docker-create-manifest: + @if [ "${DOCKER_REPO}" = "docker.io" ]; then \ + docker login --username="${DOCKER_REPO_USER}" --password="${DOCKER_REPO_PASS}"; \ + else \ + docker login --username="${DOCKER_REPO_USER}" --password="${DOCKER_REPO_PASS}" https://${DOCKER_REPO}; \ + fi \ + for image in $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep -e '${DOCKER_REPO}\/${DOCKER_NAMESPACE}.*-${TARGET}:${IMAGE_TAG}' | grep -v ''); do \ + manifest_list=`echo $$image | sed -e "s/\(.*\)-${TARGET}\(:.*\)$$/\1\2/g"`; \ + echo "Creating manifest for $manifest_list"; \ + AMEND=""; \ + docker manifest inspect $$manifest_list > /dev/null 2>&1; \ + if [ $$? -eq 0 ]; then \ + AMEND="--amend"; \ + fi; \ + # lookup for other architectures \ + other_arch_images=""; \ + for arch in ${ARCHS}; do \ + if [ "$$arch" != "${TARGET}" ]; then \ + arch_image=`echo $$image | sed -e "s/\(.*\)-${TARGET}\(:.*\)$$/\1\-$$arch\2/g"`; \ + other_arch_images="$$other_arch_image $$arch_image"; \ + fi; \ + done; \ + docker manifest create $$AMEND $$manifest_list $$image $$other_arch_images ${DOCKER_CREATE_MANIFEST_OPTS}; \ + docker manifest push $$manifest_list ${DOCKER_CREATE_MANIFEST_OPTS}; \ + done + +docker-tag-local: + if [ "$(VM_TYPE)" = "minikube" ]; then \ + eval $(minikube docker-env); \ + fi; \ + for image in $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep -e '${DOCKER_NAMESPACE}.*\-${TARGET}:${IMAGE_TAG}' | grep -v ''); do \ + image_name=`echo $$image | sed -e "s/\(.*\)-${TARGET}\(:.*\)$$/\1\2/g"`; \ + echo "docker tag $$image $$image_name"; \ + docker tag $$image $$image_name; \ + done \ docker-push: - @if [[ -z "${DOCKER_REPO_USER}" ]] || [[ -z "${DOCKER_REPO_PASS}" ]] ; then \ + @if [ -z "${DOCKER_REPO_USER}" ] || [ -z "${DOCKER_REPO_PASS}" ] ; then \ echo "Please define DOCKER_REPO_USER and DOCKER_REPO_PASS."; \ exit 1; \ else \ if [ "${DOCKER_REPO}" = "docker.io" ]; then \ docker login --username="${DOCKER_REPO_USER}" --password="${DOCKER_REPO_PASS}"; \ - for i in $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep ${DOCKER_NAMESPACE} | grep :${IMAGE_TAG} | grep -v ''); do \ - echo "docker push $$i"; \ - docker push $$i; \ - done; \ else \ docker login --username="${DOCKER_REPO_USER}" --password="${DOCKER_REPO_PASS}" https://${DOCKER_REPO}; \ - for i in $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep ${DOCKER_REPO}/${DOCKER_NAMESPACE} | grep :${IMAGE_TAG} | grep -v ''); do \ - echo "docker push $$i"; \ - docker push $$i; \ - done; \ fi; \ - fi; + for i in $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep -e '${DOCKER_REPO}\/${DOCKER_NAMESPACE}.*\-${TARGET}:${IMAGE_TAG}' | grep -v ''); do \ + echo "docker push $$i"; \ + docker push $$i; \ + done; \ + fi # TODO: setup-registry @@ -435,14 +471,15 @@ $(addprefix docker-build-, $(IMAGES)): docker-build-%: % docker-build-ui: mkdir -p build; test -e dashboard || (git clone $(UI_REPO) build/ffdl-ui; ln -s build/ffdl-ui dashboard) (cd dashboard && (if [ "$(VM_TYPE)" = "minikube" ]; then eval $$(minikube docker-env); fi; \ - docker build -q -t $(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$(IMAGE_NAME_PREFIX)ui:$(IMAGE_TAG) .; \ - (test ! `which docker-squash` || docker-squash -t $(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$(IMAGE_NAME_PREFIX)ui $(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$(IMAGE_NAME_PREFIX)ui))) + UI_IMAGE_NAME=$(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$(IMAGE_NAME_PREFIX)ui$(IMAGE_NAME_TARGET); \ + docker build -q --build-arg ARCH=$(TARGET) -t $$UI_IMAGE_NAME:$(IMAGE_TAG) .; \ + (test ! `which docker-squash` || docker-squash -t $$UI_IMAGE_NAME:$(IMAGE_TAG) $$UI_IMAGE_NAME))) docker-build-base: if [ "$(VM_TYPE)" = "minikube" ]; then \ eval $$(minikube docker-env); \ fi; \ - (cd etc/dlaas-service-base; make build) + (cd etc/dlaas-service-base; REPO=${DOCKER_REPO}/ffdl make build) docker-build-logcollectors: if [ "$(VM_TYPE)" = "minikube" ]; then \ @@ -646,12 +683,12 @@ test-s3: (cd ./$(SERVICE_NAME)/ && (test ! -e main.go || CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w" -a -installsuffix cgo -o bin/$(BINARY_NAME))) .docker-build: - (full_img_name=$(IMAGE_NAME_PREFIX)$(IMAGE_NAME); \ + (full_img_name=$(IMAGE_NAME_PREFIX)$(IMAGE_NAME)$(IMAGE_NAME_TARGET); \ cd ./$(IMAGE_DIR)/ && ( \ if [ "$(VM_TYPE)" = "minikube" ]; then \ eval $$(minikube docker-env); \ fi; \ - docker build -q -t $(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$$full_img_name:$(IMAGE_TAG) .)) + docker build -q --build-arg ARCH=$(TARGET) -t $(DOCKER_REPO)/$(DOCKER_NAMESPACE)/$$full_img_name:$(IMAGE_TAG) .)) kubernetes-ip: @if [ "$$CI" = "true" ]; then kubectl get nodes -o jsonpath='{ .items[0].status.addresses[?(@.type=="InternalIP")].address }'; \ diff --git a/dashboard/Dockerfile b/dashboard/Dockerfile index 16ee9518..ddb5d366 100644 --- a/dashboard/Dockerfile +++ b/dashboard/Dockerfile @@ -1,8 +1,20 @@ FROM node:8-alpine -# install chromium for headless browser tests -ENV CHROME_BIN=/usr/bin/chromium-browser -RUN apk add --no-cache chromium udev ttf-freefont +ARG ARCH=x86_64 + +# install chromium/firefox for headless browser tests +ENV CHROME_BIN=/usr/bin/browser + +RUN case "${ARCH}" in \ + amd64) \ + apk add --no-cache chromium udev ttf-freefont; \ + ln -s /usr/bin/chromium-browser /usr/bin/browser \ + ;; \ + ppc64le) \ + apk add --no-cache firefox-esr udev ttf-freefont python build-base; \ + ln -s /usr/bin/firefox /usr/bin/browser \ + ;; \ + esac # set workdir WORKDIR /ffdl/ffdl-dashboard diff --git a/etc/dlaas-service-base/Dockerfile.alpine b/etc/dlaas-service-base/Dockerfile.alpine index 28c54db5..746ee5a9 100644 --- a/etc/dlaas-service-base/Dockerfile.alpine +++ b/etc/dlaas-service-base/Dockerfile.alpine @@ -15,7 +15,9 @@ # -FROM gliderlabs/alpine:3.3 +FROM alpine:3.7 + +ARG ARCH=x86_64 RUN apk add --update ca-certificates curl drill diff --git a/etc/dlaas-service-base/Dockerfile.ubuntu b/etc/dlaas-service-base/Dockerfile.ubuntu index cdf36d48..9968b6c7 100644 --- a/etc/dlaas-service-base/Dockerfile.ubuntu +++ b/etc/dlaas-service-base/Dockerfile.ubuntu @@ -17,6 +17,8 @@ FROM ubuntu:16.04 +ARG ARCH=x86_64 + ENV DEBIAN_FRONTEND noninteractive RUN apt-get update && apt-get install -qq -y ca-certificates curl ldnsutils diff --git a/etc/dlaas-service-base/Makefile b/etc/dlaas-service-base/Makefile index d1de02a7..10baf99e 100644 --- a/etc/dlaas-service-base/Makefile +++ b/etc/dlaas-service-base/Makefile @@ -15,11 +15,18 @@ # -REPO=docker.io/ffdl +REPO?=docker.io/ffdl IMAGE_NAME=dlaas-service-base -IMAGE_TAG_ALPINE?=alpine3.3 +IMAGE_TAG_ALPINE?=alpine3.7 IMAGE_TAG_UBUNTU?=ubuntu16.04 +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET = -$(TARGET) + +SERVICE_BASE_IMAGE_NAME = ${IMAGE_NAME}${IMAGE_NAME_TARGET} + all: build push build-deps: @@ -30,17 +37,17 @@ build: build-deps build-ubuntu build-alpine push: push-alpine push-ubuntu build-alpine: - docker build -q -f Dockerfile.alpine -t ${IMAGE_NAME}:${IMAGE_TAG_ALPINE} . - docker tag ${IMAGE_NAME}:${IMAGE_TAG_ALPINE} ${REPO}/${IMAGE_NAME}:${IMAGE_TAG_ALPINE} + docker build -q -f Dockerfile.alpine --build-arg ARCH=$(TARGET) -t ${IMAGE_NAME}:${IMAGE_TAG_ALPINE} . + docker tag ${IMAGE_NAME}:${IMAGE_TAG_ALPINE} ${REPO}/${SERVICE_BASE_IMAGE_NAME}:${IMAGE_TAG_ALPINE} build-ubuntu: - docker build -q -f Dockerfile.ubuntu -t ${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} . - docker tag ${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} ${REPO}/${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} + docker build -q -f Dockerfile.ubuntu --build-arg ARCH=$(TARGET) -t ${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} . + docker tag ${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} ${REPO}/${SERVICE_BASE_IMAGE_NAME}:${IMAGE_TAG_UBUNTU} push-alpine: - docker push ${REPO}/${IMAGE_NAME}:${IMAGE_TAG_ALPINE} + docker push ${REPO}/${SERVICE_BASE_IMAGE_NAME}:${IMAGE_TAG_ALPINE} push-ubuntu: - docker push ${REPO}/${IMAGE_NAME}:${IMAGE_TAG_UBUNTU} + docker push ${REPO}/${SERVICE_BASE_IMAGE_NAME}:${IMAGE_TAG_UBUNTU} .PHONY: build push clean diff --git a/etc/examples/tf-model/manifest.yml b/etc/examples/tf-model/manifest.yml index dcb26361..315d35dd 100644 --- a/etc/examples/tf-model/manifest.yml +++ b/etc/examples/tf-model/manifest.yml @@ -15,7 +15,7 @@ data_stores: training_results: container: tf_trained_model connection: - auth_url: http://s3.default.svc.cluster.local + auth_url: http://10.0.51.5:30851 user_name: test password: test diff --git a/lcm/controller/Dockerfile b/lcm/controller/Dockerfile index c9fffa57..15127f3f 100644 --- a/lcm/controller/Dockerfile +++ b/lcm/controller/Dockerfile @@ -17,14 +17,17 @@ FROM dlaas-service-base:ubuntu16.04 +ARG ARCH=x86_64 + # Set environment variables. ENV ETCD_VERSION=3.3.3 # Install etcdctl from repository. -RUN apt-get install curl && \ - curl -LOks https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-amd64.tar.gz && \ - tar zxvf etcd-v${ETCD_VERSION}-linux-amd64.tar.gz && \ - cp etcd-v${ETCD_VERSION}-linux-amd64/etcdctl /usr/bin/etcdctl && \ +RUN if [ "${ARCH}" = "x86_64" ]; then TARGET="amd64"; else TARGET=${ARCH}; fi; \ + apt-get install curl && \ + curl -LOks https://github.com/coreos/etcd/releases/download/v${ETCD_VERSION}/etcd-v${ETCD_VERSION}-linux-${TARGET}.tar.gz && \ + tar zxvf etcd-v${ETCD_VERSION}-linux-${TARGET}.tar.gz && \ + cp etcd-v${ETCD_VERSION}-linux-${TARGET}/etcdctl /usr/bin/etcdctl && \ rm -rf etcd-v* && \ chmod +x /usr/bin/etcdctl diff --git a/lcm/controller/Makefile b/lcm/controller/Makefile index 5cdfc7ef..82854798 100644 --- a/lcm/controller/Makefile +++ b/lcm/controller/Makefile @@ -22,14 +22,21 @@ IMAGE_TAG ?= user-$(WHOAMI) STATE_MACHINE_PDF=docs/state-machine.pdf +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET = -$(TARGET) + +IMAGE_NAME ?= ${CONTROLLER_IMAGE_NAME}${IMAGE_NAME_TARGET}:${IMAGE_TAG} + all: build push build: clean - docker build --label git-commit=$(shell git rev-list -1 HEAD) -t ${CONTROLLER_IMAGE_NAME}:${IMAGE_TAG} -f Dockerfile . - docker tag ${CONTROLLER_IMAGE_NAME}:${IMAGE_TAG} ${REPO}/${CONTROLLER_IMAGE_NAME}:${IMAGE_TAG} + docker build --label git-commit=$(shell git rev-list -1 HEAD) --build-arg ARCH=$(TARGET) -t ${IMAGE_NAME} -f Dockerfile . + docker tag ${IMAGE_NAME} ${REPO}/${IMAGE_NAME} push: - docker push ${REPO}/${CONTROLLER_IMAGE_NAME}:${IMAGE_TAG} + docker push ${REPO}/${IMAGE_NAME} docs: cat docs/state-machine.dot |docker run -i --entrypoint /usr/bin/dot andrewshawcare/graphviz -T pdf > ${STATE_MACHINE_PDF} diff --git a/lcm/service/lcm/constants.go b/lcm/service/lcm/constants.go index 1d23d0b6..45e6112d 100644 --- a/lcm/service/lcm/constants.go +++ b/lcm/service/lcm/constants.go @@ -81,7 +81,7 @@ const ( storeResultsMilliCPU=20 storeResultsMemInMB=100 loadModelMilliCPU=20 - loadModelMemInMB=50 + loadModelMemInMB=100 loadTrainingDataMilliCPU=20 // FfDL Change: parameterized //loadTrainingDataMemInMB=100 diff --git a/metrics/log_collectors/emetrics_file/Dockerfile b/metrics/log_collectors/emetrics_file/Dockerfile index 06335e4e..171ca754 100644 --- a/metrics/log_collectors/emetrics_file/Dockerfile +++ b/metrics/log_collectors/emetrics_file/Dockerfile @@ -16,6 +16,8 @@ FROM ubuntu:16.04 +ARG ARCH=x86_64 + # TODO: Just use community Python 3.6 image per conversation with Atin. RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common @@ -30,6 +32,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ mlocate \ wget \ gcc \ + g++ \ && rm -rf /var/lib/apt/lists/* ENV PYTHON_VERSION 3.6.3 @@ -37,9 +40,11 @@ ENV PYTHON_VERSION 3.6.3 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ make \ - musl-dev \ "python3.6" \ python3-pip \ + python3-dev \ + "python3.6-dev" \ + python3-setuptools \ cron RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 diff --git a/metrics/log_collectors/emetrics_file/Makefile b/metrics/log_collectors/emetrics_file/Makefile index bb2003f6..cbda3f22 100644 --- a/metrics/log_collectors/emetrics_file/Makefile +++ b/metrics/log_collectors/emetrics_file/Makefile @@ -21,7 +21,12 @@ GRPC_GIT=git@github.ibm.com:deep-learning-platform/grpc-parameter-server.git WHOAMI ?= $(shell whoami) IMAGE_TAG ?= user-$(WHOAMI) -IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/emetrics_file_extractor:${IMAGE_TAG} +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET := -$(TARGET) + +IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/emetrics_file_extractor${IMAGE_NAME_TARGET}:${IMAGE_TAG} DOCKER_OPTIONS ?= @@ -30,7 +35,7 @@ all: build push build: echo "Building ${IMAGE_NAME}" cp -r ../training_data_service_client . - docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} -f Dockerfile . + docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} --build-arg ARCH=$(TARGET) -f Dockerfile . rm -r training_data_service_client echo "Success building ${IMAGE_NAME}" diff --git a/metrics/log_collectors/regex_extractor/Dockerfile b/metrics/log_collectors/regex_extractor/Dockerfile index d7513fe5..a72eea1a 100644 --- a/metrics/log_collectors/regex_extractor/Dockerfile +++ b/metrics/log_collectors/regex_extractor/Dockerfile @@ -16,6 +16,8 @@ FROM ubuntu:16.04 +ARG ARCH=x86_64 + # TODO: Just use community Python 3.6 image per conversation with Atin. RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common @@ -29,6 +31,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ mlocate \ wget \ gcc \ + g++ \ && rm -rf /var/lib/apt/lists/* ENV PYTHON_VERSION 3.6.3 @@ -36,9 +39,11 @@ ENV PYTHON_VERSION 3.6.3 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ make \ - musl-dev \ "python3.6" \ python3-pip \ + python3-dev \ + "python3.6-dev" \ + python3-setuptools \ cron RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 @@ -74,4 +79,4 @@ RUN mkdir -p /scripts/log_collectors/training_data_service_client/certs WORKDIR /scripts -RUN echo python=python3 > /root/.bashrc \ No newline at end of file +RUN echo python=python3 > /root/.bashrc diff --git a/metrics/log_collectors/regex_extractor/Makefile b/metrics/log_collectors/regex_extractor/Makefile index 286096bc..9f300832 100644 --- a/metrics/log_collectors/regex_extractor/Makefile +++ b/metrics/log_collectors/regex_extractor/Makefile @@ -20,7 +20,12 @@ GRPC_GIT=git@github.ibm.com:deep-learning-platform/grpc-parameter-server.git WHOAMI ?= $(shell whoami) IMAGE_TAG ?= user-$(WHOAMI) -IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/regex_extractor:${IMAGE_TAG} +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET := -$(TARGET) + +IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/regex_extractor${IMAGE_NAME_TARGET}:${IMAGE_TAG} DOCKER_OPTIONS ?= @@ -28,7 +33,7 @@ all: build push build: cp -r ../training_data_service_client . - docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} -f Dockerfile . + docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} --build-arg ARCH=$(TARGET) -f Dockerfile . rm -r training_data_service_client push: diff --git a/metrics/log_collectors/simple_log_collector/Dockerfile b/metrics/log_collectors/simple_log_collector/Dockerfile index eb1c4f02..fc9bbe51 100644 --- a/metrics/log_collectors/simple_log_collector/Dockerfile +++ b/metrics/log_collectors/simple_log_collector/Dockerfile @@ -16,6 +16,8 @@ FROM ubuntu:16.04 +ARG ARCH=x86_64 + # TODO: Just use community Python 3.6 image per conversation with Atin. RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common @@ -30,6 +32,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ mlocate \ wget \ gcc \ + g++ \ && rm -rf /var/lib/apt/lists/* ENV PYTHON_VERSION 3.6.3 @@ -37,10 +40,12 @@ ENV PYTHON_VERSION 3.6.3 RUN apt-get update && apt-get install -y --no-install-recommends \ gcc \ make \ - musl-dev \ "python3.6" \ python3-pip \ - cron + python3-dev \ + "python3.6-dev" \ + python3-setuptools \ + cron RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1 RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 3 diff --git a/metrics/log_collectors/simple_log_collector/Makefile b/metrics/log_collectors/simple_log_collector/Makefile index a09244b2..c4899128 100644 --- a/metrics/log_collectors/simple_log_collector/Makefile +++ b/metrics/log_collectors/simple_log_collector/Makefile @@ -20,7 +20,12 @@ GRPC_GIT=git@github.ibm.com:deep-learning-platform/grpc-parameter-server.git WHOAMI ?= $(shell whoami) IMAGE_TAG ?= user-$(WHOAMI) -IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/log_collector:${IMAGE_TAG} +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET := -$(TARGET) + +IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/log_collector${IMAGE_NAME_TARGET}:${IMAGE_TAG} all: build push @@ -28,11 +33,11 @@ DOCKER_OPTIONS ?= build: cp -r ../training_data_service_client . - docker build -q ${DOCKER_OPTIONS} -t ${DOCKER_REPO}/${DOCKER_NAMESPACE}/log_collector:${IMAGE_TAG} -f Dockerfile . + docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} --build-arg ARCH=$(TARGET) -f Dockerfile . rm -r training_data_service_client push: - docker push ${REPO}/log_collector:${IMAGE_TAG} + docker push ${IMAGE_NAME} imagename: echo $(IMAGE_NAME) diff --git a/metrics/log_collectors/tensorboard/Makefile b/metrics/log_collectors/tensorboard/Makefile index 090df806..22a2099d 100644 --- a/metrics/log_collectors/tensorboard/Makefile +++ b/metrics/log_collectors/tensorboard/Makefile @@ -19,7 +19,12 @@ DOCKER_NAMESPACE ?= ffdl WHOAMI ?= $(shell whoami) IMAGE_TAG ?= user-$(WHOAMI) -IMAGE_NAME?=${DOCKER_REPO}/${DOCKER_NAMESPACE}/tensorboard_extract:${IMAGE_TAG} +TARGET ?= $(shell uname -m) +ARCHS ?= x86_64 ppc64le + +IMAGE_NAME_TARGET = -$(TARGET) + +IMAGE_NAME ?= ${DOCKER_REPO}/${DOCKER_NAMESPACE}/tensorboard_extract${IMAGE_NAME_TARGET}:${IMAGE_TAG} DOCKER_OPTIONS ?= @@ -27,11 +32,11 @@ all: build push build: cp -r ../training_data_service_client . - docker build -q ${DOCKER_OPTIONS} -t ${DOCKER_REPO}/${DOCKER_NAMESPACE}/tensorboard_extract:${IMAGE_TAG} -f Dockerfile . + docker build -q ${DOCKER_OPTIONS} -t ${IMAGE_NAME} --build-arg ARCH=$(TARGET) -f Dockerfile . rm -r training_data_service_client push: - docker push ${REPO}/tensorboard_extract:${IMAGE_TAG} + docker push ${IMAGE_NAME} imagename: echo ${IMAGE_NAME} diff --git a/storage-plugin/templates/deployer.yaml b/storage-plugin/templates/deployer.yaml index 8306132c..51ba7b1c 100644 --- a/storage-plugin/templates/deployer.yaml +++ b/storage-plugin/templates/deployer.yaml @@ -19,7 +19,11 @@ spec: hostNetwork: true containers: - name: "ibmcloud-object-storage-deployer-container" +{{ if eq .Values.arch "ppc64le" }} + image: "{{ .Values.image.pluginrepository_ppc64le }}:{{ .Values.image.pluginBuild }}" +{{ else }} image: "{{ .Values.image.pluginrepository }}:{{ .Values.image.pluginBuild }}" +{{ end }} imagePullPolicy: {{ .Values.image.pullPolicy }} volumeMounts: - mountPath: /host diff --git a/storage-plugin/templates/provisioner.yaml b/storage-plugin/templates/provisioner.yaml index 198f26dd..ac9087f5 100644 --- a/storage-plugin/templates/provisioner.yaml +++ b/storage-plugin/templates/provisioner.yaml @@ -20,7 +20,11 @@ spec: serviceAccountName: ibmcloud-object-storage-plugin containers: - name: {{ .Chart.Name }}-container +{{ if eq .Values.arch "ppc64le" }} + image: "{{ .Values.image.repository_ppc64le }}:{{ .Values.image.Build }}" +{{ else }} image: "{{ .Values.image.repository }}:{{ .Values.image.Build }}" +{{ end }} imagePullPolicy: {{ .Values.image.pullPolicy }} args: - "-provisioner=ibm.io/ibmc-s3fs" diff --git a/storage-plugin/values.yaml b/storage-plugin/values.yaml index 2f90a7b7..90d52f22 100644 --- a/storage-plugin/values.yaml +++ b/storage-plugin/values.yaml @@ -1,7 +1,10 @@ replicaCount: 1 +arch: x86_64 image: repository: ffdl/ibmcloud-object-storage-plugin pluginrepository: ffdl/ibmcloud-object-storage-deployer + repository_ppc64le: smonov/ibmcloud-object-storage-plugin + pluginrepository_ppc64le: smonov/ibmcloud-object-storage-deployer Build: v0.1 pluginBuild: v0.1 pullPolicy: IfNotPresent diff --git a/templates/infrastructure/etcd.yml b/templates/infrastructure/etcd.yml index 402f7d6b..1fa78fc9 100644 --- a/templates/infrastructure/etcd.yml +++ b/templates/infrastructure/etcd.yml @@ -39,7 +39,11 @@ spec: - etcd0=http://etcd0:2380 - --initial-cluster-state - new +{{ if eq .Values.arch "ppc64le" }} + image: quay.io/coreos/etcd:v3.3.8-ppc64le +{{ else }} image: quay.io/coreos/etcd:latest +{{ end }} imagePullPolicy: IfNotPresent name: etcd0 ports: diff --git a/templates/infrastructure/mongo.yml b/templates/infrastructure/mongo.yml index a12456a3..0792fb84 100644 --- a/templates/infrastructure/mongo.yml +++ b/templates/infrastructure/mongo.yml @@ -15,13 +15,21 @@ spec: terminationGracePeriodSeconds: 10 containers: - name: mongo +{{ if eq .Values.arch "ppc64le" }} + image: ibmcom/mongodb-ppc64le:3.6.0 +{{ else }} image: mongo:3.0 +{{ end }} + {{ if .Values.docker.pullPolicy }} imagePullPolicy: {{.Values.docker.pullPolicy}} {{ end }} command: - mongod - "--smallfiles" +{{ if eq .Values.arch "ppc64le" }} + - "--bind_ip_all" +{{ end }} ports: - containerPort: 27017 resources: diff --git a/templates/infrastructure/storage.yml b/templates/infrastructure/storage.yml index c0931a59..101484b6 100644 --- a/templates/infrastructure/storage.yml +++ b/templates/infrastructure/storage.yml @@ -52,7 +52,11 @@ spec: spec: containers: - name: storage +{{ if eq .Values.arch "ppc64le" }} + image: {{.Values.docker.registry_ppc64le}}/localstack:0.8.6 +{{ else }} image: localstack/localstack:0.8.6 +{{ end }} {{ if .Values.docker.pullPolicy }} imagePullPolicy: {{.Values.docker.pullPolicy}} {{ end }} diff --git a/templates/monitoring/alertmanager-deployment.yml b/templates/monitoring/alertmanager-deployment.yml index 9b9fc2ad..c8cb98cc 100644 --- a/templates/monitoring/alertmanager-deployment.yml +++ b/templates/monitoring/alertmanager-deployment.yml @@ -18,7 +18,11 @@ spec: spec: containers: - name: alertmanager +{{ if eq .Values.arch "ppc64le" }} + image: ibmcom/alertmanager-ppc64le:v0.8.0 +{{ else }} image: quay.io/prometheus/alertmanager:v0.8.0 +{{ end }} args: - -config.file=/etc/prometheus/alertmanager.yml ports: diff --git a/templates/monitoring/prometheus-deployment.yml b/templates/monitoring/prometheus-deployment.yml index 6ad68d2f..054c2fe3 100644 --- a/templates/monitoring/prometheus-deployment.yml +++ b/templates/monitoring/prometheus-deployment.yml @@ -18,7 +18,11 @@ spec: spec: containers: - name: prometheus +{{ if eq .Values.arch "ppc64le" }} + image: ibmcom/prometheus-ppc64le:v1.7.1 +{{ else }} image: quay.io/prometheus/prometheus:v1.7.1 +{{ end }} args: - '-storage.local.retention=72h' - '-storage.local.memory-chunks=500000' @@ -47,7 +51,11 @@ spec: timeoutSeconds: 5 - name: grafana +{{ if eq .Values.arch "ppc64le" }} + image: ibmcom/grafana-ppc64le:4.6.3 +{{ else }} image: grafana/grafana +{{ end }} env: - name: GF_AUTH_BASIC_ENABLED value: "true" diff --git a/templates/monitoring/pushgateway-deployment.yml b/templates/monitoring/pushgateway-deployment.yml index 949d5efb..9afcfd38 100644 --- a/templates/monitoring/pushgateway-deployment.yml +++ b/templates/monitoring/pushgateway-deployment.yml @@ -18,12 +18,20 @@ spec: spec: containers: - name: prometheus-pushgateway +{{ if eq .Values.arch "ppc64le" }} + image: {{.Values.docker.registry_ppc64le}}/pushgateway +{{ else }} image: prom/pushgateway +{{ end }} ports: - name: push containerPort: 9091 - name: statsd-to-prometheus +{{ if eq .Values.arch "ppc64le" }} + image: ibmcom/statsd-exporter-ppc64le:latest +{{ else }} image: prom/statsd-exporter:master +{{ end }} ports: - containerPort: 9102 - containerPort: 9125 diff --git a/values.yaml b/values.yaml index c704f577..b49c39f2 100644 --- a/values.yaml +++ b/values.yaml @@ -2,10 +2,12 @@ namespace: default env: dev k8s_1dot8_or_above: true has_static_volumes: true +arch: x86_64 services: expose_node_port: true docker: registry: docker.io + registry_ppc64le: smonov namespace: ffdl image_prefix: ffdl- pullPolicy: IfNotPresent