-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add github action for jaeger all-in-one image #2663
Add github action for jaeger all-in-one image #2663
Conversation
Until we add two environment variables, the build will fail. Sample Success Run: https://github.com/Ashmita152/jaeger/pull/8/checks?check_run_id=1466574790 |
Codecov Report
@@ Coverage Diff @@
## master #2663 +/- ##
==========================================
+ Coverage 95.10% 95.11% +0.01%
==========================================
Files 213 213
Lines 9491 9491
==========================================
+ Hits 9026 9027 +1
+ Misses 388 387 -1
Partials 77 77
Continue to review full report at Codecov.
|
Could you include some details about what didn't work? Not a big deal, I think it's fine to use BTW, once we're completely off Travis, it would be nice to move scripts/travis/* to just scripts/. |
The issue was mainly around GitHub actions install node at path
I felt it maybe I am missing something. |
if we already know that we're running in the correct Node version, we do not need |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this error about? https://github.com/jaegertracing/jaeger/runs/1467144626?check_suite_focus=true#step:8:1046
fatal: No names found, cannot describe anything.
- name: Export BRANCH variable | ||
shell: bash | ||
run: | | ||
export BRANCH=${GITHUB_REF##*/} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions about this:
- If the branch is directly available, and is typically only used by a single step in the workflow (last step in this case), then why bother with an action instead of just
export BRANCH=${GITHUB_REF##*/}
inside therun: |
? - why do you use
##*/
? Wouldn't this work the same:export BRANCH=${GITHUB_REF}
? - GITHUB_REF is defined as "The branch or tag ref that triggered the workflow". As I understand it, for a pull request from a fork this would be the branch in the fork, which technically can be
master
(it's not recommended, but sometimes people create PRs directly from their fork's master branch). I wonder if this will confuse any of the scripts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the branch is directly available, and is typically only used by a single step in the workflow (last step in this case), then why bother with an action instead of just export BRANCH=${GITHUB_REF##*/} inside the run: |?
You're right, in that case we don't need to define an action.
why do you use ##*/? Wouldn't this work the same: export BRANCH=${GITHUB_REF}?
Generally GITHUB_REF is set as /ref/head/branch-name
$ export GITHUB_REF=/refs/head/foobar
$ echo ${GITHUB_REF##*/}
foobar
GITHUB_REF is defined as "The branch or tag ref that triggered the workflow". I wonder if this will confuse any of the scripts.
I will look at older travis runs and see what was the value of BRANCH being evaluated there and make sure that we set the BRANCH variable to the same value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the PR removing action and doing things in workflow itself.
- Setting BRANCH env as ${{ github.head_ref }} at job level which is set only in pull requests (https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context)
- Later setting BRANCH env if BRANCH is not already set (push to master) from GITHUB_REF.
I just added this to the GitHub action. Not sure why it was triggering
|
Ah sorry I missed it, I should have caught it. I will make sure it's getting populated with the same value as in travis. |
Let me look into it more. |
Because in the current script |
btw, I just added a workflow for the UI repo based on |
Updated the PR using setup-node@v2 which works now. Also the BRANCH is populating properly now. Only issue which is remaining is what if the contributor creates PR from their fork's master branch. We can solve this by following either of following:
|
Signed-off-by: Ashmita Bohara <[email protected]>
Signed-off-by: Ashmita Bohara <[email protected]>
Signed-off-by: Ashmita Bohara <[email protected]>
Signed-off-by: Ashmita Bohara <[email protected]>
Signed-off-by: Ashmita Bohara <[email protected]>
This has been resolved by setting an environment variable DOCKERHUB_LOGIN to true iff docker login step succeed (which will not happen in case of PR). And docker push will only happen when DOCKERHUB_LOGIN is true. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost there
- name: Export BRANCH variable if undefined | ||
run: | | ||
echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
if: env.BRANCH == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when would this not be null? It's not a std env var in GH actions: https://docs.github.com/en/free-pro-team@latest/actions/reference/environment-variables#default-environment-variables
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First, we are setting BRANCH env variable in the job level
env:
BRANCH: ${{ github.head_ref }}
${{ github.head_ref }} will be only set in case of Pull requests (https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#github-context)
Hence when we push to master (merge PR), env.BRANCH will be null, in which case we are picking from GITHUB_REF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the PR to make the steps more self-explanatory.
Signed-off-by: Ashmita Bohara <[email protected]>
I think this is what is happening, in Makefile build-all-in-one looks for BUILD_INFO which inturn looks for GIT_CLOSEST_TAG which isn't getting evaluated properly due to fetch-depth set to 1 while cloning the repo by GitHub action.
|
we'll need to fix this because BUILD_INFO is important to include in the binaries. |
Signed-off-by: Ashmita Bohara <[email protected]>
Signed-off-by: Ashmita Bohara <[email protected]>
This has been resolved. |
Signed-off-by: Ashmita Bohara <[email protected]>
|
||
- name: Export BRANCH variable for pull_request event | ||
run: | | ||
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better for debugging to print the derived value
echo "BRANCH=${GITHUB_HEAD_REF}" >> $GITHUB_ENV | |
export BRANCH=${GITHUB_HEAD_REF} | |
echo "we are on branch=$BRANCH" | |
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look great! Minor potential future improvements:
- echo value of BRANCH
- move docker login steps and BRANCH steps into their own local actions (but only if we need to reuse them elsewhere)
Thank you @yurishkuro for the constant help. After the PR I was expecting one dockerhub image upload after the PR was merged but something looks wrong somewhere in the script. I can see env variables are populated correctly
But somehow it still skipped the upload to dockerhub
I will look into it more. |
…ectors (#2657) * add metrics that show agent connection collector status Signed-off-by: WalkerWang731 <[email protected]> * update comment Signed-off-by: WalkerWang731 <[email protected]> * exec make fmt Signed-off-by: WalkerWang731 <[email protected]> * simplify function and add testing relevant code in the builder_test.go Signed-off-by: WalkerWang731 <[email protected]> * add comment in connect_metrics.go Signed-off-by: WalkerWang731 <[email protected]> * simplify code and changed use expvar to show target Signed-off-by: WalkerWang731 <[email protected]> * simplify code and changed use expvar to show target Signed-off-by: WalkerWang731 <[email protected]> * exec make fmt Signed-off-by: WalkerWang731 <[email protected]> * Fix collector panic due to sarama sdk returning nil error (#2654) Signed-off-by: luhualin <[email protected]> Co-authored-by: luhualin <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix flaky tbuffered server test (#2635) * Fix flaky tbuffered server test Signed-off-by: Pavel Kositsyn <[email protected]> * Apply suggestions from code review - more readable comments Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Pavel Kositsyn <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add github actions for integration tests (#2649) * Add github action for jaeger integration tests Signed-off-by: Ashmita Bohara <[email protected]> * Create separate workflow for each integration test Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Clean-up GH action names (#2661) Signed-off-by: WalkerWang731 <[email protected]> * Fix for failures in badger integration tests (#2660) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add protogen validation test (#2662) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add github action for jaeger all-in-one image (#2663) * Add github action for jaeger all-in-one image Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Make steps self-explantory Signed-off-by: Ashmita Bohara <[email protected]> * Fix git tags issue Signed-off-by: Ashmita Bohara <[email protected]> * Fix ES integration test Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update comment that looks confusing during builds Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Use GitHub actions based build badges Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix and minor improvements to all-in-one github action (#2667) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix docker login issue with all-in-one build (#2668) * Fix docker login issue with all-in-one build Signed-off-by: Ashmita Bohara <[email protected]> * Fix docker login issue with all-in-one build Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix issue with all-in-one build (#2669) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update cmd/agent/app/reporter/connect_metrics.go accept suggestions Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update cmd/agent/app/reporter/connect_metrics.go accept suggestions Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * simplify the code that remove ConnectMetricsParams{} and integrate ConnectMetrics{} Signed-off-by: WalkerWang731 <[email protected]> * simplify the code that remove ConnectMetricsParams{} and integrate ConnectMetrics{} Signed-off-by: WalkerWang731 <[email protected]> * merage from the lastest master branch and exec make fmt Signed-off-by: walker.wangxy <[email protected]> * add comment on ConnectMetrics Signed-off-by: WalkerWang731 <[email protected]> * clear up redundant codes Signed-off-by: WalkerWang731 <[email protected]> Co-authored-by: WalkerWang731 <[email protected]> Co-authored-by: Betula-L <[email protected]> Co-authored-by: luhualin <[email protected]> Co-authored-by: Pavel Kositsyn <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Ashmita <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: walker.wangxy <[email protected]>
…ectors (jaegertracing#2657) * add metrics that show agent connection collector status Signed-off-by: WalkerWang731 <[email protected]> * update comment Signed-off-by: WalkerWang731 <[email protected]> * exec make fmt Signed-off-by: WalkerWang731 <[email protected]> * simplify function and add testing relevant code in the builder_test.go Signed-off-by: WalkerWang731 <[email protected]> * add comment in connect_metrics.go Signed-off-by: WalkerWang731 <[email protected]> * simplify code and changed use expvar to show target Signed-off-by: WalkerWang731 <[email protected]> * simplify code and changed use expvar to show target Signed-off-by: WalkerWang731 <[email protected]> * exec make fmt Signed-off-by: WalkerWang731 <[email protected]> * Fix collector panic due to sarama sdk returning nil error (jaegertracing#2654) Signed-off-by: luhualin <[email protected]> Co-authored-by: luhualin <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix flaky tbuffered server test (jaegertracing#2635) * Fix flaky tbuffered server test Signed-off-by: Pavel Kositsyn <[email protected]> * Apply suggestions from code review - more readable comments Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: Pavel Kositsyn <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add github actions for integration tests (jaegertracing#2649) * Add github action for jaeger integration tests Signed-off-by: Ashmita Bohara <[email protected]> * Create separate workflow for each integration test Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Clean-up GH action names (jaegertracing#2661) Signed-off-by: WalkerWang731 <[email protected]> * Fix for failures in badger integration tests (jaegertracing#2660) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add protogen validation test (jaegertracing#2662) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Add github action for jaeger all-in-one image (jaegertracing#2663) * Add github action for jaeger all-in-one image Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Feedbacks changes Signed-off-by: Ashmita Bohara <[email protected]> * Make steps self-explantory Signed-off-by: Ashmita Bohara <[email protected]> * Fix git tags issue Signed-off-by: Ashmita Bohara <[email protected]> * Fix ES integration test Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update comment that looks confusing during builds Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Use GitHub actions based build badges Signed-off-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix and minor improvements to all-in-one github action (jaegertracing#2667) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix docker login issue with all-in-one build (jaegertracing#2668) * Fix docker login issue with all-in-one build Signed-off-by: Ashmita Bohara <[email protected]> * Fix docker login issue with all-in-one build Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Fix issue with all-in-one build (jaegertracing#2669) Signed-off-by: Ashmita Bohara <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update cmd/agent/app/reporter/connect_metrics.go accept suggestions Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * Update cmd/agent/app/reporter/connect_metrics.go accept suggestions Co-authored-by: Yuri Shkuro <[email protected]> Signed-off-by: WalkerWang731 <[email protected]> * simplify the code that remove ConnectMetricsParams{} and integrate ConnectMetrics{} Signed-off-by: WalkerWang731 <[email protected]> * simplify the code that remove ConnectMetricsParams{} and integrate ConnectMetrics{} Signed-off-by: WalkerWang731 <[email protected]> * merage from the lastest master branch and exec make fmt Signed-off-by: walker.wangxy <[email protected]> * add comment on ConnectMetrics Signed-off-by: WalkerWang731 <[email protected]> * clear up redundant codes Signed-off-by: WalkerWang731 <[email protected]> Co-authored-by: WalkerWang731 <[email protected]> Co-authored-by: Betula-L <[email protected]> Co-authored-by: luhualin <[email protected]> Co-authored-by: Pavel Kositsyn <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Ashmita <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: walker.wangxy <[email protected]>
Signed-off-by: Ashmita Bohara [email protected]
Which problem is this PR solving?
This PR adds the build job of all-in-one image to github actions.
Part of #2645
Short description of the changes
To get the branch name we are using github action https://github.com/nelonoel/branch-name which populates env var
BRANCH_NAME
I tried using nodejs official github action (https://github.com/actions/setup-node) instead of calling
scripts/travis/install-ui-deps.sh
but it didn't work and I wasn't able to make it work after several retries. So thought do it in the same way how we do in travis for now.