devcontainers / features

A collection of Dev Container Features managed by Dev Container spec maintainers. See https://github.com/devcontainers/feature-starter to publish your own
https://containers.dev/features
MIT License
924 stars 377 forks source link

update python to fetch python prebuilt binaries from `actions/python-versions` #75

Open joshspicer opened 2 years ago

joshspicer commented 2 years ago

We are planning to collaborate with the actions team and their effort to prebuilt binaries (eg https://github.com/actions/python-versions)

Starting with python, teach our feature to first attempt to pull the appropriate binary from this repo, and if that fails fallback to build from src (same behavior as current).

joshspicer commented 2 years ago

cc/ @jungaretti @samruddhikhandale

Chuxel commented 2 years ago

Just as a FYI - This is some code I wrote to do this install.

https://github.com/Chuxel/devcontainer-features/blob/main/devcontainer-features/features/python/bin/acquire#L16-L37

The thing I didn't do is parse the manifest file they have already to get the available versions. However, I did do that in the "Devpacks" prototype I wrote in Go. I generalized the code there so I could reuse it for Node and other things as well.

https://github.com/Chuxel/devpacks/blob/main/devpacks/internal/common/actions/version_manifest.go ...and... https://github.com/Chuxel/devpacks/blob/main/devpacks/internal/buildpacks/cpython/cpython_builder.go#L100-L119

I think it would be good to generally use the Actions builds where we can since it does reduce the number of total dependencies for these features.

samruddhikhandale commented 1 year ago

ℹ️ The prebuilt binaries are available only for these distros 👇

image

In our case, only for ubuntu. Looks like these will only be useful for Ubuntu, but good improvement nonetheless 🤔

Chuxel commented 1 year ago

Yes, which is a good start - but I'd suggest connecting with the Actions folks to see if we can increase coverage. Largely the steps are the same to build Debian 10/11, etc. (I believe @jkeech was thinking about whether some of the same folks could get involved here as well.)