Skip to content
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

Build and release wheel packages #1723

Merged
merged 8 commits into from
Aug 23, 2022
Merged

Build and release wheel packages #1723

merged 8 commits into from
Aug 23, 2022

Conversation

gtristan
Copy link
Contributor

@gtristan gtristan commented Aug 17, 2022

This updates the CI config to:

  • build x86_64 wheel packages on each update of 'master', which can be downloaded as Action artifacts. The packages contain release binaries of BuildBox casd/fuse/run-bubblewrap.
  • build sdist and wheel packages on each release tag, test the wheels, and upload them to Test PyPI at https://test.pypi.org/project/BuildStream/

Before actually landing this, we need to make some changes:

Fixes #1712

@gtristan
Copy link
Contributor Author

This branch is a cleanup of #1714 and addresses some of the last review comments (because @ssssam is on vacation for the rest of the week).

This effectively replaces #1714

@gtristan
Copy link
Contributor Author

We recently changed the name of the binaries generated by buildbox-integration in https://gitlab.com/BuildGrid/buildbox/buildbox-integration/-/merge_requests/5

So, we are currently waiting for:

  • A new tag on buildbox-integration repo, so that the new binary name gets published
  • Me to apply the local change I'm holding onto which changes the binary permalink we download binaries from
  • A pipeline to pass here with the new change applied

And then we can finally release and tag and see automatically generated and published wheels which include buildbox.

@ssssam
Copy link
Contributor

ssssam commented Aug 22, 2022

The generated wheels cannot build gnome-build-meta due to #1733. We should resolve that before final release.

@ssssam
Copy link
Contributor

ssssam commented Aug 22, 2022

Here's a patch that fixes buildbox-casd operation with minimal churn: c529c61

We could alternatively simplify this branch by removing all the _get_host_tool_internal() helpers and setting os.environ["PATH"] on startup to include os.path.join(_site.subprojects, "buildbox").

@gtristan
Copy link
Contributor Author

Here's a patch that fixes buildbox-casd operation with minimal churn: c529c61

We could alternatively simplify this branch by removing all the _get_host_tool_internal() helpers and setting os.environ["PATH"] on startup to include os.path.join(_site.subprojects, "buildbox").

I've applied the patch to this branch thanks.

I think I also like the patch this way because the PATH setting resides in codepaths which are clearly tied to launching buildbox binaries, whereas globally setting PATH at startup would have to live in a disconnected/unrelated codepath.

Global environment setting was unavoidable for setting GRPC_ENABLE_FORK_SUPPORT in cfe3d71 (which is unfortunatly confusing since the generated entrypoint is nowhere close to grpc usage/initialization).

BuildBox is not widely distributed in binary form yet. For convience,
add a mechanism to bundle prebuilt binaries in the Python wheel
packages.

Setting BST_BUNDLE_BUILDBOX=1 when setup.py runs, causes the bundled
binaries to be included in the binary package. Its up to the packager
to make appropriate binaries available in
`src/buildstream/subprojects/buildbox/`.

BuildStream will search the package subprojects/ dir when looking for
BuildBox binaries on the host in all cases, prioritizing any bundled
binaries above other ones on the host.

Related to #1712
We are going to build and publish more than just docs, so add _docs
to these job names to make it clear.
This updates the CI config to:

  * build wheel packages in pre-merge CI
    * download BuildBox release binaries to build the wheels
    * these can be downloaded as action artifacts
  * test built wheel packages in pre-merge CI
  * build sdist and wheel packages on each release tag, and upload
    them to Test PyPI at https://test.pypi.org/project/BuildStream/

The new workflows are based on examples at
https://cibuildwheel.readthedocs.io/en/stable/setup/, avoiding use of
the GitHub Actions from `pypa/*` as these are not permitted to be used
in apache/buildstream project.
PyPI and Pip use the PEP440 version standard, which uses explicit
'.dev', '.a', '.b' and '.rc' suffixes to mark "unstable" releases.

BuildStream uses the even/odd convention. When running `pip install`
we want Pip to prefer a stable 2.0.0 release over an unstable 2.1.0
release. To make this work, all unstable releases now have a .dev0
suffix automatically added in setup.py, e.g. `2.1.0.dev0`.

This is necessary for us to fully automate releases to PyPI from GitHub
Actions.
Otherwise, buildbox-casd falls back to its HardLinkStager backend
which does not provide sufficient capabilities to build
gnome-build-meta.

See: #1733
…link

Since renaming the binary tarballs to be more descriptive upstream,
we need to fix the download link where we download the binary tarballs.

See: https://gitlab.com/BuildGrid/buildbox/buildbox-integration/-/merge_requests/5
@gtristan gtristan merged commit dd29653 into master Aug 23, 2022
ssssam added a commit to ssssam/buildstream that referenced this pull request Aug 23, 2022
Fixes the following error in "Merge actions" workflow:

    The workflow is not valid. .github/workflows/merge.yml (Line: 46, Col: 12): Job 'publish_docs' depends on unknown job 'build'.

This is a regression introduced in apache#1723
@juergbi juergbi mentioned this pull request Feb 21, 2023
@cs-shadow cs-shadow deleted the tristan/build-wheels branch February 22, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distribute buildstream Wheel packages that contain BuildBox
2 participants