-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ci: force install/link bazelisk package in macos dependency setup #10357
ci: force install/link bazelisk package in macos dependency setup #10357
Conversation
Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
According to this PR that is pending merge, this is the set of tools installed in the latest image we are using: actions/runner-images#538 (notice bazel, bazelisk, and cmake are already installed, the former two likely not via the same homebrew tap we are) |
Another solution is to just take whatever bazelisk comes with the image, thoughts? (though it is not linked to |
Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
ci/mac_ci_setup.sh
Outdated
then | ||
echo "Failed to install $1" | ||
brew install "$1" | ||
if ! brew link --overwrite "$1"; then |
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.
Is this necessary if we are unlinking below?
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.
this overwrite was added in order to overwrite existing bazelisk
symlinks that homebrew complained about (see the output here before the forceful link: https://dev.azure.com/cncf/envoy/_build/results?buildId=33967&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=7d499b5d-1d92-5096-7919-3c7f8065da78&l=619), this change could potentially actually supercede the unlink of bazel
so this could be the only change needed (will try it out)
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.
So, both are required, see this build: https://dev.azure.com/cncf/envoy/_build/results?buildId=33982&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=7d499b5d-1d92-5096-7919-3c7f8065da78&l=619
We could do a brew install --force
on all installs to maybe not have to unlink bazel, though that may have unintended consequences?
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 should work, i'll leave it with the --force
unless theres any objections
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.
@sunjayBhatia sorry I didn't catch that bazelisk
was already installed. Per your comment above, why can't we just drop all the bazel related installs in this file?
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.
@junr03 We totally could, but I believe brew install bazelisk
downloads something from somewhere different than brew install bazelbuild/tap/bazelisk
(which is possibly why our script tries to install bazelbuild/tap/bazelisk
in the first place, since there is a check if the packages we want are already installed). If we're cool with staying with what is in the CI image by default that works. However, I don't think if we do that the symlink for bazel
will actually be the bazelisk
executable, so we would need to do some manual overriding of symlinks in that case.
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.
We could also ask the maintainers of the image to install bazelisk
(and bazel
) via the expected upstream tap so this isn't an issue for us as well, seems like at least bazelisk
is not installed in the image via bazelbuild/tap/bazelisk
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.
However, I don't think if we do that the symlink for bazel will actually be the bazelisk executable.
I see, and we would end up using the version of bazel installed in the image instead of the one we would like via bazelisk and .bazelversion.
My overall opinion for this PR is to take bazelisk install out of the normal flow and do what we need to do for bazel/bazelisk separately from the other dep installs. I just don't think we should change how we install all the deps. Now whether this means making sure that bazel is correctly symlinked to bazelisk, or using brew, up to you.
Hopefully the bazelisk link --overwrite should take care of it Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
So bazelisk can overwrite pre-installed bazel Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
- use the bazelisk basic package that is installed already, the check to see if it is installed should always be true so this is like an assertion that bazel is present - unlink bazel - make a link ourselves linking bazelisk to bazel Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]>
just get the path and assert it exists Signed-off-by: Sunjay Bhatia <[email protected]>
/azp run envoy-macos |
Azure Pipelines could not run because the pipeline triggers exclude this branch/path. |
/azp run envoy-macos |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: Sunjay Bhatia <[email protected]>
Signed-off-by: Sunjay Bhatia <[email protected]>
Is this PR causing the MacOS failure here: https://dev.azure.com/cncf/envoy/_build/results?buildId=34096&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=7d499b5d-1d92-5096-7919-3c7f8065da78&l=707 |
There was no code change that is causing that issue to happen in CI, the bump to a new version of the macOS image with new installed software seems to be the cause, see: #10357 (comment) This PR is to address that change |
Ok so it looks from the progression of your commits that:
cc @lizan for a second pair of eyes. I know this is a small change, but I want to make sure that we are using the version of bazel we advertise via bazelisk. |
true, however there are some other files symlinked (or otherwise) on the path that conflict with our new bazelisk install, which is why the
we could do a check for bazel already being installed and a
See the above and this example: https://dev.azure.com/cncf/envoy/_build/results?buildId=34087&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=7d499b5d-1d92-5096-7919-3c7f8065da78&l=735 (bazelisk is linked to bazelisk.js, the install must be via some node modules method?)
Yep, see: https://dev.azure.com/cncf/envoy/_build/results?buildId=34087&view=logs&j=a5e52b91-c83f-5429-4a68-c246fc63a4f7&t=5852bf5a-5a02-52f3-bee8-4fdc90cda9d0&l=22 (I believe invoking bazel causing a download of bazel means we're actually running bazelisk) |
bazelisk might be installed on the new image via |
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.
Alright, I think you have crossed all the Ts and dotted all the Is. Thank you so much!
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 think this is fine. It installs bazelisk and then forces it to be linked as bazel.
Description: move mac ci setup to use envoy's script. I don't see much of a point in keeping a separate script here. For instance, envoyproxy/envoy#10357 updated to fix bazel after CI images broke. Instead of keeping up-to-date we can piggy back on efforts in upstream Envoy. Obviously, if diverging needs evolve we might need a second script in Envoy Mobile that calls the Envoy script, and does additional work. Risk Level: low, CI will let us know if I screwed up. Testing: CI Signed-off-by: Jose Nino <[email protected]>
…0357) Latest mac os images have bazel pre-installed so force install bazelisk and link with overwrite to allow install to succeed Risk Level: Low Testing: N/A Docs Changes: N/A Release Notes: N/A Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]> Signed-off-by: Lizan Zhou <[email protected]>
…voyproxy#10357) Latest mac os images have bazel pre-installed so force install bazelisk and link with overwrite to allow install to succeed Risk Level: Low Testing: N/A Docs Changes: N/A Release Notes: N/A Co-authored-by: Sunjay Bhatia <[email protected]> Co-authored-by: William A Rowe Jr <[email protected]> Signed-off-by: Sunjay Bhatia <[email protected]> Signed-off-by: William A Rowe Jr <[email protected]> Signed-off-by: Lizan Zhou <[email protected]>
Description: move mac ci setup to use envoy's script. I don't see much of a point in keeping a separate script here. For instance, #10357 updated to fix bazel after CI images broke. Instead of keeping up-to-date we can piggy back on efforts in upstream Envoy. Obviously, if diverging needs evolve we might need a second script in Envoy Mobile that calls the Envoy script, and does additional work. Risk Level: low, CI will let us know if I screwed up. Testing: CI Signed-off-by: Jose Nino <[email protected]> Signed-off-by: JP Simard <[email protected]>
Description: move mac ci setup to use envoy's script. I don't see much of a point in keeping a separate script here. For instance, #10357 updated to fix bazel after CI images broke. Instead of keeping up-to-date we can piggy back on efforts in upstream Envoy. Obviously, if diverging needs evolve we might need a second script in Envoy Mobile that calls the Envoy script, and does additional work. Risk Level: low, CI will let us know if I screwed up. Testing: CI Signed-off-by: Jose Nino <[email protected]> Signed-off-by: JP Simard <[email protected]>
Description: Latest mac os images have bazel pre-installed so force install bazelisk and link with overwrite to allow install to succeed
Risk Level: Low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A