This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add operator and dashboard image builds (#156)
* new brancb fuasdc:x * dashboard image added * tests added * dashboard fix * small fix * small fix * small fi * FINAL FIX * improvement * small fix * small fix * small fi * small * small fix * additional testing * sasdas * path * final fix * print gopath * done * added controller * FINAL FIX FS
- Loading branch information
1 parent
4f58a83
commit d9e5551
Showing
10 changed files
with
136 additions
and
21 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM golang:1.8 AS build | ||
COPY kubebench-dashboard /app/kubebench-dashboard | ||
ENTRYPOINT /app/kubebench-dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
# | ||
# Build Docker images for Kubebench controller. | ||
# This is intended to be invoked as a step in Argo to build the docker image. | ||
# | ||
# build_image.sh ${SRC_DIR} ${DOCKERFILE} ${IMAGE} ${VERSION} | ||
set -ex | ||
|
||
SRC_DIR=$(realpath $1) | ||
DOCKERFILE=$(realpath $2) | ||
IMAGE=$3 | ||
VERSION=$4 | ||
if [ -z ${VERSION} ]; then | ||
VERSION=$(git describe --tags --always --dirty) | ||
fi | ||
TAG=${REGISTRY}/${REPO_NAME}/${IMAGE}:${VERSION} | ||
|
||
echo "Setup build directory" | ||
export GOPATH=`mktemp -d -p $(dirname $SRC_DIR)` | ||
export PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH} | ||
mkdir -p ${GOPATH}/src/github.com/kubeflow/kubebench | ||
BUILD_DIR=${GOPATH}/src/github.com/kubeflow/kubebench | ||
|
||
echo "Copy source and Dockerfile to build directory" | ||
cp -r ${SRC_DIR}/vendor ${BUILD_DIR}/vendor | ||
mkdir -p ${BUILD_DIR}/dashboard/ | ||
cp -r ${SRC_DIR}/dashboard/kubebench-dashboard ${BUILD_DIR}/dashboard | ||
cp -r ${SRC_DIR}/controller ${BUILD_DIR}/controller | ||
cp ${DOCKERFILE} ${BUILD_DIR}/Dockerfile | ||
|
||
echo "Change working directory to ${BUILD_DIR}" | ||
cd ${BUILD_DIR} | ||
|
||
echo "Build go binaries" | ||
GOOS=linux CGO_ENABLED=0 go build -o kubebench-dashboard github.com/kubeflow/kubebench/dashboard/kubebench-dashboard | ||
|
||
echo "Authenticate gcloud account" | ||
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS} | ||
echo "Build image ${TAG}" | ||
gcloud builds submit --tag=${TAG} --project=${PROJECT} . | ||
|
||
echo "Clean up go build directory" | ||
cd | ||
rm -rf ${GOPATH} | ||
|
||
echo "Image ${TAG} built successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM golang:1.8 AS build | ||
COPY kubebench-operator /app/kubebench-operator | ||
ENTRYPOINT /app/kubebench-operator |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#!/bin/bash | ||
# | ||
# Build Docker images for Kubebench controller. | ||
# This is intended to be invoked as a step in Argo to build the docker image. | ||
# | ||
# build_image.sh ${SRC_DIR} ${DOCKERFILE} ${IMAGE} ${VERSION} | ||
set -ex | ||
|
||
SRC_DIR=$(realpath $1) | ||
DOCKERFILE=$(realpath $2) | ||
IMAGE=$3 | ||
VERSION=$4 | ||
if [ -z ${VERSION} ]; then | ||
VERSION=$(git describe --tags --always --dirty) | ||
fi | ||
TAG=${REGISTRY}/${REPO_NAME}/${IMAGE}:${VERSION} | ||
|
||
echo "Setup build directory" | ||
export GOPATH=`mktemp -d -p $(dirname $SRC_DIR)` | ||
export PATH=${GOPATH}/bin:/usr/local/go/bin:${PATH} | ||
mkdir -p ${GOPATH}/src/github.com/kubeflow/kubebench | ||
BUILD_DIR=${GOPATH}/src/github.com/kubeflow/kubebench | ||
|
||
echo "Copy source and Dockerfile to build directory" | ||
cp -r ${SRC_DIR}/vendor ${BUILD_DIR}/vendor | ||
cp -r ${SRC_DIR}/controller ${BUILD_DIR}/controller | ||
cp ${DOCKERFILE} ${BUILD_DIR}/Dockerfile | ||
|
||
echo "Change working directory to ${BUILD_DIR}" | ||
cd ${BUILD_DIR} | ||
|
||
echo "Build go binaries" | ||
GOOS=linux CGO_ENABLED=0 go build github.com/kubeflow/kubebench/controller/cmd/kubebench-operator | ||
|
||
echo "Authenticate gcloud account" | ||
gcloud auth activate-service-account --key-file=${GOOGLE_APPLICATION_CREDENTIALS} | ||
echo "Build image ${TAG}" | ||
gcloud builds submit --tag=${TAG} --project=${PROJECT} . | ||
|
||
echo "Clean up go build directory" | ||
cd | ||
rm -rf ${GOPATH} | ||
|
||
echo "Image ${TAG} built successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters