|
| 1 | +# Feel free to change these |
| 2 | +PRODUCT=redisai |
| 3 | +DOCKER_ORG=redislabs |
| 4 | +REDIS_VERSION=6.2.4 |
| 5 | +REDIS_CUDA_VERSION=11.0-cudnn8 |
| 6 | +REDISAI_LITE=0 |
1 | 7 |
|
2 | | -ROOT=../../.. |
3 | | -MK.pyver:=3 |
4 | | -include $(ROOT)/opt/readies/mk/main |
5 | | - |
6 | | -# OSNICK=buster|stretch|bionic|xenial|centos7 |
7 | | -OSNICK ?= buster |
8 | | - |
9 | | -REPO=redisai |
10 | | - |
11 | | -# LATEST_BRANCH=1.2 |
12 | | -INT_BRANCHES=1.2 |
13 | | - |
14 | | -REDIS_VER:=6.2.4 |
15 | | -REDISAI_LITE:=0 |
| 8 | +PACK=1 # to fetch the artifacts |
16 | 9 |
|
17 | | -export ART_DIR=$(ROOT)/bin/artifacts |
18 | | -export ART_INT_DIR=/var/opt/redislabs/artifacts |
| 10 | +DOCKER_OPTS= # set, to pass custom options to docker, but remember to quote them |
| 11 | +OSNICK ?= bionic |
19 | 12 |
|
20 | | -DOCKER_BUILD_ARGS=\ |
21 | | - REDISAI_LITE=$(REDISAI_LITE) |
| 13 | +# set to pass multiple directories as docker sources to include in templates |
| 14 | +DOCKER_SOURCES="" |
22 | 15 |
|
23 | | -#---------------------------------------------------------------------------------------------- |
| 16 | +# set, to generate a file named Dockerfile<suffix>, i.e useful when you want to run things in parallel |
| 17 | +DOCKER_SUFFIX= |
24 | 18 |
|
25 | | -ifeq ($(CPU),1) |
26 | | -VARIANT=cpu |
| 19 | +# Add space delimited docker tags, and they'll all be applied |
| 20 | +DOCKER_TAGS= |
27 | 21 |
|
28 | | -else ifeq ($(GPU),1) |
29 | | -VARIANT=gpu |
30 | | -DOCKERFILE_STEM ?= $(ROOT)/Dockerfile.gpu |
| 22 | +DEFAULT_TAG=${DOCKER_ORG}/${PRODUCT}:${VERSION}-cpu-${OSNICK} |
31 | 23 |
|
32 | | -OS.custom:=1 |
33 | | - |
34 | | -OS.centos7=centos7 |
35 | | -OS.bionic=ubuntu18.04 |
36 | | -OS.xenial=ubuntu16.04 |
37 | | - |
38 | | -else ifeq ($(JETSON),1) |
39 | | -VARIANT=jetson |
40 | | -DOCKERFILE_STEM ?= $(ROOT)/Dockerfile.jetson |
| 24 | +# set gpu arguments |
| 25 | +ifeq ($(GPU),1) |
| 26 | +DOCKER_ARGS = gpu_build=1 |
| 27 | +DOCKER_SUFFIX=gpu |
| 28 | +DEFAULT_TAG=${DOCKER_ORG}/${PRODUCT}:${VERSION}-gpu-${OSNICK} |
| 29 | +endif |
41 | 30 |
|
| 31 | +# remap ubuntu versions because of nvidia cuda |
| 32 | +ifeq ($(OSNICK),xenial) |
| 33 | +REDIS_CUDA_UBUNTUVERSION=16.04 |
| 34 | +endif |
| 35 | +ifeq ($(OSNICK),bionic) |
| 36 | +REDIS_CUDA_UBUNTUVERSION=18.04 |
42 | 37 | endif |
43 | 38 |
|
44 | | -#---------------------------------------------------------------------------------------------- |
| 39 | +DOCKERWRAPPER_EXTRA_VARS=\ |
| 40 | + REDISAI_LITE=${REDISAI_LITE} \ |
| 41 | + REDIS_CUDA_VERSION=${REDIS_CUDA_VERSION} \ |
| 42 | + REDIS_CUDA_UBUNTUVERSION=${REDIS_CUDA_UBUNTUVERSION} |
45 | 43 |
|
46 | | -include $(MK)/docker.native |
| 44 | +### Defaults ### |
| 45 | +ROOT=../../.. |
| 46 | +READIES=${ROOT}/opt/readies |
| 47 | + |
| 48 | +#------------------------------------------------------------------------------ |
| 49 | +define HELP |
| 50 | +make build # build and optionally publish the docker, from a template file |
| 51 | + OSNICK=<> # base operating system |
| 52 | + REDISAI_LITE=1 # enable RedisAI lite builds |
| 53 | + DOCKER_SUFFIX=<> # optional suffix for the generated dockerfile |
| 54 | + DOCKER_ARGS=FOO=BAR # key-value pairs of variables to pass into the docker build |
| 55 | + PACK=1 # fetch generated artifacts |
| 56 | + DOCKER_TAGS=a,b,c # tags to append and push to dockerhub |
| 57 | + DEFAULT_TAG=redislabs/redisai # default docker tag to build, and push |
| 58 | + TEST=1 # run tests, if specified |
| 59 | + VERSION=x.y.z # set the docker version |
| 60 | + NOP=1 # set to echo files in docker generation, and not run |
| 61 | + DOCKER_SOURCES=/a/path # append paths to the template generator |
| 62 | + PUBLISH=1 # if set, push to dockerhub (requires docker login) |
| 63 | + DOCKER_OPTS=XXX # Options to pass to the docker build command |
| 64 | +endef |
| 65 | +#------------------------------------------------------------------------------ |
| 66 | + |
| 67 | +# rules, for building |
| 68 | +include ${READIES}/mk/docker.rules |
0 commit comments