Skip to content

Commit

Permalink
Adjust to the CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gshaibi committed May 19, 2024
1 parent 2517426 commit 9b008b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
12 changes: 3 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,13 @@ jobs:
- checkout
- pre_docker_commands
- run:
name: "Build Images"
name: "Build and Push Images"
environment:
CIRCLE_TAG: <<pipeline.git.revision>>
command: |
DOCKER_REPO_BASE="gcr.io/run-ai-staging/fake-gpu-operator"
make images DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${CIRCLE_TAG}
- run:
name: "Push to Google Cloud"
command: |
TAG=<<pipeline.git.revision>>
DOCKER_REPO_BASE="gcr.io/run-ai-staging/fake-gpu-operator"
make push-all DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${TAG}
make images DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${TAG} SHOULD_PUSH=true
deploy_to_production:
executor: runai-executor
steps:
Expand All @@ -102,8 +97,7 @@ jobs:
command: |
TAG=${CIRCLE_TAG/v/''}
DOCKER_REPO_BASE="gcr.io/run-ai-staging/fake-gpu-operator"
make images DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${TAG}
make push-all DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${TAG}
make images DOCKER_REPO_BASE=${DOCKER_REPO_BASE} DOCKER_TAG=${TAG} SHOULD_PUSH=true
chart_build_staging:
working_directory: ~/go/src/github.com/run-ai/fake-gpu-operator
docker:
Expand Down
37 changes: 10 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ DOCKER_TAG=0.0.0-dev
DOCKER_IMAGE_NAME=${DOCKER_REPO_FULL}:${DOCKER_TAG}
NAMESPACE=gpu-operator

SHOULD_PUSH?=false
DOCKER_BUILDX_PUSH_FLAG=$(if $(filter true,$(SHOULD_PUSH)),--push,)
DOCKER_BUILDX_PLATFORMS?=linux/amd64,linux/arm64
DOCKER_BUILDX_BUILDER?=fgo-multi-platform

OS?=linux
ARCH?=amd64

Expand All @@ -23,9 +28,12 @@ clean:
rm -rf ${BUILD_DIR}
.PHONY: clean

image:
init-buildx:
docker buildx inspect fgo-multi-platform > /dev/null || docker buildx create --name=fgo-multi-platform
docker buildx --builder=fgo-multi-platform build -t ${DOCKER_IMAGE_NAME} --target ${COMPONENT} --platform linux/amd64,linux/arm64 .
.PHONY: init-buildx

image: init-buildx
docker buildx --builder=fgo-multi-platform build -t ${DOCKER_IMAGE_NAME} --target ${COMPONENT} --platform ${DOCKER_BUILDX_PLATFORMS} ${DOCKER_BUILDX_PUSH_FLAG} .
.PHONY: image

images:
Expand All @@ -37,35 +45,10 @@ images:
make image COMPONENT=jupyter-notebook
.PHONY: images

push:
docker push ${DOCKER_IMAGE_NAME}
.PHONY: push

push-all:
make push COMPONENT=device-plugin
make push COMPONENT=status-updater
make push COMPONENT=status-exporter
make push COMPONENT=topology-server
make push COMPONENT=mig-faker
make push COMPONENT=jupyter-notebook
.PHONY: push-all

restart:
kubectl delete pod -l component=${COMPONENT} --force -n ${NAMESPACE}
.PHONY: restart

deploy: image push
.PHONY: deploy

deploy-all:
make image push COMPONENT=device-plugin
make image push COMPONENT=status-updater
make image push COMPONENT=status-exporter
make image push COMPONENT=topology-server
make image push COMPONENT=mig-faker
make image push COMPONENT=jupyter-notebook
.PHONY: deploy-all

image-test:
mkdir -p /tmp/artifacts/test-results
mkdir -p /tmp/artifacts/test-results/unit-tests
Expand Down

0 comments on commit 9b008b7

Please sign in to comment.