Skip to content

Commit 7d46426

Browse files
authored
Updated readies, added build module versions (#9)
1 parent 646a250 commit 7d46426

36 files changed

+1994
-426
lines changed

Dockerfile

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1-
# BUILD redisfab/redisedge-${OSNICK}:M.m.b-${ARCH}
1+
# BUILD redisfab/redisedge-${OSNICK}:${VERSION}-${ARCH}
2+
3+
ARG VERSION=0.1.0
24

35
# OSNICK=stretch|bionic|buster
46
ARG OSNICK=buster
57

68
# ARCH=x64|arm64v8|arm32v7
79
ARG ARCH=x64
810

11+
ARG REDISAI_VERSION=0.3.2
12+
ARG REDISTIMESERIES_VERSION=1.0.3
13+
ARG REDISGEARS_VERSION=0.4.0
14+
915
#----------------------------------------------------------------------------------------------
10-
FROM redisfab/redisai-cpu-${OSNICK}:0.3.1 as ai
11-
FROM redisfab/redistimeseries-${OSNICK}:1.0.2 as timeseries
12-
FROM redisfab/redisgears-${OSNICK}:0.3.1 as gears
16+
FROM redisfab/redisai-cpu-${OSNICK}:${REDISAI_VERSION} as ai
17+
FROM redisfab/redistimeseries-${OSNICK}:${REDISTIMESERIES_VERSION} as timeseries
18+
FROM redisfab/redisgears-${OSNICK}:${REDISGEARS_VERSION} as gears
1319

1420
#----------------------------------------------------------------------------------------------
1521
FROM redisfab/redis-${ARCH}-${OSNICK}:5.0.5
1622

23+
ARG OSNICK
24+
ARG ARCH
25+
ARG VERSION
26+
ARG REDISAI_VERSION
27+
ARG REDISTIMESERIES_VERSION
28+
ARG REDISGEARS_VERSION
29+
30+
RUN echo "Building redisedge-${OSNICK}:${VERSION}-${ARCH} with:" ;\
31+
echo " RedisAI=${REDISAI_VERSION}" ;\
32+
echo " RedisTimeSeries=${REDISTIMESERIES_VERSION}" ;\
33+
echo " RedisGears=${REDISGEARS_VERSION}"
34+
1735
RUN set -e ;\
1836
apt-get -qq update; apt-get -q install -y libgomp1
1937

@@ -23,9 +41,9 @@ WORKDIR /data
2341
RUN mkdir -p ${LIBDIR}
2442

2543
COPY --from=timeseries ${LIBDIR}/*.so ${LIBDIR}/
26-
COPY --from=ai ${LIBDIR}/ ${LIBDIR}/
27-
COPY --from=gears /opt/redislabs/lib/modules/redisgears.so ${LIBDIR}/
28-
COPY --from=gears /opt/redislabs/ /opt/redislabs/
44+
COPY --from=ai ${LIBDIR}/ ${LIBDIR}/
45+
COPY --from=gears /opt/redislabs/lib/modules/redisgears.so ${LIBDIR}/
46+
COPY --from=gears /opt/redislabs/ /opt/redislabs/
2947

3048
ADD redisedge.conf /etc
3149
CMD ["/etc/redisedge.conf"]

Dockerfile.arm

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,39 @@
1-
# BUILD redisfab/redisedge-${OSNICK}:M.m.b-${ARCH}
1+
# BUILD redisfab/redisedge-${OSNICK}:${VERSION}-${ARCH}
2+
3+
ARG VERSION=0.1.0
24

35
# OSNICK=stretch|bionic|buster
46
ARG OSNICK=buster
57

68
# ARCH=arm64v8|arm32v7
79
ARG ARCH=arm64v8
810

11+
ARG REDISAI_VERSION=0.3.2
12+
ARG REDISTIMESERIES_VERSION=1.0.3
13+
ARG REDISGEARS_VERSION=0.4.0
14+
915
#----------------------------------------------------------------------------------------------
10-
FROM redisfab/redisai-cpu-${OSNICK}:0.3.1-${ARCH} as ai
11-
FROM redisfab/redistimeseries-${OSNICK}:1.0.2-${ARCH} as timeseries
12-
FROM redisfab/redisgears-${OSNICK}:0.3.1-${ARCH} as gears
16+
FROM redisfab/redisai-cpu-${OSNICK}:${REDISAI_VERSION} as ai
17+
FROM redisfab/redistimeseries-${OSNICK}:${REDISTIMESERIES_VERSION} as timeseries
18+
FROM redisfab/redisgears-${OSNICK}:${REDISGEARS_VERSION} as gears
1319

1420
#----------------------------------------------------------------------------------------------
1521
FROM redisfab/redis-${ARCH}-${OSNICK}-xbuild:5.0.5
1622

1723
RUN [ "cross-build-start" ]
1824

25+
ARG OSNICK
26+
ARG ARCH
27+
ARG VERSION
28+
ARG REDISAI_VERSION
29+
ARG REDISTIMESERIES_VERSION
30+
ARG REDISGEARS_VERSION
31+
32+
RUN echo "Building redisedge-${OSNICK}:${VERSION}-${ARCH} with:" ;\
33+
echo " RedisAI=${REDISAI_VERSION}" ;\
34+
echo " RedisTimeSeries=${REDISTIMESERIES_VERSION}" ;\
35+
echo " RedisGears=${REDISGEARS_VERSION}"
36+
1937
RUN set -e ;\
2038
apt-get -qq update; apt-get -q install -y libgomp1
2139

build/docker/edge/Makefile

Lines changed: 8 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,19 @@
11

2-
.NOTPARALLEL:
3-
42
ROOT=../../..
5-
6-
ifeq ($(VERSION),)
7-
VERSION:=$(patsubst v%,%,$(shell git describe --tags `git rev-list --tags --max-count=1`))
8-
endif
9-
ifeq ($(VERSION),)
10-
$(error Cannot determine version. Aborting.)
11-
endif
3+
include $(ROOT)/deps/readies/mk/main
124

135
# OSNICK=buster|stretch|bionic
146
OSNICK ?= buster
157

168
REPO=redisfab
179
STEM=$(REPO)/redisedge
18-
BUILD_OPT=--rm
19-
# --squash
20-
21-
#----------------------------------------------------------------------------------------------
22-
23-
define targets # (1=OP, 2=op)
24-
$(1)_TARGETS :=
25-
$(1)_TARGETS += $(if $(findstring $(X64),1),$(2)_x64)
26-
$(1)_TARGETS += $(if $(findstring $(ARM7),1),$(2)_arm32v7)
27-
$(1)_TARGETS += $(if $(findstring $(ARM8),1),$(2)_arm64v8)
28-
29-
$(1)_TARGETS += $$(if $$(strip $$($(1)_TARGETS)),,$(2)_x64 $(2)_arm32v7 $(2)_arm64v8)
30-
endef
31-
32-
$(eval $(call targets,BUILD,build))
33-
$(eval $(call targets,PUSH,push))
34-
35-
#----------------------------------------------------------------------------------------------
36-
37-
define build_x64 # (1=arch)
38-
build_$(1):
39-
docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-x64 -f $(ROOT)/Dockerfile $(ROOT)
40-
41-
.PHONY: build_$(1)
42-
endef
43-
44-
define build_arm # (1=arch)
45-
build_$(1):
46-
docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-$(1) -f $(ROOT)/Dockerfile.arm \
47-
--build-arg ARCH=$(1) $(ROOT)
48-
49-
.PHONY: build_$(1)
50-
endef
51-
52-
define push # (1=arch)
53-
push_$(1):
54-
docker push $(STEM)-$(OSNICK):$(VERSION)-$(1)
55-
56-
.PHONY: push_$(1)
57-
endef
58-
59-
define create_manifest # (1=version)
60-
docker manifest create -a $(STEM)-$(OSNICK):$(1) \
61-
-a $(STEM)-$(OSNICK):$(VERSION)-x64 \
62-
-a $(STEM)-$(OSNICK):$(VERSION)-arm64v8 \
63-
-a $(STEM)-$(OSNICK):$(VERSION)-arm32v7
64-
docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm32v7 --os linux --arch arm --variant v7
65-
docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm64v8 --os linux --arch arm64 --variant v8
66-
docker manifest push -p $(STEM)-$(OSNICK):$(1)
67-
endef
68-
69-
#----------------------------------------------------------------------------------------------
70-
71-
all: build publish
72-
73-
$(eval $(call build_x64,x64))
74-
$(eval $(call build_arm,arm64v8))
75-
$(eval $(call build_arm,arm32v7))
76-
77-
$(eval $(call push,x64))
78-
$(eval $(call push,arm64v8))
79-
$(eval $(call push,arm32v7))
80-
81-
build: $(BUILD_TARGETS)
8210

83-
ifneq ($(PUSH),0)
84-
publish: $(PUSH_TARGETS)
85-
else
86-
publish:
87-
endif
88-
$(call create_manifest,$(VERSION))
89-
$(call create_manifest,latest)
11+
include ../versions
9012

91-
show:
92-
@echo "$(STEM)-$(OSNICK):"
93-
ifeq ($(INSPECT),1)
94-
@docker manifest inspect $(STEM)-$(OSNICK):$(VERSION) | jq
95-
else
96-
@curl -s -X "GET" https://cloud.docker.com/v2/repositories/$(STEM)-$(OSNICK)/tags/ | jq
97-
endif
13+
DOCKER_BUILD_ARGS += \
14+
VERSION=$(VERSION) \
15+
REDISAI_VERSION=$(REDISAI_VERSION) \
16+
REDISTIMESERIES_VERSION=$(REDISTIMESERIES_VERSION) \
17+
REDISGEARS_VERSION=$(REDISGEARS_VERSION)
9818

99-
.PHONY: build public show
19+
include $(MK)/docker

build/docker/versions

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
export REDISAI_VERSION=0.3.2
3+
export REDISTIMESERIES_VERSION=1.0.3
4+
export REDISGEARS_VERSION=0.4.0

build/docker/vision/Makefile

Lines changed: 9 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -1,99 +1,21 @@
11

2-
.NOTPARALLEL:
3-
42
ROOT=../../..
5-
6-
ifeq ($(VERSION),)
7-
VERSION:=$(patsubst v%,%,$(shell git describe --tags `git rev-list --tags --max-count=1`))
8-
endif
9-
ifeq ($(VERSION),)
10-
$(error Cannot determine version. Aborting.)
11-
endif
3+
include $(ROOT)/deps/readies/mk/main
124

135
# OSNICK=buster|stretch|bionic
146
OSNICK ?= buster
157

168
REPO=redisfab
179
STEM=$(REPO)/redisedgevision
18-
BUILD_OPT=--rm
19-
# --squash
20-
21-
#----------------------------------------------------------------------------------------------
22-
23-
define targets # (1=OP, 2=op)
24-
$(1)_TARGETS :=
25-
$(1)_TARGETS += $(if $(findstring $(X64),1),$(2)_x64)
26-
$(1)_TARGETS += $(if $(findstring $(ARM7),1),$(2)_arm32v7)
27-
$(1)_TARGETS += $(if $(findstring $(ARM8),1),$(2)_arm64v8)
28-
29-
$(1)_TARGETS += $$(if $$(strip $$($(1)_TARGETS)),,$(2)_x64 $(2)_arm32v7 $(2)_arm64v8)
30-
endef
31-
32-
$(eval $(call targets,BUILD,build))
33-
$(eval $(call targets,PUSH,push))
34-
35-
#----------------------------------------------------------------------------------------------
36-
37-
define build_x64 # (1=arch)
38-
build_$(1):
39-
docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-x64 -f $(ROOT)/vision/Dockerfile $(ROOT)
40-
41-
.PHONY: build_$(1)
42-
endef
43-
44-
define build_arm # (1=arch)
45-
build_$(1):
46-
docker build $(BUILD_OPT) -t $(STEM)-$(OSNICK):$(VERSION)-$(1) -f $(ROOT)/vision/Dockerfile.arm \
47-
--build-arg ARCH=$(1) $(ROOT)
48-
49-
.PHONY: build_$(1)
50-
endef
51-
52-
define push # (1=arch)
53-
push_$(1):
54-
docker push $(STEM)-$(OSNICK):$(VERSION)-$(1)
55-
56-
.PHONY: push_$(1)
57-
endef
58-
59-
define create_manifest # (1=version)
60-
docker manifest create -a $(STEM)-$(OSNICK):$(1) \
61-
-a $(STEM)-$(OSNICK):$(VERSION)-x64 \
62-
-a $(STEM)-$(OSNICK):$(VERSION)-arm64v8 \
63-
-a $(STEM)-$(OSNICK):$(VERSION)-arm32v7
64-
docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm32v7 --os linux --arch arm --variant v7
65-
docker manifest annotate $(STEM)-$(OSNICK):$(1) $(STEM)-$(OSNICK):$(VERSION)-arm64v8 --os linux --arch arm64 --variant v8
66-
docker manifest push -p $(STEM)-$(OSNICK):$(1)
67-
endef
68-
69-
#----------------------------------------------------------------------------------------------
70-
71-
all: build publish
72-
73-
$(eval $(call build_x64,x64))
74-
$(eval $(call build_arm,arm64v8))
75-
$(eval $(call build_arm,arm32v7))
76-
77-
$(eval $(call push,x64))
78-
$(eval $(call push,arm64v8))
79-
$(eval $(call push,arm32v7))
8010

81-
build: $(BUILD_TARGETS)
11+
DOCKERFILE_STEM=$(ROOT)/vision/Dockerfile
8212

83-
ifneq ($(PUSH),0)
84-
publish: $(PUSH_TARGETS)
85-
else
86-
publish:
87-
endif
88-
$(call create_manifest,$(VERSION))
89-
$(call create_manifest,latest)
13+
include ../versions
9014

91-
show:
92-
@echo "$(STEM)-$(OSNICK):"
93-
ifeq ($(INSPECT),1)
94-
@docker manifest inspect $(STEM)-$(OSNICK):$(VERSION) | jq
95-
else
96-
@curl -s -X "GET" https://cloud.docker.com/v2/repositories/$(STEM)-$(OSNICK)/tags/ | jq
97-
endif
15+
DOCKER_BUILD_ARGS += \
16+
VERSION=$(VERSION) \
17+
REDISAI_VERSION=$(REDISAI_VERSION) \
18+
REDISTIMESERIES_VERSION=$(REDISTIMESERIES_VERSION) \
19+
REDISGEARS_VERSION=$(REDISGEARS_VERSION)
9820

99-
.PHONY: build public show
21+
include $(MK)/docker

0 commit comments

Comments
 (0)