|
| 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