Skip to content

Commit d560888

Browse files
committed
Use single version tag for image
Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent 81fb7bb commit d560888

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
env:
7373
E2E_INSTALL_CTK: "true"
7474
E2E_IMAGE_NAME: ghcr.io/nvidia/container-toolkit
75-
E2E_IMAGE_TAG: ${{ inputs.version }}-ubi8
75+
E2E_IMAGE_TAG: ${{ inputs.version }}
7676
E2E_SSH_USER: ${{ secrets.E2E_SSH_USER }}
7777
E2E_SSH_HOST: ${{ steps.holodeck_public_dns_name.outputs.result }}
7878
run: |

deployments/container/Makefile

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ include $(CURDIR)/versions.mk
2929

3030
IMAGE_VERSION := $(VERSION)
3131

32-
IMAGE_TAG ?= $(VERSION)-$(DIST)
32+
IMAGE_TAG ?= $(VERSION)
3333
IMAGE = $(IMAGE_NAME):$(IMAGE_TAG)
3434

3535
OUT_IMAGE_NAME ?= $(IMAGE_NAME)
3636
OUT_IMAGE_VERSION ?= $(IMAGE_VERSION)
37-
OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)-$(DIST)
37+
OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)
3838
OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG)
3939

4040
##### Public rules #####
@@ -56,30 +56,16 @@ else
5656
include $(CURDIR)/deployments/container/multi-arch.mk
5757
endif
5858

59-
# For the default push target we also push a short tag equal to the version.
60-
# We skip this for the development release
61-
DEVEL_RELEASE_IMAGE_VERSION ?= devel
62-
PUSH_MULTIPLE_TAGS ?= true
63-
ifeq ($(strip $(OUT_IMAGE_VERSION)),$(DEVEL_RELEASE_IMAGE_VERSION))
64-
PUSH_MULTIPLE_TAGS = false
65-
endif
66-
ifeq ($(PUSH_MULTIPLE_TAGS),true)
67-
push-$(DEFAULT_PUSH_TARGET): push-short
68-
endif
69-
70-
push-%: DIST = $(*)
71-
push-short: DIST = $(DEFAULT_PUSH_TARGET)
72-
7359
# Define the push targets
7460
$(PUSH_TARGETS): push-%:
7561
$(CURDIR)/scripts/publish-image.sh $(IMAGE) $(OUT_IMAGE)
7662

77-
push-short:
78-
$(CURDIR)/scripts/publish-image.sh $(IMAGE) $(OUT_IMAGE)
63+
DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile
7964

80-
81-
build-%: DIST = $(*)
82-
build-%: DOCKERFILE = $(CURDIR)/deployments/container/Dockerfile
65+
# For packaging targets we set the output image tag to include the -packaging suffix.
66+
%-packaging: INTERMEDIATE_TARGET := --target=packaging
67+
%-packaging: IMAGE_TAG = $(IMAGE_VERSION)-packaging
68+
%-packaging: OUT_IMAGE_TAG = $(IMAGE_VERSION)-packaging
8369

8470
ARTIFACTS_ROOT ?= $(shell realpath --relative-to=$(CURDIR) $(DIST_DIR))
8571

@@ -110,17 +96,14 @@ PACKAGE_DIST_DEB = ubuntu18.04
11096
# TODO: This needs to be set to centos8 for ppc64le builds
11197
PACKAGE_DIST_RPM = centos7
11298

113-
build-packaging: INTERMEDIATE_TARGET := --target=packaging
99+
# Handle the default build target.
100+
.PHONY: build push
101+
build: build-$(DEFAULT_PUSH_TARGET)
102+
push: push-$(DEFAULT_PUSH_TARGET)
114103

115104
# Test targets
116105
test-%: DIST = $(*)
117106

118-
# Handle the default build target.
119-
.PHONY: build
120-
build: $(DEFAULT_PUSH_TARGET)
121-
$(DEFAULT_PUSH_TARGET): build-$(DEFAULT_PUSH_TARGET)
122-
$(DEFAULT_PUSH_TARGET): DIST = $(DEFAULT_PUSH_TARGET)
123-
124107
TEST_CASES ?= docker crio containerd
125108
$(TEST_TARGETS): test-%:
126109
TEST_CASES="$(TEST_CASES)" bash -x $(CURDIR)/test/container/main.sh run \

deployments/container/native-only.mk

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,3 @@ $(BUILD_TARGETS): build-%: image-%
2323
else
2424
$(BUILD_TARGETS): build-%: image-%
2525
endif
26-
27-
# For the default distribution we also retag the image.
28-
# Note: This needs to be updated for multi-arch images.
29-
ifeq ($(IMAGE_TAG),$(VERSION)-$(DIST))
30-
$(DEFAULT_PUSH_TARGET):
31-
$(DOCKER) image inspect $(IMAGE) > /dev/null || $(DOCKER) pull $(IMAGE)
32-
$(DOCKER) tag $(IMAGE) $(subst :$(IMAGE_TAG),:$(VERSION),$(IMAGE))
33-
endif

0 commit comments

Comments
 (0)