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

chore: deprecate tox in favor of act #29382

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

chore: deprecate tox in favor of act #29382

wants to merge 4 commits into from

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jun 26, 2024

Set up act as a mean to run GitHub Actions locally as an alternative to tox.

  • deprecating tox
  • documenting how to use act

@github-actions github-actions bot added the github_actions Pull requests that update GitHub Actions code label Jun 26, 2024
@@ -6,16 +6,16 @@
# pip-compile-multi
#
-r base.txt
-e file:.
-e file:///Users/max/code/superset
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
-e file:///Users/max/code/superset
-e file:.

Copy link
Member Author

Choose a reason for hiding this comment

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

oh yeah that's a pip-compile-multi bug AFACT, it shows randomly every 2-4 runs for me... Not sure if it's been reported.

@villebro
Copy link
Member

Interesting, I tried this a few years ago iIRC, and it was horribly buggy. Will take it for a new spin..

@betodealmeida
Copy link
Member

Interesting, I tried this a few years ago iIRC, and it was horribly buggy. Will take it for a new spin..

Same, I tried using it in 2020 and it was unusable! It'll be good to have a way of running the CI locally, assuming the runs are representative.

@rusackas
Copy link
Member

rusackas commented Jul 1, 2024

Same, I could never get act to actually work. I'll pull/test this, and if I can have luck, I'll merge it AND buy you a beer.

@mistercrunch
Copy link
Member Author

Let me try and make sure most workflows that someone might want to run locally actually runs through.

@mistercrunch
Copy link
Member Author

@rusackas seems like --secret and --container-architecture fixed a lot of things for me, not sure how much you pushed but I have to admit I haven't tried anywhere close to all the workflows yet. Actually many of the workflows don't make sense to run locally...

act --job {workflow_name} --secret GITHUB_TOKEN=$GITHUB_TOKEN --event pull_request --container-architecture linux/amd64

@rusackas
Copy link
Member

rusackas commented Jul 1, 2024

As we discussed on Zoom, I'm still having a hard time getting any of this to work...

  • it is having trouble if you've done npm install in superset-frontend, cypress-base, docs, superset-websocket etc, as it finds various travis.yml files and gets confused.
  • even if you git clean -fdx to get back to a cleared repo, I still get issues. * it might be having some trouble if your git origin is https (tbd)

Hopefully there's a way to at least get around the first issue by pointing it to the workflow files(s) it should pay attention to. I'll do a little reading and see if I get lucky.

@rusackas
Copy link
Member

rusackas commented Jul 1, 2024

changing my origin from https to ssh did not help. :/

Reinstalling node modules in superset-frontend didn't break anything either. Not sure which of the million travis.yml files I had was causing the issue.

@mistercrunch
Copy link
Member Author

Realizing there's significantly much more work to do here. Last time I pushed this forward I found some clear incompatibility between the base Ubuntu images used by github and the ones used by act, something around python's SSL not being configured right in the catthehacker/act-ubuntu image

@mistercrunch
Copy link
Member Author

Thinking about the success criteria for this PR, seems

  1. we should be able to run all "locally-relevant" GHA workflow. This means stuff like linting, running tests backend/frontend, pre-commit all, ... We don't need for workflows like the ephemeral envs ones and such to work locally.

  2. should be relatively easy to set up, easier than tox at least

@rusackas
Copy link
Member

rusackas commented Jul 3, 2024

Should we move this back to draft mode until some of the dust settles?

@mistercrunch mistercrunch marked this pull request as draft July 3, 2024 20:26
@mistercrunch
Copy link
Member Author

Yup, also would welcome some help here as I got tangled up in other things and it looks like this is getting pushed to the bottom of my todo list now. Things seem super promising, but there's quite a few little things to connect. I discovered there's support for .env files an .secrets files which both can reference env vars and set defaults. Seemed powerful.

The last blocker I had was around the pip install not working (because python ssl lib not properly set up, and while trying to reach out to httpS://pypy.org ) on the base docker images that act is using. Seems pretty doable to swap to any other image, but I didn't get too far.

@github-actions github-actions bot removed the github_actions Pull requests that update GitHub Actions code label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Namespace | Anything related to documentation preset-io review:draft size/L
Projects
Status: Proposals - Not proposed for consensus
Development

Successfully merging this pull request may close these issues.

5 participants