Skip to content

Conversation

andife
Copy link
Member

@andife andife commented Aug 2, 2024

Description

This pull request should be the start of a pipeline (current status of the considerations under #6246) that automatically generates a whls after tagging, signs it and publishes it directly to Pypi to improve supply chain security. As this is all too much at once, the changes will be introduced and tested gradually.

Changes related to this PR:
Reusable Workflows are used to merge the individual OS release builds together (we need one process as we want to have all artifacts in one pipeline, so there is not need to download them manuelly). The workflows are currently not really "reusable", as we more or less use pypi creditionals in the workflow, among other things. I reused our testpypi weekly repo as I didn't want to change our behavoir for pypi and testpypi.

Maybe it would make sense to adapt the process right away so that you can trigger our "Weekly" manually via the Github interface for testing and don't have to wait a week ;-)

Key points for the review:

  • How do we want to configure concurrency
  • What concurrency-groups do we need?
  • Where do we need "cancel-in-progress"?

Not part of the pull request:

  • Extract publish whl to pypi/testpyp
  • Introduce trusted publishing
  • ...

Motivation and Context

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@andife andife requested a review from a team as a code owner August 2, 2024 19:59
Copy link

codecov bot commented Aug 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 57.19%. Comparing base (83194ed) to head (ab1ecc9).
Report is 89 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6277      +/-   ##
==========================================
+ Coverage   56.95%   57.19%   +0.24%     
==========================================
  Files         506      507       +1     
  Lines       30467    31257     +790     
  Branches     4592     4663      +71     
==========================================
+ Hits        17353    17879     +526     
- Misses      12285    12531     +246     
- Partials      829      847      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

andife added 12 commits August 2, 2024 22:17
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@andife andife changed the title WIP: introduce reusable workflow WIP: combine different release pipelines by the use of reusable workflows Aug 10, 2024
@andife andife changed the title WIP: combine different release pipelines by the use of reusable workflows Combine different release pipelines by the use of reusable workflows Aug 13, 2024
@andife andife requested a review from justinchuby August 13, 2024 04:54
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@justinchuby justinchuby added this to the 1.18 milestone Aug 16, 2024
@justinchuby justinchuby added the topic: better engineering Improve engineering quality of the project label Aug 22, 2024
Copy link
Member

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andife For the create release workflow, is it possible to skip the publish step in pull requests? Should we only allow it when the trigger is schedule?

andife and others added 2 commits August 23, 2024 05:12
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
andife added 3 commits August 23, 2024 05:59
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@andife
Copy link
Member Author

andife commented Aug 23, 2024

@andife For the create release workflow, is it possible to skip the publish step in pull requests? Should we only allow it when the trigger is schedule?

Both variants would be ok for me.

I have added conditions in this regard. Could they be simplified to really only execute it on schedule? On the other hand, you might still have the download step separate?

I at schedule we are creating a preview build. I am convinced that it also makes sense to be able to trigger a preview build manually and that the packages are then also pushed to https://pypi.org/project/onnx-weekly/ with the current date. But this I will/would not include into this PR

@andife andife self-assigned this Aug 23, 2024
@andife andife requested a review from justinchuby August 23, 2024 06:12
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@andife
Copy link
Member Author

andife commented Aug 23, 2024

Note for clarification: Trusted Publishing does not work for forks (as wanted)


Error: Trusted publishing exchange failure: 
OpenID Connect token retrieval failed: GitHub: missing or insufficient OIDC token permissions, the ACTIONS_ID_TOKEN_REQUEST_TOKEN environment variable was unset

The workflow context indicates that this action was called from a
pull request on a fork. GitHub doesn't give these workflows OIDC permissions,
even if `id-token: write` is explicitly configured.

To fix this, change your publishing workflow to use an event that
forks of your repository cannot trigger (such as tag or release
creation, or a manually triggered workflow dispatch).

Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
@andife andife enabled auto-merge August 23, 2024 17:43
@andife andife added this pull request to the merge queue Aug 23, 2024
Merged via the queue into onnx:main with commit d45ad99 Aug 23, 2024
39 checks passed
@andife andife deleted the 20240802_reuse_work branch August 23, 2024 18:16
github-merge-queue bot pushed a commit that referenced this pull request Aug 26, 2024
### Description
After the release-pipeline upgrade
(#6277)
the publishing the weekly does not work any more as the secrets are not
available at the resuable workflows (
https://github.com/onnx/onnx/actions/runs/10551283959/job/29228497156 )

Link for the option I used for the secrets:

https://github.blog/changelog/2022-05-03-github-actions-simplify-using-secrets-with-reusable-workflows

### Motivation and Context

In my opinion, we no longer need these secrets at the end. 

In the future, the publishing of the Onnx weekly builds will be solved
via “trusted publishing” outside the individual OS release pipelines.
This is already included in create_release.yml. Currently, the previous
weeklys are published at pypi.org, in the test via trusted publishing at
test.pypi.org

After a successful schedule test (next Monday), we could adjust the
publishing. a) e.g. throw out the upload steps with twine and adjust the
target of separate steps... b) or leave it as it is for now...

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
linshokaku pushed a commit to linshokaku/onnx that referenced this pull request Oct 2, 2024
…nnx#6277)

### Description
<!-- - Describe your changes. -->

This pull request should be the start of a pipeline (current status of
the considerations under onnx#6246) that
automatically generates a whls after tagging, signs it and publishes it
directly to Pypi to improve supply chain security. As this is all too
much at once, the changes will be introduced and tested gradually.

Changes related to this PR:
Reusable Workflows are used to merge the individual OS release builds
together (we need one process as we want to have all artifacts in one
pipeline, so there is not need to download them manuelly). The workflows
are currently not really "reusable", as we more or less use pypi
creditionals in the workflow, among other things. I reused our testpypi
weekly repo as I didn't want to change our behavoir for pypi and
testpypi.

Maybe it would make sense to adapt the process right away so that you
can trigger our "Weekly" manually via the Github interface for testing
and don't have to wait a week ;-)

#### Key points for the review:
* How do we want to configure concurrency
* What concurrency-groups do we need?
* Where do we need "cancel-in-progress"?

#### Not part of the pull request:
* Extract publish whl to pypi/testpyp
* Introduce trusted publishing
* ...

### Motivation and Context
* see onnx#6246

---------

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Co-authored-by: Justin Chu <justinchuby@users.noreply.github.com>
Signed-off-by: Linsho Kaku <linsho@preferred.jp>
linshokaku pushed a commit to linshokaku/onnx that referenced this pull request Oct 2, 2024
### Description
After the release-pipeline upgrade
(onnx#6277)
the publishing the weekly does not work any more as the secrets are not
available at the resuable workflows (
https://github.com/onnx/onnx/actions/runs/10551283959/job/29228497156 )

Link for the option I used for the secrets:

https://github.blog/changelog/2022-05-03-github-actions-simplify-using-secrets-with-reusable-workflows

### Motivation and Context

In my opinion, we no longer need these secrets at the end.

In the future, the publishing of the Onnx weekly builds will be solved
via “trusted publishing” outside the individual OS release pipelines.
This is already included in create_release.yml. Currently, the previous
weeklys are published at pypi.org, in the test via trusted publishing at
test.pypi.org

After a successful schedule test (next Monday), we could adjust the
publishing. a) e.g. throw out the upload steps with twine and adjust the
target of separate steps... b) or leave it as it is for now...

Signed-off-by: Andreas Fehlner <fehlner@arcor.de>
Signed-off-by: Linsho Kaku <linsho@preferred.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: better engineering Improve engineering quality of the project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants