Skip to content

Commit

Permalink
reduce build time (#84)
Browse files Browse the repository at this point in the history
* reduce build time

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* parallel build

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>

* fix

Signed-off-by: YujiOshima <yuji.oshima0x3fd@gmail.com>
  • Loading branch information
YujiOshima authored and k8s-ci-robot committed May 15, 2018
1 parent 1e622eb commit f19f29b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.git
.gitignore
docs
examples
manifests
14 changes: 7 additions & 7 deletions modeldb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
FROM thrift:0.11 AS build-env
RUN apt-get update && apt-get install -y git
RUN git clone https://github.com/mitdbg/modeldb
ADD modeldb/frontend /modeldb/frontend
WORKDIR /modeldb/frontend
RUN mkdir -p './thrift' && \
thrift -r -out './thrift' -gen js:node '../thrift/ModelDB.thrift'
FROM mitdbg/modeldb-frontend AS build-env
ADD modeldb/frontend/app.js /modeldb/frontend/app.js
ADD modeldb/frontend/public /modeldb/frontend/public
ADD modeldb/frontend/routes /modeldb/frontend/routes
ADD modeldb/frontend/util /modeldb/frontend/util
ADD modeldb/frontend/views /modeldb/frontend/views
ADD modeldb/frontend/package.json /modeldb/frontend/package.json

FROM node:alpine
COPY --from=build-env /modeldb /modeldb
Expand Down
56 changes: 39 additions & 17 deletions test/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,31 +34,53 @@ mkdir -p ${GOPATH}/src/github.com/${REPO_OWNER}
ln -s ${PWD} ${GO_DIR}

cd ${GO_DIR}
echo "Build operator binary"
mkdir bin
go build -o bin/katib-core github.com/kubeflow/katib/cmd/manager
go build -o bin/dlkmanager github.com/kubeflow/katib/dlk/dlkmanager
go build -o bin/katib-suggestion-grid github.com/kubeflow/katib/cmd/suggestion/grid
go build -o bin/katib-suggestion-hyperband github.com/kubeflow/katib/cmd/suggestion/hyperband
go build -o bin/katib-suggestion-random github.com/kubeflow/katib/cmd/suggestion/random
go build -o bin/katib-earlystopping-medianstopping github.com/kubeflow/katib/cmd/earlystopping/medianstopping
go build -o bin/katib github.com/kubeflow/katib/cmd/cli
#echo "building container in gcloud"
#gcloud version
# gcloud components update -q

pids=()
cp cmd/manager/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/vizier-core:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/vizier-core:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp cmd/suggestion/random/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-random:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-random:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp cmd/suggestion/grid/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-grid:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-grid:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp cmd/suggestion/hyperband/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-hyperband:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-hyperband:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp cmd/suggestion/bayesianoptimization/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-bayesianoptimization:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/suggestion-bayesianoptimization:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp cmd/earlystopping/medianstopping/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/earlystopping-medianstopping:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/earlystopping-medianstopping:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp dlk/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/dlk-manager:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/dlk-manager:${VERSION} --project=${PROJECT} &
pids+=($!)
sleep 30 # wait for copy code to gcloud

cp modeldb/Dockerfile .
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/katib-frontend:${VERSION} --project=${PROJECT}
gcloud container builds submit . --tag=${REGISTRY}/${REPO_NAME}/katib-frontend:${VERSION} --project=${PROJECT} &
pids+=($!)

for pid in ${pids[@]}; do
wait $pid
if [ $? -ne 0 ]; then
exit 1
fi
done

0 comments on commit f19f29b

Please sign in to comment.