Skip to content

Commit

Permalink
chore: stop hard coding quay.io image registry (#134)
Browse files Browse the repository at this point in the history
Signed-off-by: a3hadi <[email protected]>
  • Loading branch information
ayildirim21 authored Jul 4, 2024
1 parent 5b76519 commit ff520e4
Show file tree
Hide file tree
Showing 28 changed files with 109 additions and 83 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ on:

jobs:
docker_publish:
# run it only on numaproj/numaflow-go repository
# forked repositories normally don't have the proper permission setup.
# run workflow only on numaproj/numaflow-go repository
if: ${{ github.repository }} == "numaproj/numaflow-go"
name: Build, Tag, and Push Image
runs-on: ubuntu-latest
Expand Down
7 changes: 4 additions & 3 deletions pkg/mapper/examples/even_odd/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-even-odd:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/even-odd-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-even-odd:${TAG}" --platform linux/amd64,linux/arm64 --target even-odd . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target even-odd . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-even-odd:${TAG}" --target even-odd .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-even-odd:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target even-odd .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/mapper/examples/flatmap/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-flatmap:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/flatmap-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-flatmap:${TAG}" --platform linux/amd64,linux/arm64 --target flatmap . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target flatmap . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-flatmap:${TAG}" --target flatmap .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-flatmap:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target flatmap .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/mapper/examples/forward_message/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-forward-message:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/forward-message-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-forward-message:${TAG}" --platform linux/amd64,linux/arm64 --target forward-message . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target forward-message . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-forward-message:${TAG}" --target forward-message .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-forward-message:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target forward-message .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/mapper/examples/retry/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-retry:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/retry main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-retry:${TAG}" --platform linux/amd64,linux/arm64 --target retry . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target retry . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-retry:${TAG}" --target map-retry .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-retry:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target map-retry .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/mapper/examples/tickgen/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-tickgen:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/tickgen-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-tickgen:${TAG}" --platform linux/amd64,linux/arm64 --target tickgen . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target tickgen . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-tickgen:${TAG}" --target tickgen .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-tickgen:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target tickgen .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/mapstreamer/examples/flatmap_stream/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-flatmap-stream:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/flatmap-stream-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-flatmap-stream:${TAG}" --platform linux/amd64,linux/arm64 --target flatmap_stream . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target flatmap_stream . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-flatmap-stream:${TAG}" --target flatmap_stream .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-flatmap-stream:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target flatmap_stream .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/reducer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-counter:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-counter:${TAG}" --platform linux/amd64,linux/arm64 --target counter . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target counter . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-counter:${TAG}" --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-counter:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/reducer/examples/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sum:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-sum:${TAG}" --platform linux/amd64,linux/arm64 --target sum . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sum . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-sum:${TAG}" --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-sum:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/reducestreamer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-stream-counter:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-stream-counter:${TAG}" --platform linux/amd64,linux/arm64 --target counter . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target counter . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-stream-counter:${TAG}" --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-stream-counter:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/reducestreamer/examples/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-stream-sum:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-stream-sum:${TAG}" --platform linux/amd64,linux/arm64 --target sum . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sum . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-stream-sum:${TAG}" --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-stream-sum:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sessionreducer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/session-counter:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/counter-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/session-counter:${TAG}" --platform linux/amd64,linux/arm64 --target counter . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target counter . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/session-counter:${TAG}" --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/session-counter:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target counter .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sessionreducer/examples/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/session-sum:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/sum-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/session-sum:${TAG}" --platform linux/amd64,linux/arm64 --target sum . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sum . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/session-sum:${TAG}" --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/session-sum:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sum .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sideinput/examples/map_sideinput/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-sideinput:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/map-sideinput-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-sideinput:${TAG}" --platform linux/amd64,linux/arm64 --target sideinput . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sideinput . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-sideinput:${TAG}" --target sideinput .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-sideinput:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sideinput .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sideinput/examples/map_sideinput/udf/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/map-sideinput-udf:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/map-sideinput-udf main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/map-sideinput-udf:${TAG}" --platform linux/amd64,linux/arm64 --target sideinput-udf . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sideinput-udf . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-sideinput-udf:${TAG}" --target sideinput-udf .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/map-sideinput-udf:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sideinput-udf .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sideinput/examples/reduce_sideinput/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sideinput:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/reduce-sideinput-example main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-sideinput:${TAG}" --platform linux/amd64,linux/arm64 --target sideinput . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sideinput . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-sideinput:${TAG}" --target sideinput .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-sideinput:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sideinput .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
7 changes: 4 additions & 3 deletions pkg/sideinput/examples/reduce_sideinput/udf/Makefile
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
TAG ?= stable
PUSH ?= false
IMAGE_REGISTRY = quay.io/numaio/numaflow-go/reduce-sideinput-udf:${TAG}

.PHONY: build
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o ./dist/reduce-sideinput-udf main.go

.PHONY: image-push
image-push: build
docker buildx build -t "quay.io/numaio/numaflow-go/reduce-sideinput-udf:${TAG}" --platform linux/amd64,linux/arm64 --target sideinput-udf . --push
docker buildx build -t ${IMAGE_REGISTRY} --platform linux/amd64,linux/arm64 --target sideinput-udf . --push

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-sideinput-udf:${TAG}" --target sideinput-udf .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/reduce-sideinput-udf:${TAG}"; fi
docker build -t ${IMAGE_REGISTRY} --target sideinput-udf .
@if [ "$(PUSH)" = "true" ]; then docker push ${IMAGE_REGISTRY}; fi

clean:
-rm -rf ./dist
Loading

0 comments on commit ff520e4

Please sign in to comment.