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

chore: remove unnecessary flag #131

Merged
merged 2 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
11 changes: 3 additions & 8 deletions development.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ Each example directory has a Makefile which can be used to build, tag, and push
If you want to build and tag the image and then immediately push it to quay.io, use the `image-push` target.
If you want to build and tag a local image without pushing, use the `image` target.

If you want to build and push all the example images at once, you can run:
```shell
./hack/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.
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 an SDK change is made.

You can alternatively build and push a specific example image by running the following:
You can build and push a specific example image by running the following:
```shell
./hack/update_examples.sh -bpe <path-to-dockerfile> -t <tag>
```
This is essentially equivalent to running `make image-push TAG=<tag>` in the example directory itself.
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.
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 an SDK change is made.

Note: before running the script, ensure that through the CLI, you are logged into quay.io.

Expand Down
19 changes: 6 additions & 13 deletions hack/update_examples.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/bin/bash

function show_help () {
echo "Usage: $0 [-h|--help | -t|--tag <tag>] (-bp|--build-push | -bpe|--build-push-example <path> | -u|--update <SDK-version | commit-sha | latest >)"
echo "Usage: $0 [-h|--help | -t|--tag <tag>] (-bpe|--build-push-example <path> | -u|--update <SDK-version | commit-sha | latest >)"
echo " -h, --help Display help message and exit"
echo " -bp, --build-push Build the Dockerfiles of all the examples and push them to the quay.io registry"
echo " -bpe, --build-push-example Build the Dockerfile of the given example directory path, and push it to the quay.io registry"
echo " -t, --tag To be optionally used with -bpe or -bp. Specify the tag to build with. Default tag: stable"
KeranYang marked this conversation as resolved.
Show resolved Hide resolved
echo " -u, --update Update all of the examples to depend on the numaflow-go version with the specified SHA or version"
Expand Down Expand Up @@ -34,7 +33,6 @@ if [ $# -eq 0 ]; then
fi

usingHelp=0
usingBuildPush=0
usingBuildPushExample=0
usingVersion=0
usingTag=0
Expand All @@ -48,9 +46,6 @@ function handle_options () {
-h | --help)
usingHelp=1
;;
-bp | --build-push)
usingBuildPush=1
;;
-bpe | --build-push-example)
if [ -z "$2" ]; then
echo "Directory path not specified." >&2
Expand Down Expand Up @@ -96,14 +91,14 @@ function handle_options () {

handle_options "$@"

if (( usingBuildPush + usingBuildPushExample + usingVersion + usingHelp > 1 )); then
echo "Only one of '-h', '-bp', '-bpe', or, '-u' is allowed at a time" >&2
if (( usingBuildPushExample + usingVersion + usingHelp > 1 )); then
echo "Only one of '-h', '-bpe', or, '-u' is allowed at a time" >&2
show_help
exit 1
fi

if (( (usingTag + usingVersion + usingHelp > 1) || (usingTag && usingBuildPush + usingBuildPushExample == 0) )); then
echo "Can only use -t with -bp or -bpe" >&2
if (( (usingTag + usingVersion + usingHelp > 1) || (usingTag && usingBuildPushExample == 0) )); then
echo "Can only use -t with -bpe" >&2
show_help
exit 1
fi
Expand All @@ -120,9 +115,7 @@ if [ -n "$tag" ] && (( ! usingVersion )) && (( ! usingHelp )); then
echo "Using tag: $tag"
fi

if (( usingBuildPush )); then
traverse_examples "make image-push TAG=$tag"
elif (( usingBuildPushExample )); then
if (( usingBuildPushExample )); then
cd "./$directoryPath" || exit
if ! make image-push TAG="$tag"; then
echo "Error: failed to run make image-push in $directoryPath" >&2
Expand Down
4 changes: 2 additions & 2 deletions releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ As a result, the correct SDK version will always be printed in the server inform
and the example images will always be using the latest changes (due to the local references)
3. Since the Go SDK is a dependency of Numaflow, once a new version has been released, the `go.mod` [file](https://github.com/numaproj/numaflow/blob/main/go.mod)
in the Numaflow repo should be updated
- If you set the SDK release as latest, in your Numaflow repo run:
- If you set the SDK release as `latest`, in your Numaflow repo run:
```shell
go get github.com/numaproj/numaflow-go@latest
```
Expand All @@ -40,7 +40,7 @@ in the Numaflow repo should be updated
go mod tidy
```
Create a PR for these changes
- If you set the SDK release as pre-release, in your Numaflow repo run:
- If you set the SDK release as `pre-release`, in your Numaflow repo run:
```shell
go get github.com/numaproj/numaflow-go@<commit-sha>
```
Expand Down
Loading