Skip to content
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,15 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set environment variables
id: vars
run: |
echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV
- name: Build bundle-image
env:
BUNDLE_IMAGE: "ghcr.io/nvidia/gpu-operator/gpu-operator-bundle:${{ github.ref_name }}-latest"
BUNDLE_IMAGE_TAG: "ghcr.io/nvidia/gpu-operator/gpu-operator-bundle:${{ env.COMMIT_SHORT_SHA }}"
OPERATOR_IMAGE_TAG: "ghcr.io/nvidia/gpu-operator:${{ env.COMMIT_SHORT_SHA }}"
VERSION: ""
DEFAULT_CHANNEL: "stable"
CHANNELS: "stable"
Expand Down
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
# BUNDLE_IMAGE defines the image:tag used for the bundle.
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMAGE=<some-registry>/<project-name-bundle>:<tag>)
BUNDLE_IMAGE ?= gpu-operator-bundle:$(VERSION)
BUNDLE_IMAGE_TAG ?= gpu-operator-bundle:$(VERSION)
BUNDLE_CSV_FILE ?= bundle/manifests/gpu-operator-certified.clusterserviceversion.yaml
OPERATOR_IMAGE_TAG ?= gpu-operator:$(VERSION)

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
Expand Down Expand Up @@ -126,16 +129,23 @@ bundle: manifests install-tools
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
operator-sdk bundle validate ./bundle

# update the bundle image tag in csv file
update-bundle-csv:
@echo "Updating GPU operator image in $(BUNDLE_CSV_FILE) to $(OPERATOR_IMAGE_TAG)"
@sed -i -e 's|gpu-operator:[^ " ]*|$(OPERATOR_IMAGE_TAG)|g' $(BUNDLE_CSV_FILE)
@echo "Bundle CSV updated successfully"

# Build the bundle image.
build-bundle-image:
build-bundle-image: update-bundle-csv
$(DOCKER) build \
--build-arg DEFAULT_CHANNEL=$(DEFAULT_CHANNEL) \
--build-arg GIT_COMMIT=$(GIT_COMMIT) \
-f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE) .
-f docker/bundle.Dockerfile -t $(BUNDLE_IMAGE) -t $(BUNDLE_IMAGE_TAG) .

# Push the bundle image.
push-bundle-image: build-bundle-image
$(DOCKER) push $(BUNDLE_IMAGE)
$(DOCKER) push $(BUNDLE_IMAGE_TAG)

# Define local and dockerized golang targets

Expand Down