Skip to content

Commit f853c5a

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

File tree

3 files changed

+52
-6
lines changed

3 files changed

+52
-6
lines changed

.github/workflows/image.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,7 @@ jobs:
107107
CUDA_VERSION: 12.5.0
108108
NVBANDWIDTH_VERSION: v0.7
109109
PUSH_ON_BUILD: true
110+
BUILD_MULTI_ARCH_IMAGES: true
110111
run: |
111112
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 .
113+
make -f multinodeNVL/nvbandwidth/Makefile build

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: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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+
32+
PUSH_ON_BUILD ?= false
33+
DOCKER_BUILD_OPTIONS = --output=type=image,push=$(PUSH_ON_BUILD)
34+
DOCKER_BUILD_PLATFORM_OPTIONS = --platform=linux/amd64,linux/arm64
35+
DOCKERFILE = $(CURDIR)/multinodeNVL/nvbandwidth/Dockerfile
36+
37+
.PHONY: build
38+
39+
build:
40+
DOCKER_BUILDKIT=1 \
41+
$(DOCKER) $(BUILDX) build --pull \
42+
--provenance=false --sbom=false \
43+
$(DOCKER_BUILD_OPTIONS) \
44+
$(DOCKER_BUILD_PLATFORM_OPTIONS) \
45+
--tag $(IMAGE_TAG) \
46+
--build-arg CUDA_VERSION="$(CUDA_VERSION)" \
47+
--build-arg NVBANDWIDTH_VERSION="$(NVBANDWIDTH_VERSION)" \
48+
-f $(DOCKERFILE) \
49+
$(CURDIR)

0 commit comments

Comments
 (0)