"Fossies" - the Fresh Open Source Software Archive

Member "pytorch-1.8.2/docker.Makefile" (23 Jul 2021, 2283 Bytes) of package /linux/misc/pytorch-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Make source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "docker.Makefile": 1.12.1_vs_1.13.0.

    1 DOCKER_REGISTRY           = docker.io
    2 DOCKER_ORG                = $(shell docker info 2>/dev/null | sed '/Username:/!d;s/.* //')
    3 DOCKER_IMAGE              = pytorch
    4 DOCKER_FULL_NAME          = $(DOCKER_REGISTRY)/$(DOCKER_ORG)/$(DOCKER_IMAGE)
    5 
    6 ifeq ("$(DOCKER_ORG)","")
    7 $(warning WARNING: No docker user found using results from whoami)
    8 DOCKER_ORG                = $(shell whoami)
    9 endif
   10 
   11 CUDA_VERSION              = 11.0
   12 CUDNN_VERSION             = 8
   13 BASE_RUNTIME              = ubuntu:18.04
   14 BASE_DEVEL                = nvidia/cuda:$(CUDA_VERSION)-cudnn$(CUDNN_VERSION)-devel-ubuntu18.04
   15 
   16 # The conda channel to use to install pytorch / torchvision
   17 INSTALL_CHANNEL           = pytorch
   18 
   19 PYTHON_VERSION            = 3.7
   20 PYTORCH_VERSION           = $(shell git describe --tags)
   21 # Can be either official / dev
   22 BUILD_TYPE                = dev
   23 BUILD_PROGRESS            = auto
   24 BUILD_ARGS                = --build-arg BASE_IMAGE=$(BASE_IMAGE) \
   25                             --build-arg PYTHON_VERSION=$(PYTHON_VERSION) \
   26                             --build-arg CUDA_VERSION=$(CUDA_VERSION) \
   27                             --build-arg PYTORCH_VERSION=$(PYTORCH_VERSION) \
   28                             --build-arg INSTALL_CHANNEL=$(INSTALL_CHANNEL)
   29 EXTRA_DOCKER_BUILD_FLAGS ?=
   30 DOCKER_BUILD              = DOCKER_BUILDKIT=1 \
   31                             docker build \
   32                                 --progress=$(BUILD_PROGRESS) \
   33                                 $(EXTRA_DOCKER_BUILD_FLAGS) \
   34                                 --target $(BUILD_TYPE) \
   35                                 -t $(DOCKER_FULL_NAME):$(DOCKER_TAG) \
   36                                 $(BUILD_ARGS) .
   37 DOCKER_PUSH               = docker push $(DOCKER_FULL_NAME):$(DOCKER_TAG)
   38 
   39 .PHONY: all
   40 all: devel-image
   41 
   42 .PHONY: devel-image
   43 devel-image: BASE_IMAGE := $(BASE_DEVEL)
   44 devel-image: DOCKER_TAG := $(PYTORCH_VERSION)-devel
   45 devel-image:
   46     $(DOCKER_BUILD)
   47 
   48 .PHONY: devel-image
   49 devel-push: BASE_IMAGE := $(BASE_DEVEL)
   50 devel-push: DOCKER_TAG := $(PYTORCH_VERSION)-devel
   51 devel-push:
   52     $(DOCKER_PUSH)
   53 
   54 .PHONY: runtime-image
   55 runtime-image: BASE_IMAGE := $(BASE_RUNTIME)
   56 runtime-image: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
   57 runtime-image:
   58     $(DOCKER_BUILD)
   59     docker tag $(DOCKER_FULL_NAME):$(DOCKER_TAG) $(DOCKER_FULL_NAME):latest
   60 
   61 .PHONY: runtime-image
   62 runtime-push: BASE_IMAGE := $(BASE_RUNTIME)
   63 runtime-push: DOCKER_TAG := $(PYTORCH_VERSION)-runtime
   64 runtime-push:
   65     $(DOCKER_PUSH)
   66 
   67 .PHONY: clean
   68 clean:
   69     -docker rmi -f $(shell docker images -q $(DOCKER_FULL_NAME))