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

Avoid docker action, convert to javascript #5

Closed
t-botz opened this issue Dec 13, 2021 · 4 comments · Fixed by #6
Closed

Avoid docker action, convert to javascript #5

t-botz opened this issue Dec 13, 2021 · 4 comments · Fixed by #6

Comments

@t-botz
Copy link
Contributor

t-botz commented Dec 13, 2021

Docker actions have quite a few drawbacks:

  • To quote github itself, Because of the latency to build and retrieve the container, Docker container actions are slower than JavaScript actions. From experience, we are not talking about milliseconds here, it's a lot slower, even if you are just pulling an existing image
  • If the containers edit files (which yor-action does), it does it as the docker user. On a self hosted runner without rootless docker, it does it as root and then the agent is failing because it can't clean up those files.

The big benefit of docker actions are the ability to pack a whole environment and its dependencies. For yor it doesn't matter as its just a static binary.

I would be more than happy to submit a PR, I just want to check first if that's something the maintainers would be ok with.

Otherwise I will implement my own setup-yor action.

@t-botz t-botz changed the title Avoid running inside docker Avoid docker action, convert to javascript Dec 13, 2021
@nimrodkor
Copy link
Contributor

Hi @t-botz !

We're open to the idea in general, but I'm wondering... How will the nodejs runtime have yor installed? I'm guessing you won't have golang installed (heavy and takes time). If you're installing yor from URL - would that be a lot faster than just pulling the image? I agree using docker images is slower than bash scripting, but from what I've seen pulling an image is just a few seconds (while building an image is A LOT slower...) - and querying and downloading yor could take just as much time.
Do you plan to have yor pre-installed on the action? If so - how will it handle the different OS and architecture of the machine that runs it?

@t-botz
Copy link
Contributor Author

t-botz commented Dec 13, 2021

Yor would be installed by downloading the binary from github release. Its a very common pattern and the github action toolkit has a few helpers to make it.
That's how setup-go or setup-terraform are working. I don't have an example on top of my head of setup-xxx that use github release but I have no doubt ill found a template or worst case rolling my own, which sounds fairly easy.

@nimrodkor
Copy link
Contributor

Sounds interesting!
Would appreciate a PR then @t-botz

@nimrodkor
Copy link
Contributor

I'm still wondering how you'll handle the various OS and ARCH support though

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 a pull request may close this issue.

2 participants