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

Conversation

hellspawn679
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • added a function build_local_img

How was this change tested?

Checklist

mehul gautam added 4 commits July 7, 2024 09:30
Signed-off-by: mehul gautam <[email protected]>
fix
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
@hellspawn679 hellspawn679 requested a review from a team as a code owner July 7, 2024 11:31
@hellspawn679 hellspawn679 requested a review from jkowall July 7, 2024 11:31
@dosubot dosubot bot added area/storage changelog:new-feature Change that should be called out as new feature in CHANGELOG storage/elasticsearch labels Jul 7, 2024
Signed-off-by: mehul gautam  <[email protected]>
@hellspawn679 hellspawn679 changed the title Node Run jaeger-es-index-cleaner and jaeger-es-rollover locally Jul 7, 2024
Copy link

codecov bot commented Jul 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.87%. Comparing base (13c715b) to head (85d373c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5714      +/-   ##
==========================================
- Coverage   96.89%   96.87%   -0.02%     
==========================================
  Files         334      334              
  Lines       16146    16146              
==========================================
- Hits        15644    15642       -2     
- Misses        333      334       +1     
- Partials      169      170       +1     
Flag Coverage Δ
badger_v1 8.06% <ø> (ø)
badger_v2 1.90% <ø> (ø)
cassandra-3.x-v1 16.62% <ø> (ø)
cassandra-3.x-v2 1.82% <ø> (ø)
cassandra-4.x-v1 16.62% <ø> (ø)
cassandra-4.x-v2 1.82% <ø> (ø)
elasticsearch-6.x-v1 18.80% <ø> (+0.01%) ⬆️
elasticsearch-7.x-v1 18.86% <ø> (ø)
elasticsearch-8.x-v1 19.04% <ø> (-0.02%) ⬇️
elasticsearch-8.x-v2 1.89% <ø> (ø)
grpc_v1 9.46% <ø> (ø)
grpc_v2 7.39% <ø> (-0.02%) ⬇️
kafka 9.75% <ø> (ø)
opensearch-1.x-v1 18.90% <ø> (ø)
opensearch-2.x-v1 18.90% <ø> (ø)
opensearch-2.x-v2 1.90% <ø> (ø)
unittests 95.26% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hellspawn679
Copy link
Contributor Author

@yurishkuro have a look if this implementation looks good enough then after i will make similar changes for jaeger-es-rollover

mehul gautam added 7 commits July 7, 2024 12:48
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Comment on lines 102 to 107
# 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 "build-binaries-$arch"
done
make create-baseimg
#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

@@ -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

mehul gautam added 2 commits July 7, 2024 16:10
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
@yurishkuro
Copy link
Member

why is pkg/version/build_test.go deleted in this PR?

@@ -96,14 +96,32 @@ teardown_storage() {
docker compose -f "${compose_file}" down
}

build_local_img(){
make "build-binaries-linux"
Copy link
Member

Choose a reason for hiding this comment

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

you don't need to build ALL binaries, only the 2 specific ones

Copy link
Member

Choose a reason for hiding this comment

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

I think you want

make build-es-index-cleaner GOOS=linux
make build-es-rollover GOOS=linux

@@ -96,14 +96,32 @@ teardown_storage() {
docker compose -f "${compose_file}" down
}

build_local_img(){
make "build-binaries-linux"
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)

make "build-binaries-linux"
make create-baseimg
#build es-index-cleaner
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

Comment on lines 35 to 36
indexCleanerImage = "jaegertracing/jaeger-es-index-cleaner:local-test"
rolloverImage = "jaegertracing/jaeger-es-rollover:local-test"
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
indexCleanerImage = "jaegertracing/jaeger-es-index-cleaner:local-test"
rolloverImage = "jaegertracing/jaeger-es-rollover:local-test"
indexCleanerImage = "localhost:5000/jaegertracing/jaeger-es-index-cleaner:local-test"
rolloverImage = "localhost:5000/jaegertracing/jaeger-es-rollover:local-test"

Signed-off-by: mehul gautam <[email protected]>
mehul gautam and others added 3 commits July 8, 2024 03:46
Signed-off-by: mehul gautam <[email protected]>
Signed-off-by: mehul gautam <[email protected]>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

Thanks!

@yurishkuro yurishkuro merged commit ea2ec18 into jaegertracing:main Jul 8, 2024
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:new-feature Change that should be called out as new feature in CHANGELOG storage/elasticsearch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants