-
Notifications
You must be signed in to change notification settings - Fork 107
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
CICD Improvements #101
CICD Improvements #101
Conversation
Unfortunately, it's not observable in CI and.or for developers and maintainers. So I gave a try of adding a report to CI... To create a proper report, one needs to As you can see if you look inside -- this fails .. why ? As
while this is annoying, it took me again to luigi to see how they dealt with it.
codecov is free for public projects, and from what I can tell can integrate easily, "solves" this issue, and provide with some quite cool visibility features built into github - https://docs.codecov.com/docs/github-checks @flaviuvadan - I'd like to give |
@flaviuvadan - for some reason I can't mention https://github.com/hirosassa ; can you please add him to the discussion ? |
|
Oh, this is great! I'll take a look about failure CI. |
(1) coverage combine fixed I've added a solution for the https://github.com/argoproj-labs/hera-workflows/runs/5456858785?check_suite_focus=true (2) next tasks and wrap up
I'd like to consolidate hera's CICD into I've already added a https://github.com/argoproj-labs/hera-workflows/runs/5456863640?check_suite_focus=true These artifacts can be uploaded to Such a change will also require a - (2.1) publish:
needs: [coverage]
runs-on: ubuntu-latest
if: "success() && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master')" (2.2) change of the on:
push:
branches:
- main
pull_request: {} What say ya ? |
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.
Thanks for the great implementation! I added a few comments.
setup.cfg
Outdated
[coverage:run] | ||
relative_files = True | ||
source = | ||
src/hera |
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.
@harelwa As we discussed following thread about the configuration file,
#93 (comment)
I disagree with putting the configuration of coverage and pytest separately (both are test related configs).
I prefer putting the both configuration on setup.cfg or tox.ini.
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.
yep. and tox.ini indeed has pytest and coverage configuration. this is a left over. thanks for pointing it out. removed.
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.
👍
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.
this deletion actually fixed the combine
! the combined result before the deletion was 0%
😖 . thank you @hirosassa for catching this
Co-authored-by: hirosassa <[email protected]>
@@ -3,7 +3,7 @@ name: Hera PR build | |||
on: pull_request | |||
|
|||
jobs: | |||
hera-pr-build: |
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.
Is the job name representative of the distribution that is going to be built? 🤔
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.
I'm not sure I understand - by distribution you mean linux ?
Is this question maybe related to #101 (comment) ?
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.
Yes, thank you for clarifying! 🙂
.github/workflows/hera_pr.yaml
Outdated
- name: upload build artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pypi-build-arts | ||
path: .tox/dist |
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.
This seems to publish the constructed distributions as artifacts. To be clear, these are different than the actually published package, correct?
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.
Not quite. If we consolidate to a single GH workflow like I suggested, the build
( and test ) job will run as a dependency of publish
job on push to main
as well ( see more in #101 (comment) ), and thus provide us with the necessary Distribution builds ( wheels ) - As you can see Distribution builds added to setup.py
are OS
+ Py
version specific.
HOWEVER ! what's usually done, is building also
a py-none-any
wheel + tar.gz
and publishing it as well ( like hera
publishes now ), e.g. ( from https://pypi.org/project/pydantic/ )
.github/workflows/hera_pr.yaml
Outdated
- name: upload coverage files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage-data | ||
path: ".tox/.coverage.*" |
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.
Does the publication of coverage files allow one to construct a test coverage GitHub badge? I am a bit unfamiliar with the necessary setup of coverage so I am very excited this is added, and I would love to see the report on the main repo README! I must say a direct thank you here, as a comment, for the efforts 🚀
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.
With pleasure.
Yes, we are definitely going for a n honorable shield.
See coverage
in #101 (comment)
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.
Great 👍
.github/workflows/hera_pr.yaml
Outdated
- name: get pypi build arts | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: pypi-build-arts | ||
path: dist | ||
|
||
- name: list pypi build arts | ||
run: | | ||
ls -la dist/ | ||
|
||
- name: install twine | ||
run: | | ||
python -m pip install --upgrade twine | ||
|
||
- name: Check build | ||
run: | | ||
twine check dist/* |
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.
This is a check of the built distribution published via the PR, correct?
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.
EDITED
Yes. It's not published though. It's uploaded, and then downloaded in publish
job, where it will be published if event is push to main ( change not pushed yet ) this is related to #101 (comment)
This looks awesome 🙂 I left some questions mostly to clarify my own understanding of the contribution. |
I still think there's a lot of value in first publishing to the Test PyPI as it ensures the whole installation and usage workflow works as expected. I am open to be convinced of this not being the case, though. I recall an issue in which a broken Hera package was published - the publication step and tests were successful because of accessibility to Hera via the editable mode, but the installed package from PyPI was broken because of some |
Oh, another question if I may - does the consolidation in a single GHA workflow file support differentiation between PRs and |
@hirosassa do you think we should merge this first and then #94, maybe? I wonder what's the best order and mix of PRs that minimizes the effort you and @harelwa need to put in to merge these (due to conflicts). |
Hi @flaviuvadan
If you recall, I was the one to point the I'll try and explain why publishing to Test PyPi is an overhead with the CI flows suggested in this As we are using having said that - of course we can add such a job / step if you are still not comfortable with that; it will do no harm, of course. What I did want to to use Test PyPi is to "test" the real publish flow in single GH workflow in this PR ( more below; it's not pushed yet )
(1) If we wish to add a There are a few options for the
(2) Indeed. I provided a snippet for how it's done in #101 (comment) (2.1) + (2.2)
I tend to agree it would be wiser to merge this PR first |
1f29b5a
to
d41824f
Compare
409c72f
to
f0122aa
Compare
d9087ff
to
a14f862
Compare
Hi @flaviuvadan + @hirosassa I think we are pretty much done here. Here are the final leftovers:
Thanks, Harel |
299b492
to
170b229
Compare
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 your great contribution.
question do you want to add windows-latest to the os matrix ?
I think it is unnecessary because Argo
and Hera
is not running on Windows and Windows has WSL
currently, IMO.
.github/workflows/hera_pr.yaml
Outdated
- name: upload coverage files | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage-data | ||
path: ".tox/.coverage.*" |
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.
Great 👍
Co-authored-by: hirosassa <[email protected]>
Hi @flaviuvadan - Handing this over to you as all remaining tasks require maintainer permissions, access to secrets etc. As for the merge process to Integrate as is -> [ it will ] publish to Harel |
Thank you for the efforts @harelwa 🙂 I was on vacation for a week and am just getting back! I am going to merge this PR today and add the necessary secrets. |
Hi @flaviuvadan I see the unfortunate failures. Following - https://stackoverflow.com/questions/59451069/binary-wheel-cant-be-uploaded-on-pypi-using-twine https://peps.python.org/pep-0513/#rationale I see I'll give it a try |
Thank you for being on top of this, @harelwa! I started reading about |
Hi @flaviuvadan - The immediate fix with minimal changes is to not publish the platform wheels. You can achieve this by removing / commenting out the upload step in https://github.com/argoproj-labs/hera-workflows/blob/main/.github/workflows/cicd.yaml#L60 Then only As for repairs etc. -- perhaps for later -- When trying to >$ auditwheel repair ./tox/dist/hera_workflows-2.2.1-cp39-cp39-linux_x86_64.whl
INFO:auditwheel.main_repair:Repairing hera_workflows-2.2.1-cp39-cp39-linux_x86_64.whl
INFO:auditwheel.main_repair:This does not look like a platform wheel as for the discussion in pypa/auditwheel#247 -- a bit odd to me as From what I can see What do you think ? |
I agree with the proposed approach to comment out the upload steps for now! Let's do that, and then investigate how we can introduce |
great. will you take care of it or you'd rather have me open a PR ? |
Hi, apologies for jumping in! Does
And testing a bit, everything looks good: $ sh -c 'pip3 install wheel && pip3 install hera-workflows' | grep hera_workflows # Apple M1
Downloading hera_workflows-2.2.1-py3-none-any.whl (41 kB)
$ docker run --rm -it --platform=linux/x86-64 python:3.7 sh -c 'pip3 install wheel && pip3 install hera-workflows' | grep hera_workflows
Downloading hera_workflows-2.2.1-py3-none-any.whl (41 kB)
$ docker run --rm -it --platform=linux/x86-64 python:3.9 sh -c 'pip3 install wheel && pip3 install hera-workflows' | grep hera_workflows
Downloading hera_workflows-2.2.1-py3-none-any.whl (41 kB)
$ docker run --rm -it --platform=linux/amd64 python:3.7 sh -c 'pip3 install wheel && pip3 install hera-workflows' | grep hera_workflows
Downloading hera_workflows-2.2.1-py3-none-any.whl (41 kB)
$ docker run --rm -it --platform=linux/amd64 python:3.9 sh -c 'pip3 install wheel && pip3 install hera-workflows' | grep hera_workflows
Downloading hera_workflows-2.2.1-py3-none-any.whl (41 kB) -- I think this might also explain what @harelwa saw with: >$ auditwheel repair ./tox/dist/hera_workflows-2.2.1-cp39-cp39-linux_x86_64.whl
INFO:auditwheel.main_repair:Repairing hera_workflows-2.2.1-cp39-cp39-linux_x86_64.whl
INFO:auditwheel.main_repair:This does not look like a platform wheel |
Thank you @JacobHayes Yes. I agree. I think we can drop the platform wheels all together. |
About
this is a work in progress; it aims to check feasibility for further discussion
Following #93, further improve CI + CD
Tasks
py vers
XOS
coverage filespy vers
XOS
coverage filessetup.py
none-any
build just in case and publish itsdist
build (.tar.gz
) build for publishingpy ver
+os
)py3-none-any
wheel +sdist
( .tar.gz )gh
workflowtest / build
job as a pre-publishing jobjobs
rather than between different workflowspublish
job ( similar to exiting one )if:
topublish
job.github/workflows/hera_build_and_publish.yaml
.github/workflows/hera_pr.yaml
->.github/workflows/cicd.yaml
( or .. )hera_build_and_publish.yaml
->cicd.yaml
( or .. ) inREADME.md
pypi-test
for the purpose of validating entirepublish
job ( seepublish
job failure )pypi-test
with upload topypi
inpublish
jobcoverage
badge to be introduced in this PR ( or propose a different solution )inspiration credit
https://github.com/samuelcolvin/pydantic/blob/master/.github/workflows/ci.yml