-
Notifications
You must be signed in to change notification settings - Fork 120
Adding Python manifest lib path to LD_LIBRARY_PATH before installing pip #49
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
Conversation
@magnetikonline , thank you for proposing changes! I have a question to clarify - your code will apply
If we want to pass |
Hey @maxim-lobanov - it's a good point. So if you look at my linked issue here: actions/setup-python#131 - you'll see it seems to only effect these initial So personally, we're using self-hosted runners as EC2s baked from AMI's. In those AMIs I'm bootstrapping multiple Python versions - by downloading manually the desired So then, once booted (we only use each runner once then kill it) - a call to the Right now, I only have to tweak Does that make sense? |
What's the status here? I was just setting up self-hosted runners for us and ran into this issue. Unfortunately the workarounds for setting the library path posted elsewhere don't look like they will work for me as the runner setup is injecting some uuids that I can't figure out where they are coming from, so can't preemptively set the path. |
@jbooth-mastery I'd love to see this merged. Out of interest, did you try actions/setup-python#131 (comment) ? Whilst it's a clunky solution, it does prove that what I'm proposing here as a PR should do the job. Sorry @maxim-lobanov - are you able to offer any insight if we can get this merged (and Python manifests rebuilt from it?). |
That's the workaround I was referring to that doesn't work for me because I'm getting a uuid in the path that python is getting unpacked to from tar and I can't find said uuid anywhere else (env var, etc), so I can't pre-seed it into the LD_LIBRARY_PATH. |
cc: @konradpabjan to review this PR |
Hey @magnetikonline First off, thanks for the PR! β€οΈ Due to the nature of self-hosted runners and different settings/configurations, diagnosing and fixing issues with I recall hitting Follow up question, from your logs in the linked issue, it looks like you got passed |
Thanks @konradpabjan for the reply. So I'm not setting What I am doing, is preloading manifests of Python into a baked AMI, so it skips the download of the manifest. This is done by:
I figured all this out by reverse engineering the GitHub cloud runners and some trial and error (from memory!).
Does the above answer your question here? Out of interest, is |
Thanks for the clarification @magnetikonline I did some testing with the steps you provided and it works! A combination of the I think this type of setup would be useful for lots of customers and it provides an alternative way to get
|
Not a problem @konradpabjan π That would be great - I wonder, is it possible to maybe test this with a single manifest release - maybe with a beta/test tag that I can use with the Forgot to mention yesterday - user @rmileskcl had success this way - which is pretty much what this PR will bake into the |
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.
Looks good to me. Thanks for the contribution!
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.
Looks good!
One small suggestion that we can throw in with this. Since this will require a new release for each python version, can we change
echo "Copy Python binaries to hostedtoolcache folder"
to
echo "Copy Python binaries to $PYTHON_TOOLCACHE_VERSION_ARCH_PATH"
I think it would be good to explicitly output where the binaries are being copied to in the setup script
Thanks @brcrista & @konradpabjan Made that suggestion in 62b0db9 - which is good, as it mirrors the Powershell installer message somewhat now:
Oh and sorry, must have been late at night - should have done this work on a branch in my repo clone π€¦ - though I don't think it should matter. |
Thanks for the update @magnetikonline! The correct changes are in, in the end it doesn't matter π Lets merge this in and move forward @maxim-lobanov. I propose we first update just two versions for testing ( |
Great news @konradpabjan - I'll await the merge and test this at our end. Are the manifests re-baked on merge to |
@magnetikonline , it is manual but pretty quick process. |
@maxim-lobanov no need to apologise at all! Just want to be sure I can do my bit to re-test at my end to confirm this PR does in fact do the job it's designed to so π |
Hello @magnetikonline ! We've built Python versions (
|
Hey @MaksimZhukov - just tested against our self hosted runners. The install works great - and pip installs as expected... but... (always a but!). A following step of
So.... I really need to be doing the final step of (as per my previous comment):
.... so, maybe I should just look at setting The other option, maybe the action could be updated to set
So then with |
@magnetikonline , that was I talking about in #49 (comment) |
Yep @maxim-lobanov - fair call, my oversight π But I think you'll need it set in both the manifests and then the Action (the later being for the following steps) - correct? |
I've updated my fork and added the |
Hey @MaksimZhukov - yep that works wonderfully. π If I could add one thing, make the update to And I still think this PR needs to be included - as you can't set |
Thank you for checking, @magnetikonline . Actually, in this case, we can avoid patching of all python packages here. We can just apply
I would leave this decision to @konradpabjan as owner of @konradpabjan could you please revisit this PR one more time? Also a few thoughts about
I guess we can do something like const updatedLibraryPath = `${process.env.LD_LIBRARY_PATH}:${pythonInstallationDir}\dir`
core.exportVariable("LD_LIBRARY_PATH", updatedLibraryPath)
process.env.LD_LIBRARY_PATH = updatedLibraryPath |
Sounds great @maxim-lobanov - agreed, we can do this in the action only as you can mutate
Exactly, as I wrote above - certainly should append to |
@magnetikonline @maxim-lobanov Thank you for testing and the deep investigation! We can go ahead and try to implement this in Any potential changes can first go to |
Hello @magnetikonline ! Would you like to provide a pull request to the actions/setup-python repository? If you don't have a chance to do this, our team will take care of it in a few weeks. |
Hello @MaksimZhukov - yeah I reckon I can give that a good. Can hopefully scrape together some free time this weekend. cc: @maxim-lobanov |
Done π Hopefully this meets the brief @MaksimZhukov / @maxim-lobanov - quite nice to write this, haven't done any TypeScript before - think I need to dig in a little more on my next pet project - very enjoyable. |
Closing this out - as we've fixed it within the action itself at: actions/setup-python@878156f |
Hello π
Related to actions/setup-python#131 - this change to the nix installer should help with the setup/install of
pip
for a new manifest by appending another library path.With this in place, the shared libraries will be found upon install of the manifest by the
actions/setup-python
action.The only downside here, would need to re-bake every manifest archive.