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

Run jaeger-es-index-cleaner and jaeger-es-rollover locally #5714

Merged
merged 18 commits into from
Jul 8, 2024
Merged
46 changes: 0 additions & 46 deletions pkg/version/build_test.go

This file was deleted.

2 changes: 1 addition & 1 deletion plugin/storage/integration/es_index_cleaner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
samplingIndexName = "jaeger-sampling-2019-01-01"
spanIndexName = "jaeger-span-2019-01-01"
serviceIndexName = "jaeger-service-2019-01-01"
indexCleanerImage = "jaegertracing/jaeger-es-index-cleaner:latest"
indexCleanerImage = "jaegertracing/jaeger-es-index-cleaner:local-test"
rolloverImage = "jaegertracing/jaeger-es-rollover:1.57.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The jaeger-es-index-cleaner is now pulling the local image, and there are no longer any log messages for this process.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rollover image is also pulled by published version instead of being built locally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5714 (comment)
so is the current implementation for es-index-cleaner is good enough

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will make appropriate changes

rolloverNowEnvVar = `CONDITIONS='{"max_age":"0s"}'`
)
Expand Down
20 changes: 19 additions & 1 deletion scripts/es-integration-test.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,32 @@ teardown_storage() {
docker compose -f "${compose_file}" down
}

build_local_img(){
local LOCAL_FLAG=''
local platforms="linux/amd64"
# Loop through each platform (separated by commas)
for platform in $(echo "$platforms" | tr ',' ' '); do
# Extract the architecture from the platform string
arch=${platform##*/} # Remove everything before the last slash
make "build-binaries-$arch"
done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Loop through each platform (separated by commas)
for platform in $(echo "$platforms" | tr ',' ' '); do
# Extract the architecture from the platform string
arch=${platform##*/} # Remove everything before the last slash
make "build-binaries-$arch"
done
make "build-binaries-linux"

Is that what you are trying to do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but i let i be there since i wasn't sure if we have to test only on linux/amd64 i will make the changes

make create-baseimg
Copy link
Member

@yurishkuro yurishkuro Jul 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
make create-baseimg
make create-baseimg PLATFORMS=linux/$(go env GOARCH)

#bash scripts/build-upload-a-docker-image.sh ${LOCAL_FLAG} -b -c jaeger-es-index-cleaner -d cmd/es-index-cleaner -p "${platforms}" -t release -l Y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't we use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well i tried it gives me a log message of Unable to find image
'localhost:5000/jaegertracing/jaeger-es-index-cleaner:local-test' locally
although it is able to pull the image locally and run fine but i wanted to ask you first about it

docker build \
Copy link
Member

@yurishkuro yurishkuro Jul 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This worked for me:

Build with a fake GITHUB_SHA/BRANCH=local-test variables

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)

Run as local-test from local registry localhost:5000

docker run localhost:5000/jaegertracing/jaeger-es-index-cleaner:local-test

--build-arg base_image=localhost:5000/baseimg_alpine:latest \
--file cmd/es-index-cleaner/Dockerfile \
-t jaegertracing/jaeger-es-index-cleaner:local-test \
cmd/es-index-cleaner
}

main() {
check_arg "$@"
local distro=$1
local es_version=$2
local j_version=$2

bring_up_storage "${distro}" "${es_version}"

build_local_img
if [[ "${j_version}" == "v2" ]]; then
STORAGE=${distro} SPAN_STORAGE_TYPE=${distro} make jaeger-v2-storage-integration-test
else
Expand Down
Loading