Skip to content

Conversation

michi-covalent
Copy link
Contributor

@michi-covalent michi-covalent commented Sep 30, 2024

  • Define TARGET_DIR variable, and update hubble-bin target to take TARGET_DIR and EXT variables into account.
  • Update local-release target to call hubble-bin target to get rid of duplicate logic to generate Hubble binaries.
  • Update clean target to delete release directory.

- Define TARGET_DIR variable, and update hubble-bin target to take
  TARGET_DIR and EXT variables into account.
- Update local-release target to call hubble-bin target to get rid of
  duplicate logic to generate Hubble binaries.

Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>
@michi-covalent michi-covalent added the release-note/misc This PR makes changes that have no direct user impact. label Sep 30, 2024
@github-actions github-actions bot added hubble-cli PRs or GitHub issues related with hubble-cli hubble-cli-exclusive Only changes hubble-cli files. labels Sep 30, 2024
@michi-covalent
Copy link
Contributor Author

michi-covalent commented Sep 30, 2024

hubble cli ci run: https://github.com/cilium/cilium/actions/runs/11115624666/job/30884410093

sample output:

 % make
make -C . hubble-bin
GOOS= GOARCH= CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=7013895c83' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o ./hubble .

% make local-release
rm -rf hubble release
set -o errexit; \
        for OS in darwin linux windows; do \
                EXT=; \
                ARCHS=; \
                case $OS in \
                        darwin) \
                                ARCHS='amd64 arm64'; \
                                ;; \
                        linux) \
                                ARCHS='386 amd64 arm arm64'; \
                                ;; \
                        windows) \
                                ARCHS='386 amd64 arm64'; \
                                EXT=".exe"; \
                                ;; \
                esac; \
                for ARCH in $ARCHS; do \
                        echo Building release binary for $OS/$ARCH...; \
                        test -d release/$OS/$ARCH|| mkdir -p release/$OS/$ARCH; \
                        make hubble GOOS=$OS GOARCH=$ARCH EXT=$EXT TARGET_DIR=release/$OS/$ARCH; \
                        tar -czf release/hubble-$OS-$ARCH.tar.gz -C release/$OS/$ARCH hubble$EXT; \
                        (cd release && sha256sum hubble-$OS-$ARCH.tar.gz > hubble-$OS-$ARCH.tar.gz.sha256sum); \
                done; \
                rm -r release/$OS; \
        done;
Building release binary for darwin/amd64...
make -C . hubble-bin
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/darwin/amd64/hubble .
Building release binary for darwin/arm64...
make -C . hubble-bin
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/darwin/arm64/hubble .
Building release binary for linux/386...
make -C . hubble-bin
GOOS=linux GOARCH=386 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/linux/386/hubble .
Building release binary for linux/amd64...
make -C . hubble-bin
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/linux/amd64/hubble .
Building release binary for linux/arm...
make -C . hubble-bin
GOOS=linux GOARCH=arm CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/linux/arm/hubble .
Building release binary for linux/arm64...
make -C . hubble-bin
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/linux/arm64/hubble .
Building release binary for windows/386...
make -C . hubble-bin
GOOS=windows GOARCH=386 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/windows/386/hubble.exe .
Building release binary for windows/amd64...
make -C . hubble-bin
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/windows/amd64/hubble.exe .
Building release binary for windows/arm64...
make -C . hubble-bin
GOOS=windows GOARCH=arm64 CGO_ENABLED=0 go build   -ldflags "-w -s -X 'github.com/cilium/cilium/hubble/pkg.GitBranch=pr/michi/make-hubble' -X 'github.com/cilium/cilium/hubble/pkg.GitHash=40cf6debd9' -X 'github.com/cilium/cilium/hubble/pkg.Version=1.17.0-dev'" -o release/windows/arm64/hubble.exe .

% find release | sort
release
release/hubble-darwin-amd64.tar.gz
release/hubble-darwin-amd64.tar.gz.sha256sum
release/hubble-darwin-arm64.tar.gz
release/hubble-darwin-arm64.tar.gz.sha256sum
release/hubble-linux-386.tar.gz
release/hubble-linux-386.tar.gz.sha256sum
release/hubble-linux-amd64.tar.gz
release/hubble-linux-amd64.tar.gz.sha256sum
release/hubble-linux-arm.tar.gz
release/hubble-linux-arm.tar.gz.sha256sum
release/hubble-linux-arm64.tar.gz
release/hubble-linux-arm64.tar.gz.sha256sum
release/hubble-windows-386.tar.gz
release/hubble-windows-386.tar.gz.sha256sum
release/hubble-windows-amd64.tar.gz
release/hubble-windows-amd64.tar.gz.sha256sum
release/hubble-windows-arm64.tar.gz
release/hubble-windows-arm64.tar.gz.sha256sum

@michi-covalent
Copy link
Contributor Author

/test

@michi-covalent michi-covalent marked this pull request as ready for review September 30, 2024 23:26
@michi-covalent michi-covalent requested a review from a team as a code owner September 30, 2024 23:26
@michi-covalent michi-covalent added this pull request to the merge queue Oct 1, 2024
Merged via the queue into main with commit 40e0d8c Oct 1, 2024
150 checks passed
@michi-covalent michi-covalent deleted the pr/michi/make-hubble branch October 1, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hubble-cli PRs or GitHub issues related with hubble-cli hubble-cli-exclusive Only changes hubble-cli files. release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants