Skip to content

Commit

Permalink
Move build scripts under scripts/build/ (jaegertracing#6446)
Browse files Browse the repository at this point in the history
## Which problem is this PR solving?
- part of  jaegertracing#6429

## Description of the changes
-  organized build scripts into `scripts/build`

---------

Signed-off-by: danish9039 <danishsiddiqui040@gmail.com>
  • Loading branch information
danish9039 authored Dec 31, 2024
1 parent ab21e26 commit cd9b8d5
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-crossdock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Build, test, and publish crossdock image
run: bash scripts/build-crossdock.sh
run: bash scripts/build/build-crossdock.sh
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-all-in-one.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Build, test, and publish all-in-one image
run: |
bash scripts/build-all-in-one-image.sh \
bash scripts/build/build-all-in-one-image.sh \
${{ env.BUILD_FLAGS }} \
"${{ matrix.jaeger_version }}"
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ jobs:
- name: Build only linux/amd64 container images for a Pull Request
if: github.ref_name != 'main'
# -D disables images with debugger
run: bash scripts/build-upload-docker-images.sh -D -p linux/amd64
run: bash scripts/build/build-upload-docker-images.sh -D -p linux/amd64

- name: Build and upload all container images
if: github.ref_name == 'main'
run: bash scripts/build-upload-docker-images.sh
run: bash scripts/build/build-upload-docker-images.sh
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-docker-hotrod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
uses: helm/kind-action@v1

- name: Build, test, and publish hotrod image
run: bash scripts/build-hotrod-image.sh ${{ env.BUILD_FLAGS }} -v ${{ matrix.jaeger-version }} -r ${{ matrix.runtime }}
run: bash scripts/build/build-hotrod-image.sh ${{ env.BUILD_FLAGS }} -v ${{ matrix.jaeger-version }} -r ${{ matrix.runtime }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:

- run: sudo apt-get install shellcheck

- run: shellcheck scripts/*.sh
- run: shellcheck scripts/**/*.sh

- name: Install shunit2 for shell unit tests
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ jobs:

- name: Package binaries
run: |
bash scripts/package-deploy.sh \
bash scripts/build/package-deploy.sh \
-p ${{ steps.params.outputs.platforms }} \
${{ steps.params.outputs.gpg_key_override }}
Expand All @@ -133,7 +133,7 @@ jobs:
- name: Build and upload all container images
# -B skips building the binaries since we already did that above
run: |
bash scripts/build-upload-docker-images.sh -B \
bash scripts/build/build-upload-docker-images.sh -B \
${{ steps.params.outputs.docker_flags }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -142,7 +142,7 @@ jobs:
- name: Build, test, and publish all-in-one v1 image
run: |
BRANCH=$(make echo-v1) \
bash scripts/build-all-in-one-image.sh \
bash scripts/build/build-all-in-one-image.sh \
${{ steps.params.outputs.docker_flags }} \
v1
env:
Expand All @@ -152,7 +152,7 @@ jobs:
- name: Build, test, and publish v2 image
run: |
BRANCH=$(make echo-v2) \
bash scripts/build-all-in-one-image.sh \
bash scripts/build/build-all-in-one-image.sh \
${{ steps.params.outputs.docker_flags }} \
v2
env:
Expand All @@ -161,7 +161,7 @@ jobs:

- name: Build, test, and publish hotrod image
run: |
bash scripts/build-hotrod-image.sh \
bash scripts/build/build-hotrod-image.sh \
${{ steps.params.outputs.docker_flags }}
env:
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ clean:
jaeger-ui/packages/jaeger-ui/build
find ./cmd/query/app/ui/actual -type f -name '*.gz' -delete
GOCACHE=$(GOCACHE) go clean -cache -testcache
bash scripts/clean-binaries.sh
bash scripts/build/clean-binaries.sh

.PHONY: test
test:
Expand Down
2 changes: 1 addition & 1 deletion Makefile.BuildBinaries.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jaeger-ui/packages/jaeger-ui/build/index.html:
.PHONY: rebuild-ui
rebuild-ui:
@echo "::group::rebuild-ui logs"
bash ./scripts/rebuild-ui.sh
bash ./scripts/build/rebuild-ui.sh
@echo "NOTE: This target only rebuilds the UI assets inside jaeger-ui/packages/jaeger-ui/build/."
@echo "NOTE: To make them usable from query-service run 'make build-ui'."
@echo "::endgroup::"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ set -x

# Set default GOARCH variable to the host GOARCH, the target architecture can
# be overrided by passing architecture value to the script:
# `GOARCH=<target arch> ./scripts/build-all-in-one-image.sh`.
# `GOARCH=<target arch> ./scripts/build/build-all-in-one-image.sh`.
GOARCH=${GOARCH:-$(go env GOARCH)}
repo="jaegertracing/${BINARY}"

Expand Down Expand Up @@ -120,22 +120,22 @@ fi
make "$baseimg_target" LINUX_PLATFORMS="$platforms"

# build all-in-one image locally for integration test (the explicit -l switch)
bash scripts/build-upload-a-docker-image.sh -l -b -c "${BINARY}" -d "cmd/${BINARY}" -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh -l -b -c "${BINARY}" -d "cmd/${BINARY}" -p "${platforms}" -t release

run_integration_test "localhost:5000/$repo"

# build all-in-one image and upload to dockerhub/quay.io
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "${BINARY}" -d "cmd/${BINARY}" -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "${BINARY}" -d "cmd/${BINARY}" -p "${platforms}" -t release

# build debug image if requested
if [[ "${add_debugger}" == "Y" ]]; then
make "build-${BINARY}" GOOS=linux GOARCH="$GOARCH" DEBUG_BINARY=1
repo="${repo}-debug"

# build locally for integration test (the -l switch)
bash scripts/build-upload-a-docker-image.sh -l -b -c "${BINARY}-debug" -d "cmd/${BINARY}" -t debug
bash scripts/build/build-upload-a-docker-image.sh -l -b -c "${BINARY}-debug" -d "cmd/${BINARY}" -t debug
run_integration_test "localhost:5000/$repo"

# build & upload official image
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "${BINARY}-debug" -d "cmd/${BINARY}" -t debug
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "${BINARY}-debug" -d "cmd/${BINARY}" -t debug
fi
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if [[ "$BRANCH" == "main" ]]; then
IFS=" " read -r -a IMAGE_TAGS <<< "$(bash scripts/compute-tags.sh ${REPO})"
IMAGE_TAGS+=("--tag" "docker.io/${REPO}:${COMMIT}" "--tag" "quay.io/${REPO}:${COMMIT}")
bash scripts/docker-login.sh

docker buildx build --push \
--progress=plain \
--platform=linux/amd64 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ done
# Build hotrod image locally (-l) for integration test.
# Note: hotrod's Dockerfile is different from main binaries,
# so we do not pass flags like -b and -t.
bash scripts/build-upload-a-docker-image.sh -l -c example-hotrod -d examples/hotrod -p "${current_platform}"
bash scripts/build/build-upload-a-docker-image.sh -l -c example-hotrod -d examples/hotrod -p "${current_platform}"

# Build all-in-one (for v1) or jaeger (for v2) image locally (-l) for integration test
make build-${binary}
bash scripts/build-upload-a-docker-image.sh -l -b -c "${binary}" -d cmd/"${binary}" -p "${current_platform}" -t release
bash scripts/build/build-upload-a-docker-image.sh -l -b -c "${binary}" -d cmd/"${binary}" -p "${current_platform}" -t release

if [[ "${runtime}" == "k8s" ]]; then
if ! kubectl cluster-info >/dev/null 2>&1; then
Expand Down Expand Up @@ -207,4 +207,4 @@ success="true"

# Ensure the image is published after successful test (maybe with -l flag if on a pull request).
# This is where all those multi-platform binaries we built earlier are utilized.
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -c example-hotrod -d examples/hotrod -p "${platforms}"
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c example-hotrod -d examples/hotrod -p "${platforms}"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,19 @@ make "$baseimg_target" LINUX_PLATFORMS="$platforms"
# build/upload raw and debug images of Jaeger backend components
for component in collector query ingester remote-storage
do
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}" -t release
# do not need debug image built for PRs
if [[ "${add_debugger}" == "Y" ]]; then
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c "jaeger-${component}-debug" -d "cmd/${component}" -t debug
fi
done

bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-rollover -d cmd/es-rollover -p "${platforms}" -t release
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -c jaeger-cassandra-schema -d plugin/storage/cassandra/ -p "${platforms}"
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -b -c jaeger-es-rollover -d cmd/es-rollover -p "${platforms}" -t release
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c jaeger-cassandra-schema -d plugin/storage/cassandra/ -p "${platforms}"

# build/upload images for jaeger-tracegen and jaeger-anonymizer
for component in tracegen anonymizer
do
bash scripts/build-upload-a-docker-image.sh "${FLAGS[@]}" -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}"
bash scripts/build/build-upload-a-docker-image.sh "${FLAGS[@]}" -c "jaeger-${component}" -d "cmd/${component}" -p "${platforms}"
done
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions scripts/es-integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ build_local_img(){
make build-es-rollover GOOS=linux
make create-baseimg PLATFORMS="linux/$(go env GOARCH)"
#build es-index-cleaner and es-rollover images
GITHUB_SHA=local-test BRANCH=local-test bash scripts/build-upload-a-docker-image.sh -l -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -t release -p "linux/$(go env GOARCH)"
GITHUB_SHA=local-test BRANCH=local-test bash scripts/build-upload-a-docker-image.sh -l -b -c jaeger-es-rollover -d cmd/es-rollover -t release -p "linux/$(go env GOARCH)"
GITHUB_SHA=local-test BRANCH=local-test bash scripts/build/build-upload-a-docker-image.sh -l -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -t release -p "linux/$(go env GOARCH)"
GITHUB_SHA=local-test BRANCH=local-test bash scripts/build/build-upload-a-docker-image.sh -l -b -c jaeger-es-rollover -d cmd/es-rollover -t release -p "linux/$(go env GOARCH)"
}

main() {
Expand Down

0 comments on commit cd9b8d5

Please sign in to comment.