Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI workflow #104

Merged
merged 92 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
56988f2
POC for improved ci/cd
ayildirim21 Feb 29, 2024
092ee61
remove white space
ayildirim21 Feb 29, 2024
f4b688d
refactor
ayildirim21 Feb 29, 2024
309f177
modify workflows
ayildirim21 Mar 4, 2024
e6d9314
modify go.mod to use local references
ayildirim21 Mar 5, 2024
03eca81
script to automate dependency update
ayildirim21 Mar 5, 2024
2be2900
switch to local references
ayildirim21 Mar 5, 2024
3f32955
remove unecessary workflow
ayildirim21 Mar 6, 2024
5f5a2a7
modify update script
ayildirim21 Mar 6, 2024
9190d6c
added error checking to update script
ayildirim21 Mar 6, 2024
6a6e7ee
change to make image
ayildirim21 Mar 6, 2024
33c3599
implement update script and docker build/push workflow
ayildirim21 Mar 6, 2024
a5cafdc
modify update script
ayildirim21 Mar 6, 2024
07308dd
modify update script
ayildirim21 Mar 6, 2024
0ac7b4f
Update update_examples.sh
ayildirim21 Mar 7, 2024
f51a81b
remove duplicate file
ayildirim21 Mar 7, 2024
5409f64
trigger on changes to any file
ayildirim21 Mar 7, 2024
29fcbfd
add new line
ayildirim21 Mar 7, 2024
e919b0b
test replace directive placement
ayildirim21 Mar 8, 2024
3119f8a
revert changes
ayildirim21 Mar 8, 2024
46cd508
test
ayildirim21 Mar 8, 2024
e7a8a86
test
ayildirim21 Mar 8, 2024
9018fb4
change local reference paths
ayildirim21 Mar 8, 2024
e9ca527
update secrets
ayildirim21 Mar 8, 2024
b0f1950
modify update script
ayildirim21 Mar 8, 2024
aa14ba8
modify update script
ayildirim21 Mar 8, 2024
ec2f373
change to push trigger for testing purposes
ayildirim21 Mar 8, 2024
5d7a563
change trigger for testing purposes
ayildirim21 Mar 8, 2024
ec6bf90
change conditional to false for testing purposes
ayildirim21 Mar 8, 2024
4f4df31
change to numaio
ayildirim21 Mar 8, 2024
058affb
modify workflow
ayildirim21 Mar 8, 2024
8d8c30a
modify update script
ayildirim21 Mar 8, 2024
cde3d04
modify update script
ayildirim21 Mar 8, 2024
b033d55
modify update script
ayildirim21 Mar 8, 2024
58aedc3
modify update script
ayildirim21 Mar 8, 2024
9be79b3
modify update script
ayildirim21 Mar 8, 2024
bb0b80f
reduce matrix for testing
ayildirim21 Mar 8, 2024
c8f9f51
modify update script
ayildirim21 Mar 8, 2024
bd64973
modify update script
ayildirim21 Mar 8, 2024
89b9491
modify update script
ayildirim21 Mar 8, 2024
4ee7784
modify update script
ayildirim21 Mar 8, 2024
6cadb4f
test
ayildirim21 Mar 9, 2024
0a94862
test
ayildirim21 Mar 9, 2024
6278d2f
modify workflow
ayildirim21 Mar 10, 2024
c29770c
create development.md
ayildirim21 Mar 11, 2024
b6b778e
modify update script
ayildirim21 Mar 11, 2024
f0a8139
test
ayildirim21 Mar 11, 2024
3b6424a
test
ayildirim21 Mar 11, 2024
48847a6
modify workflow
ayildirim21 Mar 11, 2024
54edac1
modify workflow
ayildirim21 Mar 11, 2024
59d3614
add commas
ayildirim21 Mar 11, 2024
d62bc2b
test
ayildirim21 Mar 11, 2024
9d26ca0
Merge branch 'test-ci' into test-ci
ayildirim21 Mar 11, 2024
3e95445
fix file name
ayildirim21 Mar 11, 2024
96bfcca
Merge branch 'test-ci' of github.com:a3hadi/numaflow-go into test-ci
ayildirim21 Mar 11, 2024
182c49e
modify workflow
ayildirim21 Mar 11, 2024
5b9cd6a
modify workflow
ayildirim21 Mar 11, 2024
c1058ce
add checkout repo step
ayildirim21 Mar 11, 2024
b2f1404
add max parallel field
ayildirim21 Mar 11, 2024
47e9689
add max parallel field
ayildirim21 Mar 11, 2024
71be4d8
remove --push so image exists locally
ayildirim21 Mar 11, 2024
e630177
remove buildx
ayildirim21 Mar 11, 2024
0696c30
add back sideinput examples
ayildirim21 Mar 11, 2024
2c622c7
modify makefiles
ayildirim21 Mar 11, 2024
cea7dcd
modify makefiles
ayildirim21 Mar 11, 2024
0c50139
modify makefiles
ayildirim21 Mar 11, 2024
7496741
refactor
ayildirim21 Mar 11, 2024
414bd92
remove matrix
ayildirim21 Mar 11, 2024
c0c6ec8
remove name
ayildirim21 Mar 11, 2024
a8ca9ab
change job name
ayildirim21 Mar 11, 2024
e7d0854
modify makefiles
ayildirim21 Mar 11, 2024
dfe4935
modify workflow to use matrix strategy
ayildirim21 Mar 11, 2024
65b5b87
remove max parallel constraint
ayildirim21 Mar 11, 2024
72377e4
change to main
ayildirim21 Mar 11, 2024
c56f555
update development.md
ayildirim21 Mar 11, 2024
09d0d6b
add error checking
ayildirim21 Mar 11, 2024
5b96642
update development.md
ayildirim21 Mar 11, 2024
9ce71df
address comments
ayildirim21 Mar 11, 2024
c5dd673
Update .github/workflows/build-push.yaml
ayildirim21 Mar 11, 2024
d97bbbd
Update .github/workflows/build-push.yaml
ayildirim21 Mar 11, 2024
c56eefd
change to make image-push
ayildirim21 Mar 11, 2024
44ab995
refactor
ayildirim21 Mar 11, 2024
d31f517
add tag option to update script
ayildirim21 Mar 11, 2024
fa183d0
modify update script
ayildirim21 Mar 11, 2024
f19e28a
modify update script
ayildirim21 Mar 11, 2024
14252bf
modify development.md
ayildirim21 Mar 11, 2024
22abaae
modify development.md
ayildirim21 Mar 11, 2024
10bb0b0
modify development.md
ayildirim21 Mar 11, 2024
288fd8c
modify update script
ayildirim21 Mar 12, 2024
b4ae404
modify update script
ayildirim21 Mar 12, 2024
d380cf9
update development.md
ayildirim21 Mar 12, 2024
99879bc
modify update script
ayildirim21 Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions .github/workflows/build-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,24 @@ on:
- '*'

jobs:
build_push_examples:
name: Build and Push Images
docker_publish:
name: Build, Tag, and Push Images
runs-on: ubuntu-latest

strategy:
matrix:
repository: [
"map-even-odd"
"map-flatmap", "map-forward-message", "map-retry", "map-tickgen"
"map-flatmap-stream", "reduce-counter", "reduce-sum", "reduce-stream-counter",
"reduce-stream-sum", "session-counter", "sideinput-example", "udf-sideinput-example",
"sink-log", "source-simple-source", "mapt-assign-event-time", "mapt-event-time-filter"
dockerfile_paths: [
"pkg/mapper/examples/even_odd", "pkg/mapper/examples/flatmap", "pkg/mapper/examples/forward_message",
"pkg/mapper/examples/retry", "pkg/mapper/examples/tickgen", "pkg/mapstreamer/examples/flatmap_stream",
"pkg/reducer/examples/counter", "pkg/reducer/examples/sum", "pkg/reducestreamer/examples/counter",
"pkg/reducestreamer/examples/sum", "pkg/sessionreducer/examples/counter", "pkg/sideinput/examples/simple-sideinput/udf",
"pkg/sideinput/examples/simple-sideinput", "pkg/sinker/examples/log", "pkg/sourcer/examples/simple_source",
"pkg/sourcetransformer/examples/assign_event_time", "pkg/sourcetransformer/examples/event_time_filter"
]

steps:
- name: Check out repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -32,11 +35,5 @@ jobs:
registry: quay.io
username: ${{ secrets.NUMAIO_USERNAME }}
password: ${{ secrets.NUMAIO_PASSWORD }}
- name: Build and tag images
run: ./update_examples --build
- name: Push images
env:
IMAGE_PREFIX: "quay.io/numaio/numaflow-go"
TAG: "stable"
run: |
docker push ${{ env.IMAGE_PREFIX }}/${{ matrix.repository }}:${{ env.TAG }}
- name: Build, tag, and push images
run: ./update_examples.sh --build-push-example ${{ matrix.dockerfile_paths }}
26 changes: 22 additions & 4 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,36 @@ This document explains the development process for the Numaflow Go SDK.

The SDK uses local references in the `go.mod` file, i.e. the `github.com/numaproj/numaflow-go` dependency is pointing to your local
`numaflow-go` directory. Thus, you can automatically test your SDK changes without the need to push to your forked repository or modify the `go.mod` file.
Simply make your changes, build and push the desired example image, and you are ready to use it in any pipeline.
Simply make your changes, build and push the desired example image (with an appropriate tag, such as `test`), and you are ready to use it in any pipeline.

Each example directory has a Makefile which can be used to build, tag, and push images. In most cases, the `image-push` target should be used.
However, `buildx`, which is used to support multiple architectures, does not make a built image available locally. In the case that a developer
wants this functionality, they can use the `image` target.

After making changes to the SDK, if you want to build all the example images at once, in the root directory you can run:
```shell
./update_examples.sh -bp -t <tag>
```
The default tag is `stable`, but it is recommended you specify your own for testing purposes, as the Github Actions CI uses the `stable` tag. Note: do not forget to clean up testing tags
in the registry, i.e. delete them, once you are done testing.

You can alternatively build a specific example image by running the following in the root directory and providing the path to the Dockerfile (relative to root):
```shell
./update_examples.sh -bpe <path> -t <tag>
```
This is essentially equivalent to running `make image-push TAG=<tag>` in the example directory itself.

### Deploying

1. Create a PR for your changes. Once merged, it will trigger a workflow to build and push the images for all the examples,
with the tag `stable`. This consistent tag name is used so that the tags in the [E2E test pipelines](https://github.com/numaproj/numaflow/tree/main/test) do not need to be
updated each time a new change is made.
2. After the changes have been merged it is encouraged to update the dependency management files so that the version
displayed in the `go.mod` file reflects the commit SHA of the merged changes. This can be done simply by getting the
commit SHA of the merged changes and using it with the update script:
displayed in the `go.mod` file reflects the commit SHA of the merged changes. This can be done by getting the
commit SHA of the merged changes and using it with the update script. Alternatively, you can provide the specific version that you would like to update to, or even
pass in `latest` to fetch the latest version from the remote repository:
```shell
./update_examples -c <commit-sha>
./update_examples.sh -u <SDK-version | commit-sha | latest>
```
After running the script, create another PR for these changes.

Expand Down
10 changes: 9 additions & 1 deletion pkg/mapper/examples/even_odd/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-even-odd:stable" --target even-odd .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/mapper/examples/flatmap/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-flatmap:stable" --target flatmap .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/mapper/examples/forward_message/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-forward-message:stable" --target forward-message .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/mapper/examples/retry/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-retry:stable" --target retry .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/mapper/examples/tickgen/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-tickgen:stable" --target tickgen .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/mapstreamer/examples/flatmap_stream/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/map-flatmap-stream:stable" --target flatmap_stream .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/reducer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-counter:stable" --target counter .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/reducer/examples/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-sum:stable" --target sum .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/reducestreamer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-stream-counter:stable" --target counter .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/reducestreamer/examples/sum/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/reduce-stream-sum:stable" --target sum .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/sessionreducer/examples/counter/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

.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

.PHONY: image
image: build
docker build -t "quay.io/numaio/numaflow-go/session-counter:stable" --target counter .
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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/sideinput/examples/simple-sideinput/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

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

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

.PHONY: image
image: build
docker buildx build -t "quay.io/numaio/numaflow-go/sideinput-example:stable" --platform linux/amd64,linux/arm64 --target sideinput . --push
docker build -t "quay.io/numaio/numaflow-go/sideinput-example:${TAG}" --target sideinput .
@if [ "$(PUSH)" = "true" ]; then docker push "quay.io/numaio/numaflow-go/sideinput-example:${TAG}"; fi

clean:
-rm -rf ./dist
13 changes: 9 additions & 4 deletions pkg/sideinput/examples/simple-sideinput/udf/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
TAG ?= stable
PUSH ?= false

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

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

.PHONY: image
#To build an image that supports multiple platforms(linux/amd64,linux/arm64) and push to quay.io, use the following command
image: build
docker buildx build -t "quay.io/numaio/numaflow-go/udf-sideinput-example:stable" --platform linux/amd64,linux/arm64 --target udf-sideinput . --push


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

clean:
-rm -rf ./dist
12 changes: 10 additions & 2 deletions pkg/sinker/examples/log/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

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

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

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

clean:
-rm -rf ./dist
10 changes: 9 additions & 1 deletion pkg/sourcer/examples/simple_source/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
TAG ?= stable
PUSH ?= false

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

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

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

clean:
-rm -rf ./dist
Loading
Loading