Skip to content

Commit e94c3dc

Browse files
committed
Add makefile
Signed-off-by: Swati Gupta <[email protected]>
1 parent eeb9031 commit e94c3dc

File tree

3 files changed

+55
-7
lines changed

3 files changed

+55
-7
lines changed

.github/workflows/image.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,7 @@ jobs:
106106
IMAGE_NAME: ghcr.io/nvidia/k8s-samples:nvbandwidth
107107
CUDA_VERSION: 12.5.0
108108
NVBANDWIDTH_VERSION: v0.7
109-
PUSH_ON_BUILD: true
109+
BUILD_MULTI_ARCH_IMAGES: true
110110
run: |
111111
echo "nvbandwidth ${NVBANDWIDTH_VERSION}"
112-
docker build --platform=linux/arm64 \
113-
--build-arg CUDA_VERSION=${CUDA_VERSION} \
114-
--build-arg NVBANDWIDTH_VERSION=${NVBANDWIDTH_VERSION} \
115-
-t "${IMAGE_NAME}-${NVBANDWIDTH_VERSION}" \
116-
-f multinodeNVL/nvbandwidth/Dockerfile .
112+
make -f multinodeNVL/nvbandwidth/Makefile all

multinodeNVL/nvbandwidth/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.

multinodeNVL/nvbandwidth/Makefile

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
BUILD_MULTI_ARCH_IMAGES ?= false
16+
DOCKER ?= docker
17+
BUILDX =
18+
ifeq ($(BUILD_MULTI_ARCH_IMAGES),true)
19+
BUILDX = buildx
20+
endif
21+
22+
CUDA_VERSION ?= 12.5.0
23+
NVBANDWIDTH_VERSION ?= v0.7
24+
25+
ifeq ($(IMAGE_NAME),)
26+
REGISTRY ?= nvidia/k8s-samples
27+
IMAGE_NAME := $(REGISTRY):nvbandwidth
28+
endif
29+
30+
IMAGE_TAG = $(IMAGE_NAME)-$(NVBANDWIDTH_VERSION)
31+
DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64,linux/arm64
32+
DOCKERFILE = $(CURDIR)/multinodeNVL/nvbandwidth/Dockerfile
33+
34+
.PHONY: all build push
35+
36+
all: build push
37+
38+
.PHONY: build
39+
build:
40+
DOCKER_BUILDKIT=1 \
41+
$(DOCKER) $(BUILDX) build --pull \
42+
--provenance=false --sbom=false \
43+
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
44+
--tag $(IMAGE_TAG) \
45+
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \
46+
--build-arg NVBANDWIDTH_VERSION="$(NVBANDWIDTH_VERSION)" \
47+
-f $(DOCKERFILE) \
48+
$(CURDIR)
49+
50+
.PHONY: push
51+
push: build
52+
$(DOCKER) push $(IMAGE_TAG)

0 commit comments

Comments
 (0)