Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use CSM common base image. #209

Merged
merged 6 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
env:
VERSION: ${{ github.sha }}
CONTAINER_TOOL: docker
CSM_BASEIMAGE: quay.io/dell/container-storage-modules/csm-base-image:nightly
PASSED_BUILD: false
steps:
- name: Checkout the code
Expand All @@ -46,22 +47,20 @@ jobs:
go-version: "1.23"
- name: Build CSM Replication Docker Images
run: |
chmod +x ./scripts/build-ubi-micro.sh
make build-base-image
: # dell-csi-replicator
podman build . -t docker.io/dell-csi-replicator:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target sidecar --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/rep-ubimicro"
podman build . -t docker.io/dell-csi-replicator:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target sidecar --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE=${{ env.CSM_BASEIMAGE }}
podman save docker.io/library/dell-csi-replicator:${{ env.VERSION }} -o /tmp/dell-csi-replicator.tar
docker load -i /tmp/dell-csi-replicator.tar
: # dell-replication-controller
podman build . -t docker.io/dell-replication-controller:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target controller --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/rep-ubimicro"
podman build . -t docker.io/dell-replication-controller:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target controller --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE=${{ env.CSM_BASEIMAGE }}
podman save docker.io/library/dell-replication-controller:${{ env.VERSION }} -o /tmp/dell-replication-controller.tar
docker load -i /tmp/dell-replication-controller.tar
: # dell-csi-migrator
podman build . -t docker.io/dell-csi-migrator:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target migrator --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/rep-ubimicro"
podman build . -t docker.io/dell-csi-migrator:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target migrator --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE=${{ env.CSM_BASEIMAGE }}
podman save docker.io/library/dell-csi-migrator:${{ env.VERSION }} -o /tmp/dell-csi-migrator.tar
docker load -i /tmp/dell-csi-migrator.tar
: # dell-csi-node-rescanner
podman build . -t docker.io/dell-csi-node-rescanner:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target node-rescanner --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE="localhost/rep-ubimicro"
podman build . -t docker.io/dell-csi-node-rescanner:${{ env.VERSION }} -f ./Dockerfiles/Dockerfile --target node-rescanner --build-arg GOIMAGE=golang:latest --build-arg BASEIMAGE=${{ env.CSM_BASEIMAGE }}
podman save docker.io/library/dell-csi-node-rescanner:${{ env.VERSION }} -o /tmp/dell-csi-node-rescanner.tar
docker load -i /tmp/dell-csi-node-rescanner.tar
if [ $? -eq 0 ]; then { echo "PASSED_BUILD=true" >> $GITHUB_ENV; } fi
Expand Down
46 changes: 23 additions & 23 deletions image.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,34 @@ SIDECAR_IMAGE_M_TAG ?= "$(REGISTRY)/$(SIDECAR_M_IMAGE_NAME):$(VERSION)"
SIDECAR_IMAGE_TAG ?= "$(REGISTRY)/$(SIDECAR_IMAGE_NAME):$(VERSION)"
CONTROLLER_IMAGE_TAG ?= "$(REGISTRY)/$(CONTROLLER_IMAGE_NAME):$(VERSION)"

sidecar: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_TAG} -f Dockerfiles/Dockerfile --target sidecar --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}
sidecar: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_TAG} -f Dockerfiles/Dockerfile --target sidecar --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}

sidecar-push:
$(CONTAINER_TOOL) push ${SIDECAR_IMAGE_TAG}

sidecar-node-rescanner: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_NR_TAG} -f Dockerfiles/Dockerfile --target node-rescanner --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}
sidecar-node-rescanner: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_NR_TAG} -f Dockerfiles/Dockerfile --target node-rescanner --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}

sidecar-node-rescanner-push:
$(CONTAINER_TOOL) push ${SIDECAR_IMAGE_NR_TAG}

sidecar-migrator: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_M_TAG} -f Dockerfiles/Dockerfile --target migrator --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}
sidecar-migrator: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_M_TAG} -f Dockerfiles/Dockerfile --target migrator --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}

sidecar-migrator-push:
$(CONTAINER_TOOL) push ${SIDECAR_IMAGE_M_TAG}

controller: build-base-image
$(CONTAINER_TOOL) build . -t ${CONTROLLER_IMAGE_TAG} -f Dockerfiles/Dockerfile --target controller --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}
controller: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${CONTROLLER_IMAGE_TAG} -f Dockerfiles/Dockerfile --target controller --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE) ${NOCACHE_ARG}

controller-push:
$(CONTAINER_TOOL) push ${CONTROLLER_IMAGE_TAG}


images: sidecar controller sidecar-migrator sidecar-node-rescanner
images-push: sidecar-push controller-push sidecar-migrator-push sidecar-node-rescanner-push

Expand All @@ -67,25 +70,22 @@ deploy-controller:
kustomize build config/default | kubectl apply -f -

# Build controller image in dev environment with Golang
controller-dev: build-base-image
$(CONTAINER_TOOL) build . -t ${CONTROLLER_IMAGE_TAG} -f Dockerfiles/Dockerfile.dev --target controller --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
controller-dev: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${CONTROLLER_IMAGE_TAG} -f Dockerfiles/Dockerfile.dev --target controller --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

# Build sidecar image in dev environment with Golang
sidecar-dev: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_TAG} -f Dockerfiles/Dockerfile.dev --target sidecar --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

sidecar-migrator-dev: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_M_TAG} -f Dockerfiles/Dockerfile.dev --target migrator --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
sidecar-dev: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_TAG} -f Dockerfiles/Dockerfile.dev --target sidecar --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

sidecar-node-rescanner-dev: build-base-image
$(CONTAINER_TOOL) build . -t ${SIDECAR_IMAGE_NR_TAG} -f Dockerfiles/Dockerfile.dev --target node-rescanner --build-arg BASEIMAGE=$(BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)
sidecar-migrator-dev: download-csm-common
$(eval include csm-common.mk)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_M_TAG} -f Dockerfiles/Dockerfile.dev --target migrator --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

build-base-image: download-csm-common
sidecar-node-rescanner-dev: download-csm-common
$(eval include csm-common.mk)
@echo "Building base image from $(DEFAULT_BASEIMAGE) and loading dependencies..."
./scripts/build-ubi-micro.sh $(DEFAULT_BASEIMAGE)
@echo "Base image build: SUCCESS"
$(eval BASEIMAGE=rep-ubimicro:latest)
$(CONTAINER_TOOL) build --pull . -t ${SIDECAR_IMAGE_NR_TAG} -f Dockerfiles/Dockerfile.dev --target node-rescanner --build-arg BASEIMAGE=$(CSM_BASEIMAGE) --build-arg GOIMAGE=$(DEFAULT_GOIMAGE)

download-csm-common:
curl -O -L https://raw.githubusercontent.com/dell/csm/main/config/csm-common.mk
22 changes: 0 additions & 22 deletions scripts/build-ubi-micro.sh

This file was deleted.

Loading