Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 11 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Generated from kubebuilder template:
# https://github.com/kubernetes-sigs/kubebuilder/blob/v4.11.1/pkg/plugins/golang/v4/scaffolds/internal/templates/makefile.go

# IMAGE_TAG_BASE defines the namespace and part of the image name for remote images.
IMAGE_TAG_BASE ?= mcp-lifecycle-operator

# IMAGE_TAG defines the tag for the image.
IMAGE_TAG ?= latest

# GIT_IMAGE_TAG is a date-and-commit based tag for CI/release builds.
GIT_IMAGE_TAG = v$(shell date +%Y%m%d)-$(shell git describe --always --dirty)

# Image URL to use all building/pushing image targets
IMG ?= controller:latest
IMG ?= $(IMAGE_TAG_BASE):$(IMAGE_TAG)

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -182,13 +191,10 @@ docker-push: ## Push docker image with the manager.
PLATFORMS ?= linux/arm64,linux/amd64,linux/s390x,linux/ppc64le
.PHONY: docker-buildx
docker-buildx: ## Build and push docker image for the manager for cross-platform support
# copy existing Dockerfile and insert --platform=${BUILDPLATFORM} into Dockerfile.cross, and preserve the original Dockerfile
sed -e '1 s/\(^FROM\)/FROM --platform=\$$\{BUILDPLATFORM\}/; t' -e ' 1,// s//FROM --platform=\$$\{BUILDPLATFORM\}/' Dockerfile > Dockerfile.cross
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@creydr maybe we want to add this into the Dockerfile itself?

My understanding here is this should improve our build times since go will natively cross compile?

- $(CONTAINER_TOOL) buildx create --name mcp-lifecycle-operator-builder
$(CONTAINER_TOOL) buildx use mcp-lifecycle-operator-builder
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} -f Dockerfile.cross .
- $(CONTAINER_TOOL) buildx build --push --platform=$(PLATFORMS) --tag ${IMG} $(foreach tag,$(EXTRA_TAGS),-t $(IMAGE_TAG_BASE):$(tag)) .
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated
- $(CONTAINER_TOOL) buildx rm mcp-lifecycle-operator-builder
rm Dockerfile.cross

.PHONY: build-installer
build-installer: manifests generate kustomize ## Generate a consolidated YAML with CRDs and deployment.
Expand Down
14 changes: 5 additions & 9 deletions cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
timeout: 2700s
steps:
# This step runs the python script to build and push the Docker image.
# We use the gcloud builder because it comes with python and the docker client.
- name: "gcr.io/k8s-staging-test-infra/gcb-docker-gcloud"
entrypoint: "python3"
entrypoint: "make"
args:
- "./dev/tools/push-images"
# Assuming the script accepts project and tag arguments.
# Using standard Cloud Build substitutions.
- "--image-prefix=${_IMAGE_PREFIX}/"
- "--extra-image-tag=${_GIT_TAG}-${_CONFIG}"
- "--extra-image-tag=latest-${_CONFIG}"
- "docker-buildx"
- "IMAGE_TAG_BASE=${_IMAGE_PREFIX}/mcp-lifecycle-operator"
- "IMAGE_TAG=$$(GIT_IMAGE_TAG)"
- "EXTRA_TAGS=${_GIT_TAG}-${_CONFIG} latest-${_CONFIG}"

options:
enableStructuredLogging: true
Expand Down
110 changes: 0 additions & 110 deletions dev/tools/push-images

This file was deleted.

13 changes: 0 additions & 13 deletions dev/tools/shared/__init__.py

This file was deleted.

44 changes: 0 additions & 44 deletions dev/tools/shared/utils.py

This file was deleted.