From b55960092f5e1e60dba1a4f21d49fab963f82495 Mon Sep 17 00:00:00 2001 From: Abdullah Yildirim Date: Tue, 20 Aug 2024 05:30:36 +0000 Subject: [PATCH] fix: multi-architecture builds (#142) --- .github/workflows/build-push.yaml | 4 ++-- .../{batchmap-flatmap => batchmap_flatmap}/Dockerfile | 8 ++++---- .../{batchmap-flatmap => batchmap_flatmap}/Makefile | 5 ++++- .../{batchmap-flatmap => batchmap_flatmap}/README.md | 0 .../{batchmap-flatmap => batchmap_flatmap}/go.mod | 2 +- .../{batchmap-flatmap => batchmap_flatmap}/go.sum | 0 .../{batchmap-flatmap => batchmap_flatmap}/main.go | 0 .../{batchmap-flatmap => batchmap_flatmap}/pipeline.yaml | 0 pkg/mapper/examples/even_odd/Dockerfile | 8 ++++---- pkg/mapper/examples/even_odd/Makefile | 5 ++++- pkg/mapper/examples/flatmap/Dockerfile | 8 ++++---- pkg/mapper/examples/flatmap/Makefile | 5 ++++- pkg/mapper/examples/forward_message/Dockerfile | 8 ++++---- pkg/mapper/examples/forward_message/Makefile | 5 ++++- pkg/mapper/examples/retry/Dockerfile | 8 ++++---- pkg/mapper/examples/retry/Makefile | 5 ++++- pkg/mapper/examples/tickgen/Dockerfile | 8 ++++---- pkg/mapper/examples/tickgen/Makefile | 5 ++++- pkg/mapstreamer/examples/flatmap_stream/Dockerfile | 8 ++++---- pkg/mapstreamer/examples/flatmap_stream/Makefile | 5 ++++- pkg/reducer/examples/counter/Dockerfile | 8 ++++---- pkg/reducer/examples/counter/Makefile | 5 ++++- pkg/reducer/examples/sum/Dockerfile | 8 ++++---- pkg/reducer/examples/sum/Makefile | 5 ++++- pkg/reducestreamer/examples/counter/Dockerfile | 8 ++++---- pkg/reducestreamer/examples/counter/Makefile | 5 ++++- pkg/reducestreamer/examples/sum/Dockerfile | 8 ++++---- pkg/reducestreamer/examples/sum/Makefile | 5 ++++- pkg/sessionreducer/examples/counter/Dockerfile | 8 ++++---- pkg/sessionreducer/examples/counter/Makefile | 5 ++++- pkg/sessionreducer/examples/sum/Dockerfile | 8 ++++---- pkg/sessionreducer/examples/sum/Makefile | 5 ++++- pkg/sideinput/examples/map_sideinput/Dockerfile | 8 ++++---- pkg/sideinput/examples/map_sideinput/Makefile | 5 ++++- pkg/sideinput/examples/map_sideinput/udf/Dockerfile | 8 ++++---- pkg/sideinput/examples/map_sideinput/udf/Makefile | 5 ++++- pkg/sideinput/examples/reduce_sideinput/Dockerfile | 8 ++++---- pkg/sideinput/examples/reduce_sideinput/Makefile | 5 ++++- pkg/sideinput/examples/reduce_sideinput/udf/Dockerfile | 7 ++++--- pkg/sideinput/examples/reduce_sideinput/udf/Makefile | 5 ++++- pkg/sideinput/examples/sideinput_function/Dockerfile | 8 ++++---- pkg/sideinput/examples/sideinput_function/Makefile | 5 ++++- pkg/sideinput/examples/simple_sideinput/Dockerfile | 8 ++++---- pkg/sideinput/examples/simple_sideinput/Makefile | 5 ++++- pkg/sideinput/examples/simple_sideinput/udf/Dockerfile | 7 ++++--- pkg/sideinput/examples/simple_sideinput/udf/Makefile | 5 ++++- .../examples/simple_source_with_sideinput/Dockerfile | 8 ++++---- .../examples/simple_source_with_sideinput/Makefile | 5 ++++- pkg/sideinput/examples/sink_sideinput/Dockerfile | 8 ++++---- pkg/sideinput/examples/sink_sideinput/Makefile | 5 ++++- pkg/sinker/examples/fallback/Dockerfile | 8 ++++---- pkg/sinker/examples/fallback/Makefile | 5 ++++- pkg/sinker/examples/log/Dockerfile | 8 ++++---- pkg/sinker/examples/log/Makefile | 5 ++++- pkg/sinker/examples/{redis-sink => redis_sink}/Dockerfile | 8 ++++---- pkg/sinker/examples/{redis-sink => redis_sink}/Makefile | 5 ++++- pkg/sinker/examples/{redis-sink => redis_sink}/README.md | 0 pkg/sinker/examples/{redis-sink => redis_sink}/go.mod | 0 pkg/sinker/examples/{redis-sink => redis_sink}/go.sum | 0 pkg/sinker/examples/{redis-sink => redis_sink}/main.go | 0 pkg/sourcer/examples/simple_source/Dockerfile | 8 ++++---- pkg/sourcer/examples/simple_source/Makefile | 5 ++++- .../examples/assign_event_time/Dockerfile | 8 ++++---- pkg/sourcetransformer/examples/assign_event_time/Makefile | 5 ++++- .../examples/event_time_filter/Dockerfile | 8 ++++---- pkg/sourcetransformer/examples/event_time_filter/Makefile | 7 ++++--- 66 files changed, 227 insertions(+), 143 deletions(-) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/Dockerfile (85%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/Makefile (73%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/README.md (100%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/go.mod (98%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/go.sum (100%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/main.go (100%) rename pkg/batchmapper/examples/{batchmap-flatmap => batchmap_flatmap}/pipeline.yaml (100%) rename pkg/sinker/examples/{redis-sink => redis_sink}/Dockerfile (87%) rename pkg/sinker/examples/{redis-sink => redis_sink}/Makefile (73%) rename pkg/sinker/examples/{redis-sink => redis_sink}/README.md (100%) rename pkg/sinker/examples/{redis-sink => redis_sink}/go.mod (100%) rename pkg/sinker/examples/{redis-sink => redis_sink}/go.sum (100%) rename pkg/sinker/examples/{redis-sink => redis_sink}/main.go (100%) diff --git a/.github/workflows/build-push.yaml b/.github/workflows/build-push.yaml index 8b27a413..29a66275 100644 --- a/.github/workflows/build-push.yaml +++ b/.github/workflows/build-push.yaml @@ -24,8 +24,8 @@ jobs: "pkg/sourcer/examples/simple_source", "pkg/sourcetransformer/examples/assign_event_time", "pkg/sourcetransformer/examples/event_time_filter", "pkg/sinker/examples/fallback", "pkg/sideinput/examples/map_sideinput", "pkg/sideinput/examples/reduce_sideinput", "pkg/sideinput/examples/sideinput_function", "pkg/sideinput/examples/simple_source_with_sideinput", - "pkg/sideinput/examples/sink_sideinput", "pkg/sinker/examples/redis-sink", "pkg/sideinput/examples/map_sideinput/udf", - "pkg/sideinput/examples/reduce_sideinput/udf", "pkg/batchmapper/examples/batchmap-flatmap" + "pkg/sideinput/examples/sink_sideinput", "pkg/sinker/examples/redis_sink", "pkg/sideinput/examples/map_sideinput/udf", + "pkg/sideinput/examples/reduce_sideinput/udf", "pkg/batchmapper/examples/batchmap_flatmap" ] steps: diff --git a/pkg/batchmapper/examples/batchmap-flatmap/Dockerfile b/pkg/batchmapper/examples/batchmap_flatmap/Dockerfile similarity index 85% rename from pkg/batchmapper/examples/batchmap-flatmap/Dockerfile rename to pkg/batchmapper/examples/batchmap_flatmap/Dockerfile index 855508a0..4333917c 100644 --- a/pkg/batchmapper/examples/batchmap-flatmap/Dockerfile +++ b/pkg/batchmapper/examples/batchmap_flatmap/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/batchmap-flatmap /bin/batchmap-flatmap +COPY dist/batchmap-flatmap-${TARGETARCH} /bin/batchmap-flatmap RUN chmod +x /bin/batchmap-flatmap #################################################################################################### # batchmap-flatmap #################################################################################################### -FROM scratch as batch-flatmap -ARG ARCH +FROM scratch AS batch-flatmap COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/batchmap-flatmap /bin/batchmap-flatmap diff --git a/pkg/batchmapper/examples/batchmap-flatmap/Makefile b/pkg/batchmapper/examples/batchmap_flatmap/Makefile similarity index 73% rename from pkg/batchmapper/examples/batchmap-flatmap/Makefile rename to pkg/batchmapper/examples/batchmap_flatmap/Makefile index ea6b9992..6a9ebbc7 100644 --- a/pkg/batchmapper/examples/batchmap-flatmap/Makefile +++ b/pkg/batchmapper/examples/batchmap_flatmap/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/batch-map-flatmap:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/batchmap-flatmap main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/batchmap-flatmap-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/batchmapper/examples/batchmap-flatmap/README.md b/pkg/batchmapper/examples/batchmap_flatmap/README.md similarity index 100% rename from pkg/batchmapper/examples/batchmap-flatmap/README.md rename to pkg/batchmapper/examples/batchmap_flatmap/README.md diff --git a/pkg/batchmapper/examples/batchmap-flatmap/go.mod b/pkg/batchmapper/examples/batchmap_flatmap/go.mod similarity index 98% rename from pkg/batchmapper/examples/batchmap-flatmap/go.mod rename to pkg/batchmapper/examples/batchmap_flatmap/go.mod index cc6b876d..99f7873e 100644 --- a/pkg/batchmapper/examples/batchmap-flatmap/go.mod +++ b/pkg/batchmapper/examples/batchmap_flatmap/go.mod @@ -1,6 +1,6 @@ module batchmap-flatmap -go 1.22 +go 1.20 replace github.com/numaproj/numaflow-go => ../../../.. diff --git a/pkg/batchmapper/examples/batchmap-flatmap/go.sum b/pkg/batchmapper/examples/batchmap_flatmap/go.sum similarity index 100% rename from pkg/batchmapper/examples/batchmap-flatmap/go.sum rename to pkg/batchmapper/examples/batchmap_flatmap/go.sum diff --git a/pkg/batchmapper/examples/batchmap-flatmap/main.go b/pkg/batchmapper/examples/batchmap_flatmap/main.go similarity index 100% rename from pkg/batchmapper/examples/batchmap-flatmap/main.go rename to pkg/batchmapper/examples/batchmap_flatmap/main.go diff --git a/pkg/batchmapper/examples/batchmap-flatmap/pipeline.yaml b/pkg/batchmapper/examples/batchmap_flatmap/pipeline.yaml similarity index 100% rename from pkg/batchmapper/examples/batchmap-flatmap/pipeline.yaml rename to pkg/batchmapper/examples/batchmap_flatmap/pipeline.yaml diff --git a/pkg/mapper/examples/even_odd/Dockerfile b/pkg/mapper/examples/even_odd/Dockerfile index 03a51492..469cb2dd 100644 --- a/pkg/mapper/examples/even_odd/Dockerfile +++ b/pkg/mapper/examples/even_odd/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/even-odd-example /bin/even-odd-example +COPY dist/even-odd-example-${TARGETARCH} /bin/even-odd-example RUN chmod +x /bin/even-odd-example #################################################################################################### # even-odd #################################################################################################### -FROM scratch as even-odd -ARG ARCH +FROM scratch AS even-odd COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/even-odd-example /bin/even-odd-example diff --git a/pkg/mapper/examples/even_odd/Makefile b/pkg/mapper/examples/even_odd/Makefile index a570d49d..5d9950ce 100644 --- a/pkg/mapper/examples/even_odd/Makefile +++ b/pkg/mapper/examples/even_odd/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-even-odd:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/even-odd-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/even-odd-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/mapper/examples/flatmap/Dockerfile b/pkg/mapper/examples/flatmap/Dockerfile index c3b6cc45..4e90da84 100644 --- a/pkg/mapper/examples/flatmap/Dockerfile +++ b/pkg/mapper/examples/flatmap/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/flatmap-example /bin/flatmap-example +COPY dist/flatmap-example-${TARGETARCH} /bin/flatmap-example RUN chmod +x /bin/flatmap-example #################################################################################################### # flatmap #################################################################################################### -FROM scratch as flatmap -ARG ARCH +FROM scratch AS flatmap COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/flatmap-example /bin/flatmap-example diff --git a/pkg/mapper/examples/flatmap/Makefile b/pkg/mapper/examples/flatmap/Makefile index 2050bbba..4ee21720 100644 --- a/pkg/mapper/examples/flatmap/Makefile +++ b/pkg/mapper/examples/flatmap/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-flatmap:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/flatmap-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/flatmap-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/mapper/examples/forward_message/Dockerfile b/pkg/mapper/examples/forward_message/Dockerfile index 7b7d7220..cd02a27e 100644 --- a/pkg/mapper/examples/forward_message/Dockerfile +++ b/pkg/mapper/examples/forward_message/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/forward-message-example /bin/forward-message-example +COPY dist/forward-message-example-${TARGETARCH} /bin/forward-message-example RUN chmod +x /bin/forward-message-example #################################################################################################### # forward-message #################################################################################################### -FROM scratch as forward-message -ARG ARCH +FROM scratch AS forward-message COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/forward-message-example /bin/forward-message-example diff --git a/pkg/mapper/examples/forward_message/Makefile b/pkg/mapper/examples/forward_message/Makefile index ce0e1a00..8e309226 100644 --- a/pkg/mapper/examples/forward_message/Makefile +++ b/pkg/mapper/examples/forward_message/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-forward-message:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/forward-message-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/forward-message-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/mapper/examples/retry/Dockerfile b/pkg/mapper/examples/retry/Dockerfile index a7451b3a..63fddb24 100644 --- a/pkg/mapper/examples/retry/Dockerfile +++ b/pkg/mapper/examples/retry/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/retry /bin/retry +COPY dist/retry-${TARGETARCH} /bin/retry RUN chmod +x /bin/retry #################################################################################################### # retry #################################################################################################### -FROM scratch as retry -ARG ARCH +FROM scratch AS retry COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/retry /bin/retry diff --git a/pkg/mapper/examples/retry/Makefile b/pkg/mapper/examples/retry/Makefile index 6d9d111a..5f57c875 100644 --- a/pkg/mapper/examples/retry/Makefile +++ b/pkg/mapper/examples/retry/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-retry:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/retry main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/retry-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/mapper/examples/tickgen/Dockerfile b/pkg/mapper/examples/tickgen/Dockerfile index 63363ded..b72e5212 100644 --- a/pkg/mapper/examples/tickgen/Dockerfile +++ b/pkg/mapper/examples/tickgen/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/tickgen-example /bin/tickgen-example +COPY dist/tickgen-example-${TARGETARCH} /bin/tickgen-example RUN chmod +x /bin/tickgen-example #################################################################################################### # flatmap #################################################################################################### -FROM scratch as tickgen -ARG ARCH +FROM scratch AS tickgen COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/tickgen-example /bin/tickgen-example diff --git a/pkg/mapper/examples/tickgen/Makefile b/pkg/mapper/examples/tickgen/Makefile index f8960563..6bd00553 100644 --- a/pkg/mapper/examples/tickgen/Makefile +++ b/pkg/mapper/examples/tickgen/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-tickgen:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/tickgen-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/tickgen-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/mapstreamer/examples/flatmap_stream/Dockerfile b/pkg/mapstreamer/examples/flatmap_stream/Dockerfile index 89e03cf8..9b2891de 100644 --- a/pkg/mapstreamer/examples/flatmap_stream/Dockerfile +++ b/pkg/mapstreamer/examples/flatmap_stream/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/flatmap-stream-example /bin/flatmap-stream-example +COPY dist/flatmap-stream-example-${TARGETARCH} /bin/flatmap-stream-example RUN chmod +x /bin/flatmap-stream-example #################################################################################################### # flatmap #################################################################################################### -FROM scratch as flatmap_stream -ARG ARCH +FROM scratch AS flatmap_stream COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/flatmap-stream-example /bin/flatmap-stream-example diff --git a/pkg/mapstreamer/examples/flatmap_stream/Makefile b/pkg/mapstreamer/examples/flatmap_stream/Makefile index a60a60b4..b32cffec 100644 --- a/pkg/mapstreamer/examples/flatmap_stream/Makefile +++ b/pkg/mapstreamer/examples/flatmap_stream/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-flatmap-stream:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/flatmap-stream-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/flatmap-stream-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/reducer/examples/counter/Dockerfile b/pkg/reducer/examples/counter/Dockerfile index 7f1e3e5c..26b7a5e3 100644 --- a/pkg/reducer/examples/counter/Dockerfile +++ b/pkg/reducer/examples/counter/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/counter-example /bin/counter-example +COPY dist/counter-example-${TARGETARCH} /bin/counter-example RUN chmod +x /bin/counter-example #################################################################################################### # counter #################################################################################################### -FROM scratch as counter -ARG ARCH +FROM scratch AS counter COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/counter-example /bin/counter-example diff --git a/pkg/reducer/examples/counter/Makefile b/pkg/reducer/examples/counter/Makefile index 314a42ed..0db29eb6 100644 --- a/pkg/reducer/examples/counter/Makefile +++ b/pkg/reducer/examples/counter/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-counter:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/counter-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/reducer/examples/sum/Dockerfile b/pkg/reducer/examples/sum/Dockerfile index 4b237f86..9497f6bb 100644 --- a/pkg/reducer/examples/sum/Dockerfile +++ b/pkg/reducer/examples/sum/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/sum-example /bin/sum-example +COPY dist/sum-example-${TARGETARCH} /bin/sum-example RUN chmod +x /bin/sum-example #################################################################################################### # sum #################################################################################################### -FROM scratch as sum -ARG ARCH +FROM scratch AS sum COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/sum-example /bin/sum-example diff --git a/pkg/reducer/examples/sum/Makefile b/pkg/reducer/examples/sum/Makefile index 8ab394aa..e67de79d 100644 --- a/pkg/reducer/examples/sum/Makefile +++ b/pkg/reducer/examples/sum/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sum:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/sum-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/reducestreamer/examples/counter/Dockerfile b/pkg/reducestreamer/examples/counter/Dockerfile index 7f1e3e5c..26b7a5e3 100644 --- a/pkg/reducestreamer/examples/counter/Dockerfile +++ b/pkg/reducestreamer/examples/counter/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/counter-example /bin/counter-example +COPY dist/counter-example-${TARGETARCH} /bin/counter-example RUN chmod +x /bin/counter-example #################################################################################################### # counter #################################################################################################### -FROM scratch as counter -ARG ARCH +FROM scratch AS counter COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/counter-example /bin/counter-example diff --git a/pkg/reducestreamer/examples/counter/Makefile b/pkg/reducestreamer/examples/counter/Makefile index 904e6e0b..f6d03343 100644 --- a/pkg/reducestreamer/examples/counter/Makefile +++ b/pkg/reducestreamer/examples/counter/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-stream-counter:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/counter-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/reducestreamer/examples/sum/Dockerfile b/pkg/reducestreamer/examples/sum/Dockerfile index 4b237f86..9497f6bb 100644 --- a/pkg/reducestreamer/examples/sum/Dockerfile +++ b/pkg/reducestreamer/examples/sum/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/sum-example /bin/sum-example +COPY dist/sum-example-${TARGETARCH} /bin/sum-example RUN chmod +x /bin/sum-example #################################################################################################### # sum #################################################################################################### -FROM scratch as sum -ARG ARCH +FROM scratch AS sum COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/sum-example /bin/sum-example diff --git a/pkg/reducestreamer/examples/sum/Makefile b/pkg/reducestreamer/examples/sum/Makefile index b21bdfcc..0e8c3dfd 100644 --- a/pkg/reducestreamer/examples/sum/Makefile +++ b/pkg/reducestreamer/examples/sum/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-stream-sum:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/sum-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sessionreducer/examples/counter/Dockerfile b/pkg/sessionreducer/examples/counter/Dockerfile index 7f1e3e5c..26b7a5e3 100644 --- a/pkg/sessionreducer/examples/counter/Dockerfile +++ b/pkg/sessionreducer/examples/counter/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/counter-example /bin/counter-example +COPY dist/counter-example-${TARGETARCH} /bin/counter-example RUN chmod +x /bin/counter-example #################################################################################################### # counter #################################################################################################### -FROM scratch as counter -ARG ARCH +FROM scratch AS counter COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/counter-example /bin/counter-example diff --git a/pkg/sessionreducer/examples/counter/Makefile b/pkg/sessionreducer/examples/counter/Makefile index a3db1644..82633875 100644 --- a/pkg/sessionreducer/examples/counter/Makefile +++ b/pkg/sessionreducer/examples/counter/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/session-counter:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/counter-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sessionreducer/examples/sum/Dockerfile b/pkg/sessionreducer/examples/sum/Dockerfile index 4fd55692..82d14952 100644 --- a/pkg/sessionreducer/examples/sum/Dockerfile +++ b/pkg/sessionreducer/examples/sum/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/sum-example /bin/sum-example +COPY dist/sum-example-${TARGETARCH} /bin/sum-example RUN chmod +x /bin/sum-example #################################################################################################### # counter #################################################################################################### -FROM scratch as sum -ARG ARCH +FROM scratch AS sum COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/sum-example /bin/sum-example diff --git a/pkg/sessionreducer/examples/sum/Makefile b/pkg/sessionreducer/examples/sum/Makefile index 0e5165f2..6c0e318f 100644 --- a/pkg/sessionreducer/examples/sum/Makefile +++ b/pkg/sessionreducer/examples/sum/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/session-sum:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/sum-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/map_sideinput/Dockerfile b/pkg/sideinput/examples/map_sideinput/Dockerfile index a2129aba..08d9d5dc 100644 --- a/pkg/sideinput/examples/map_sideinput/Dockerfile +++ b/pkg/sideinput/examples/map_sideinput/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/map-sideinput-example /bin/map-sideinput-example +COPY dist/map-sideinput-example-${TARGETARCH} /bin/map-sideinput-example RUN chmod +x /bin/map-sideinput-example #################################################################################################### # sideinput #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/map-sideinput-example /bin/map-sideinput-example diff --git a/pkg/sideinput/examples/map_sideinput/Makefile b/pkg/sideinput/examples/map_sideinput/Makefile index af336d1f..74dbbbab 100644 --- a/pkg/sideinput/examples/map_sideinput/Makefile +++ b/pkg/sideinput/examples/map_sideinput/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-sideinput:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/map-sideinput-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/map-sideinput-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/map_sideinput/udf/Dockerfile b/pkg/sideinput/examples/map_sideinput/udf/Dockerfile index 108f0b63..fb7acaeb 100644 --- a/pkg/sideinput/examples/map_sideinput/udf/Dockerfile +++ b/pkg/sideinput/examples/map_sideinput/udf/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/map-sideinput-udf /bin/map-sideinput-udf +COPY dist/map-sideinput-udf-${TARGETARCH} /bin/map-sideinput-udf RUN chmod +x /bin/map-sideinput-udf #################################################################################################### # udf-sideinput #################################################################################################### -FROM scratch as sideinput-udf -ARG ARCH +FROM scratch AS sideinput-udf COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/map-sideinput-udf /bin/map-sideinput-udf diff --git a/pkg/sideinput/examples/map_sideinput/udf/Makefile b/pkg/sideinput/examples/map_sideinput/udf/Makefile index a904bd3c..524dee6b 100644 --- a/pkg/sideinput/examples/map_sideinput/udf/Makefile +++ b/pkg/sideinput/examples/map_sideinput/udf/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-sideinput-udf:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/map-sideinput-udf main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/map-sideinput-udf-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/reduce_sideinput/Dockerfile b/pkg/sideinput/examples/reduce_sideinput/Dockerfile index ca830d0b..d95eba10 100644 --- a/pkg/sideinput/examples/reduce_sideinput/Dockerfile +++ b/pkg/sideinput/examples/reduce_sideinput/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/reduce-sideinput-example /bin/reduce-sideinput-example +COPY dist/reduce-sideinput-example-${TARGETARCH} /bin/reduce-sideinput-example RUN chmod +x /bin/reduce-sideinput-example #################################################################################################### # sideinput #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/reduce-sideinput-example /bin/reduce-sideinput-example diff --git a/pkg/sideinput/examples/reduce_sideinput/Makefile b/pkg/sideinput/examples/reduce_sideinput/Makefile index 33f1df97..624f8955 100644 --- a/pkg/sideinput/examples/reduce_sideinput/Makefile +++ b/pkg/sideinput/examples/reduce_sideinput/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sideinput:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/reduce-sideinput-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/reduce-sideinput-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/reduce_sideinput/udf/Dockerfile b/pkg/sideinput/examples/reduce_sideinput/udf/Dockerfile index 0df2c97e..6d6b0ec5 100644 --- a/pkg/sideinput/examples/reduce_sideinput/udf/Dockerfile +++ b/pkg/sideinput/examples/reduce_sideinput/udf/Dockerfile @@ -1,18 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/reduce-sideinput-udf /bin/reduce-sideinput-udf +COPY dist/reduce-sideinput-udf-${TARGETARCH} /bin/reduce-sideinput-udf RUN chmod +x /bin/reduce-sideinput-udf #################################################################################################### # udf-sideinput #################################################################################################### -FROM scratch as sideinput-udf +FROM scratch AS sideinput-udf ARG ARCH COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt diff --git a/pkg/sideinput/examples/reduce_sideinput/udf/Makefile b/pkg/sideinput/examples/reduce_sideinput/udf/Makefile index 5aec716b..c4f31859 100644 --- a/pkg/sideinput/examples/reduce_sideinput/udf/Makefile +++ b/pkg/sideinput/examples/reduce_sideinput/udf/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sideinput-udf:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/reduce-sideinput-udf main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/reduce-sideinput-udf-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/sideinput_function/Dockerfile b/pkg/sideinput/examples/sideinput_function/Dockerfile index 31c55a31..e88ea387 100644 --- a/pkg/sideinput/examples/sideinput_function/Dockerfile +++ b/pkg/sideinput/examples/sideinput_function/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/sideinput-function /bin/sideinput-function +COPY dist/sideinput-function-${TARGETARCH} /bin/sideinput-function RUN chmod +x /bin/sideinput-function #################################################################################################### # sideinput #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/sideinput-function /bin/sideinput-function diff --git a/pkg/sideinput/examples/sideinput_function/Makefile b/pkg/sideinput/examples/sideinput_function/Makefile index 2a7e3af3..07000e3a 100644 --- a/pkg/sideinput/examples/sideinput_function/Makefile +++ b/pkg/sideinput/examples/sideinput_function/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/sideinput-function:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sideinput-function main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/sideinput-function-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/simple_sideinput/Dockerfile b/pkg/sideinput/examples/simple_sideinput/Dockerfile index 47321360..aad6f1fc 100644 --- a/pkg/sideinput/examples/simple_sideinput/Dockerfile +++ b/pkg/sideinput/examples/simple_sideinput/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/sideinput-example /bin/sideinput-example +COPY dist/sideinput-example-${TARGETARCH} /bin/sideinput-example RUN chmod +x /bin/sideinput-example #################################################################################################### # sideinput #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/sideinput-example /bin/sideinput-example diff --git a/pkg/sideinput/examples/simple_sideinput/Makefile b/pkg/sideinput/examples/simple_sideinput/Makefile index 25805b66..86394292 100644 --- a/pkg/sideinput/examples/simple_sideinput/Makefile +++ b/pkg/sideinput/examples/simple_sideinput/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/sideinput-example:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sideinput-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/sideinput-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/simple_sideinput/udf/Dockerfile b/pkg/sideinput/examples/simple_sideinput/udf/Dockerfile index a957acec..4ac3496e 100644 --- a/pkg/sideinput/examples/simple_sideinput/udf/Dockerfile +++ b/pkg/sideinput/examples/simple_sideinput/udf/Dockerfile @@ -1,18 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/udf-sideinput-example /bin/udf-sideinput-example +COPY dist/udf-sideinput-example-${TARGETARCH} /bin/udf-sideinput-example RUN chmod +x /bin/udf-sideinput-example #################################################################################################### # udf-sideinput #################################################################################################### -FROM scratch as udf-sideinput +FROM scratch AS udf-sideinput ARG ARCH COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt diff --git a/pkg/sideinput/examples/simple_sideinput/udf/Makefile b/pkg/sideinput/examples/simple_sideinput/udf/Makefile index 16a1e0ae..eef24e79 100644 --- a/pkg/sideinput/examples/simple_sideinput/udf/Makefile +++ b/pkg/sideinput/examples/simple_sideinput/udf/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/udf-sideinput-example:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/udf-sideinput-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/udf-sideinput-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/simple_source_with_sideinput/Dockerfile b/pkg/sideinput/examples/simple_source_with_sideinput/Dockerfile index ba4e9c66..ddd5a7f2 100644 --- a/pkg/sideinput/examples/simple_source_with_sideinput/Dockerfile +++ b/pkg/sideinput/examples/simple_source_with_sideinput/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/simple-source-example /bin/simple-source-example +COPY dist/simple-source-example-${TARGETARCH} /bin/simple-source-example RUN chmod +x /bin/simple-source-example #################################################################################################### # simple-source #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/simple-source-example /bin/simple-source-example diff --git a/pkg/sideinput/examples/simple_source_with_sideinput/Makefile b/pkg/sideinput/examples/simple_source_with_sideinput/Makefile index 9d708bf1..dac2df17 100644 --- a/pkg/sideinput/examples/simple_source_with_sideinput/Makefile +++ b/pkg/sideinput/examples/simple_source_with_sideinput/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/simple-source-with-sideinput:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/simple-source-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/simple-source-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sideinput/examples/sink_sideinput/Dockerfile b/pkg/sideinput/examples/sink_sideinput/Dockerfile index e67b592b..3873fa70 100644 --- a/pkg/sideinput/examples/sink_sideinput/Dockerfile +++ b/pkg/sideinput/examples/sink_sideinput/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/redis-sink-with-sideinput /bin/redis-sink-with-sideinput +COPY dist/redis-sink-with-sideinput-${TARGETARCH} /bin/redis-sink-with-sideinput RUN chmod +x /bin/redis-sink-with-sideinput #################################################################################################### # redis #################################################################################################### -FROM scratch as sideinput -ARG ARCH +FROM scratch AS sideinput COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/redis-sink-with-sideinput /bin/redis-sink-with-sideinput diff --git a/pkg/sideinput/examples/sink_sideinput/Makefile b/pkg/sideinput/examples/sink_sideinput/Makefile index 3a11d6ad..1e4e4abf 100644 --- a/pkg/sideinput/examples/sink_sideinput/Makefile +++ b/pkg/sideinput/examples/sink_sideinput/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/redis-sink-with-sideinput:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/redis-sink-with-sideinput main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/redis-sink-with-sideinput-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sinker/examples/fallback/Dockerfile b/pkg/sinker/examples/fallback/Dockerfile index b5c9c889..1f5cea75 100644 --- a/pkg/sinker/examples/fallback/Dockerfile +++ b/pkg/sinker/examples/fallback/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/fallback-example /bin/fallback-example +COPY dist/fallback-example-${TARGETARCH} /bin/fallback-example RUN chmod +x /bin/fallback-example #################################################################################################### # fallback #################################################################################################### -FROM scratch as fallback -ARG ARCH +FROM scratch AS fallback COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/fallback-example /bin/fallback-example diff --git a/pkg/sinker/examples/fallback/Makefile b/pkg/sinker/examples/fallback/Makefile index 2e724ecd..d19e8beb 100644 --- a/pkg/sinker/examples/fallback/Makefile +++ b/pkg/sinker/examples/fallback/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/fb-sink-log:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/fallback-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/fallback-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sinker/examples/log/Dockerfile b/pkg/sinker/examples/log/Dockerfile index 9ade49b8..ec7fa26b 100644 --- a/pkg/sinker/examples/log/Dockerfile +++ b/pkg/sinker/examples/log/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/log-example /bin/log-example +COPY dist/log-example-${TARGETARCH} /bin/log-example RUN chmod +x /bin/log-example #################################################################################################### # log #################################################################################################### -FROM scratch as log -ARG ARCH +FROM scratch AS log COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/log-example /bin/log-example diff --git a/pkg/sinker/examples/log/Makefile b/pkg/sinker/examples/log/Makefile index 15248aa5..198a3c51 100644 --- a/pkg/sinker/examples/log/Makefile +++ b/pkg/sinker/examples/log/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/sink-log:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/log-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/log-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sinker/examples/redis-sink/Dockerfile b/pkg/sinker/examples/redis_sink/Dockerfile similarity index 87% rename from pkg/sinker/examples/redis-sink/Dockerfile rename to pkg/sinker/examples/redis_sink/Dockerfile index 3f6ffd4b..1c96ba64 100644 --- a/pkg/sinker/examples/redis-sink/Dockerfile +++ b/pkg/sinker/examples/redis_sink/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/redis-sink /bin/redis-sink +COPY dist/redis-sink-${TARGETARCH} /bin/redis-sink RUN chmod +x /bin/redis-sink #################################################################################################### # redis #################################################################################################### -FROM scratch as redis -ARG ARCH +FROM scratch AS redis COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/redis-sink /bin/redis-sink diff --git a/pkg/sinker/examples/redis-sink/Makefile b/pkg/sinker/examples/redis_sink/Makefile similarity index 73% rename from pkg/sinker/examples/redis-sink/Makefile rename to pkg/sinker/examples/redis_sink/Makefile index c58383b7..4bcb3b22 100644 --- a/pkg/sinker/examples/redis-sink/Makefile +++ b/pkg/sinker/examples/redis_sink/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = "quay.io/numaio/numaflow-go/redis-sink:${TAG}" +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/redis-sink main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/redis-sink-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sinker/examples/redis-sink/README.md b/pkg/sinker/examples/redis_sink/README.md similarity index 100% rename from pkg/sinker/examples/redis-sink/README.md rename to pkg/sinker/examples/redis_sink/README.md diff --git a/pkg/sinker/examples/redis-sink/go.mod b/pkg/sinker/examples/redis_sink/go.mod similarity index 100% rename from pkg/sinker/examples/redis-sink/go.mod rename to pkg/sinker/examples/redis_sink/go.mod diff --git a/pkg/sinker/examples/redis-sink/go.sum b/pkg/sinker/examples/redis_sink/go.sum similarity index 100% rename from pkg/sinker/examples/redis-sink/go.sum rename to pkg/sinker/examples/redis_sink/go.sum diff --git a/pkg/sinker/examples/redis-sink/main.go b/pkg/sinker/examples/redis_sink/main.go similarity index 100% rename from pkg/sinker/examples/redis-sink/main.go rename to pkg/sinker/examples/redis_sink/main.go diff --git a/pkg/sourcer/examples/simple_source/Dockerfile b/pkg/sourcer/examples/simple_source/Dockerfile index 166d7411..26a40966 100644 --- a/pkg/sourcer/examples/simple_source/Dockerfile +++ b/pkg/sourcer/examples/simple_source/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.12.3 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/simple-source-example /bin/simple-source-example +COPY dist/simple-source-example-${TARGETARCH} /bin/simple-source-example RUN chmod +x /bin/simple-source-example #################################################################################################### # simple-source #################################################################################################### -FROM scratch as simple-source -ARG ARCH +FROM scratch AS simple-source COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/simple-source-example /bin/simple-source-example diff --git a/pkg/sourcer/examples/simple_source/Makefile b/pkg/sourcer/examples/simple_source/Makefile index 2f37e477..5928528d 100644 --- a/pkg/sourcer/examples/simple_source/Makefile +++ b/pkg/sourcer/examples/simple_source/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/source-simple-source:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/simple-source-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/simple-source-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sourcetransformer/examples/assign_event_time/Dockerfile b/pkg/sourcetransformer/examples/assign_event_time/Dockerfile index 2509aa53..9c32239f 100644 --- a/pkg/sourcetransformer/examples/assign_event_time/Dockerfile +++ b/pkg/sourcetransformer/examples/assign_event_time/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.17.1 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/assign-event-time-example /bin/assign-event-time-example +COPY dist/assign-event-time-example-${TARGETARCH} /bin/assign-event-time-example RUN chmod +x /bin/assign-event-time-example #################################################################################################### # assign-event-time #################################################################################################### -FROM scratch as assign-event-time -ARG ARCH +FROM scratch AS assign-event-time COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/assign-event-time-example /bin/assign-event-time-example diff --git a/pkg/sourcetransformer/examples/assign_event_time/Makefile b/pkg/sourcetransformer/examples/assign_event_time/Makefile index 0cecf068..b0a40bd2 100644 --- a/pkg/sourcetransformer/examples/assign_event_time/Makefile +++ b/pkg/sourcetransformer/examples/assign_event_time/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/mapt-assign-event-time:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/assign-event-time-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/assign-event-time-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build diff --git a/pkg/sourcetransformer/examples/event_time_filter/Dockerfile b/pkg/sourcetransformer/examples/event_time_filter/Dockerfile index 1e318996..6bce98fe 100644 --- a/pkg/sourcetransformer/examples/event_time_filter/Dockerfile +++ b/pkg/sourcetransformer/examples/event_time_filter/Dockerfile @@ -1,19 +1,19 @@ #################################################################################################### # base #################################################################################################### -FROM alpine:3.17.1 as base +FROM alpine:3.20 AS base +ARG TARGETARCH RUN apk update && apk upgrade && \ apk add ca-certificates && \ apk --no-cache add tzdata -COPY dist/event-time-filter-example /bin/event-time-filter-example +COPY dist/event-time-filter-example-${TARGETARCH} /bin/event-time-filter-example RUN chmod +x /bin/event-time-filter-example #################################################################################################### # event-time-filter #################################################################################################### -FROM scratch as event-time-filter -ARG ARCH +FROM scratch AS event-time-filter COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt COPY --from=base /bin/event-time-filter-example /bin/event-time-filter-example diff --git a/pkg/sourcetransformer/examples/event_time_filter/Makefile b/pkg/sourcetransformer/examples/event_time_filter/Makefile index 1e03c89f..9b8d390e 100644 --- a/pkg/sourcetransformer/examples/event_time_filter/Makefile +++ b/pkg/sourcetransformer/examples/event_time_filter/Makefile @@ -1,10 +1,13 @@ TAG ?= stable PUSH ?= false IMAGE_REGISTRY = quay.io/numaio/numaflow-go/mapt-event-time-filter:${TAG} +ARCHITECTURES = amd64 arm64 .PHONY: build build: - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/event-time-filter-example main.go + for arch in $(ARCHITECTURES); do \ + GOOS=linux GOARCH=$${arch} go build -v -o ./dist/event-time-filter-example-$${arch} main.go; \ + done .PHONY: image-push image-push: build @@ -17,5 +20,3 @@ image: build clean: -rm -rf ./dist - -