-
Notifications
You must be signed in to change notification settings - Fork 20
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
Self-hosted (ghpages) pip archive html file #645
Comments
However, the I.e. curl -H "Accept: application/vnd.github.v3+json" https://github.com/gitapi/repos/FLAMEGPU/FLAMEGPU2/releases Returns a very long json response, which is a list ( The release dictionary includes
Using the This API endpoint returns A Alternatively, the Ie. curl -H "Accept: application/vnd.github.v3+json" https://github.com/gitapi/repos/FLAMEGPU/FLAMEGPU2/releases/tags/v2.0.0-alpha.1 If this output was stored to
This could be used in conjunction with another endpoint to get the list of releases? As a quick POC to verify this does work with gh release asset urls: A file
Then from a system with python 3.9 installed:
or the vis wheel:
However, both wheels can be installed into the same venv at the same time as they have different names, even though they both provide the This is one of the downsides of providing vis and non vis wheels which import the same package name. It might be better to produce a separate
Or if the .html file only contained python 3.8 URIs, then the following error would occur (i.e. what will happen on non x86_64 machines, or python < 3.6, or python > 3.9:
|
Attaching a .html file to a github release as an atrifact is not served in the web browser when viewed, it is downloaded, so can't be used for a (hosted) wheelhouse, so would need to be gh pages. Conda still seems like the better solution overall, given our wheels are not strictly manylinux compliant without dlopen soup. |
I've made a start on this, working in a standalone separate repository for now (so no one accidentally finds it and starts using it before it is "official") https://github.com/ptheywood/FLAMEGPU2-wheelhouse So far I have a script which will fetch upto the last 30 releases and all their artifcacts from teh github api into a json file. Another script is then going to take that json file and dump out the appropriate HTML to disk. CI will then be set up to do that, and commit the result to the gh-pages branch. Once that all works, I'll make it more API friendly so it doesn't hit any rate limits etc, by only finding assets for releases it didn't already know about. We can then either set the workflow to be triggered manually, or be triggered by workflow_dispatch, so once we publush a release (i.e. stop it beign a draft) it will be triggered. |
I now have a pair of working scrtipts. However, changes are needed for vis / non vis build selection, (and cuda selection?) I.e. if I produce While how wheel houses work, its possible to provide a directory strucutre with multiple files. This allows people to query teh full set for explicit versions / just get the default, or to alos have ways to state "give me the latest cuda 11.2" or "give me the latest vis build, regardless of cuda version". Otherwise the python version comparison rules apply, so the latest cuda version, and then .vis is priority over no ".vis" component. The alternative would be to tweak the build / python packaing and ship vis and non vis wheeels together, so one (or both) can be installed. This would need changes to import statements however (off the top of my head), or dlopen magic to make everything a vis build, but only link against the vis dependence if opted in to. |
Now have CI working for single-file wheelhouse, currently hostest at https://ptheywood.uk/FLAMEGPU2-wheelhouse/ for demonstration purposes, but this will not be the final location. (most likely
It is also possible to install specific versions, getting the most "recent" build (i.e. cuda112, vis was specified differntly in alpha builds, which might need to change again in the next rc?)
Or the fully explicit version to get a different cuda / non vis build
Notably this does solve the python selection process, but to avoid vis wheels for the tutorial we will want to separate the vis into it's own html file. Likely the same for the cuda version, as I'm not sure of a way to save "Give me the most recent build which has +cu110 as the build identifier" (I've not looked really though). I.e. people will still need to be pretty specific, unless they just want latest cuda with vis. If we have a tree like follows:
then users can could use one of the following, depending what they want
Alternatively / additionally, we could adjust teh name of the non-vis wheels to include an additional local version identifier component so it is "newer" than the equivalent The local versions we embed to our wheels are also not allowed on pypi / should not be used when publishing "upstream" projects, so we might need to find an alternate way to deal with this in that case. |
Partially implemented the above split wheelhouses to demonstrate it works. ptheywood/FLAMEGPU2-wheelhouse#1 Can install
No way to get a vis or non-vis CUDA X build. With the current single pyflamegpu package that is vis or not vis that doesn't make sense IMO.
Both are grim in their own ways and a decent bit of effort though. |
Paul has setup a CNAME record for re: triggering the workflow on publication of a new release, need to make a PR against the FLAMEGPU2 repo, with a new github action workflow, which on publication of a release uses the gh api to trigger the Could do this with CURL, or the gh cli (though this apparently doesn't return the id of the new run, so have to query again for new runs and wait for it to complete. Roughly the following (given the published event for a repo only fires once)
There is effectivly a race in the above, so the resulting status might be a lie (if the ci was triggered for another reason after the first gh command. |
Slight issue with using gh to trigger a workflow in another repo, the GH_TOKEN generated in the workflow doens't seem to have enough permissions, even when adding write all. Might need some kind of org/account level token instead. If the workflow is in the same repo it works as expected. |
Using a PAT with repo action write scope stored in a secret let the remote dispatch work. However PATS have a default expiration of 30 days, but also get deactivated after a year, so if I create one with a very long duration it will expire if there isn't a new flamegpu2 release for a while. Grand scheme this is OK though, as we will be able to manually trigger it in that case, and I can add a comment to the workflow that would trigger it stating it would need a new PAT creating if it fails prior to re-running the job (or manually triggering the workflow in the other repo) |
If we are going to release on pypi, we will likely only be able to host
pyflamegpu
packages built with a single cuda architecture, which Ideally should be the oldest version with broad support at the time of release. I.e. CUDA 11.2 would be my preference, as this will work with CUDA 11 releases >= 11.2, so wide support. Alternatively CUDA 11.0 for the oldest support, but this does not have forwards compatibility.In some cases,we might want to provide multiple version. Ie CUDA 11.0 (collab) and 11.2 (broader support), as well as in the future CUDA 11.x and CUDA 12.x. In which case we use the python local package version number to embed this, i.e.
+cuda112
for cuda 11.2.We could support users installing these via pip, withtout them being uploaded to pypi by leveraging the github release artifacts, github actions, and github pages.
Users could then install a potential 2.0.0 release built with CUDA 11.2 via:
Or alternatively pre-release versions using the
--pre
flag--no-index
may also be useful in the above commands?This is how pytorch handle pip installation of alternate versions.
As with pip distribution in general, it has downsides re: alterante builds. In this case you cannot ask for the latest pyflamegpu built with CUDA XY, instead you must specify a specific minor version and the local version.
Poetry / other python packaging might also not be able to resolve this if they do not support the -f flag for pip subpackages.
One way to implement this would be:
Some of the following commands may be useful to implemetn this.
Using the
gh
command line tool which is installed into actions by default, we can:get a list of the last
10
releases using:get a json object containing all of the .whl assets for a specific release tag using:
gh release view v2.0.0-alpha --json assets --jq ".assets.[] | select(.name|endswith(\".whl\"))"
For more information, see comments on #605.
The text was updated successfully, but these errors were encountered: