-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
command not found (in image node:12.6-buster-slim, as opposed to GH Actions) #107
Comments
node:12.6-buster-slim
See https://github.com/nektos/act#runners. You can customize the image used for the runs-on. I've created an image that is a match to GitHub runners, but its like 15GB! |
Hi @cplee thanks for the work you put into this. I know that the image is configurable, and I've locally tested with an image where I installed sudo. So this is kind of a workaround, but the reason I opened this issue is that this limits compatibility with workflows that run on GitHub. My intention was to point out where the documented (and actual) behavior of Actions is unequal the default of As mentioned I'm not sure what solution I would propose, as maintaining separate images seems inappropriate. |
Tough problem. The runners that GitHub Actions offers are huge. I didn't feel right using an 18GB image as the default, requiring users of I chose the Open to ideas 🙏 |
I wonder if there's a way we could make an intermediary image that has 90% of the needed CLI tools for 10% of the footprint of the giant image. The only way we could reasonably do that (beyond intuition) is scanning a corpus of public GH Actions and seeing what works. Then again, maybe it would give people a false sense of security as these issues would crop up less often - so it would be "stranger" and more likely to result in bug reports. 🤔 |
Maybe act could use a .Dockerfile that the user can customize to make sure whatever tools they need is available in the used image. This could live in |
see #196 for discussion on creating a slim runner |
I think at least the documentation should be updated, it currently states "The environment variables and filesystem are all configured to match what GitHub provides." but should say that that is only the case if you use this non-default image. I think that docker for mac/windows is actually not very good with large images, but that an 18GB image in general isn't that crazy given the high speed internet and large disks available today. |
I would at least add common tools that are used in CI builds. For example, Or maybe I'm doing something wrong without realizing it and make is actually in the image :) |
I guess there is not enough agreement on what is "common". In the end you would include everything that github installs in the runner, which @cplee already did in that 20 gig image. I have to say that building my own "runtime" image worked well for me. The nice thing with that image is that you can also use it to run the whole action in via
and to not rely on any "setup" actions. That makes it much easier to reproduce the github build on your local machine using Hope that helps. |
Yes, I agree. But the initial argument against using the huge github image seems to be its size. Such tools as
In my opinion, most of the people interested in this project are interested in it because they already use github actions in their projects, not the other way around. Asking them to change their existing CI configuration (especially on a company/organization level) just to be able to test it with a particular tool doesn't seem to be practical. Just my opinion though. |
I'm not the author of act, so I can only guess that the motivation is to use an off-the-shelf image, and not to build one and then discuss with everyone what should be included or not.
No, I'm not asking anyone to do that, I just say what worked for me. |
|
Modifications to remove or install inaccessible commands. I'll ask the first question a different way:
I infer the way to run a custom docker image is:
|
It's just not possible due to the way how Docker works. See actions/runner-images#2320 (comment)
I'd say it's not our responsibility to teach how to make Docker images, there is plenty of (much better) sources that go into details on how to do that where official Docker documentation is quite good source on that.
Eventually there could be link to Docker documentation regarding how to make Docker images in |
I was debugging another issue and wanted to check if the large image would solve it. It looks like I'm stuck with the micro image that I've chosen at the very first install. Is there a way to force-reset to the large one? I've tried a bunch of things:
After reinstalling it fails almost instantly and never attempts to download the large image, and it looks like Logs
|
@killthekitten |
@catthehacker thanks for the fast response!
Did you mean it can exist or cannot exist? I tried replacing the python runtime with no big success:
Maybe it has to do with jobs:
test:
runs-on: ubuntu-latest
container:
image: python:3.8.5 |
|
@catthehacker : First of all I like to show my fullest appreciation for all the work you were doing to provide access to multiple image sizes. I was wondering whether in order to avoid many duplicate issues here - one could create symlinks to tools that have not been included in the smaller images to a file that once executed provides a message explaining that you need a larger image, point to this issue and then error out? |
@jonico that's an amazing idea, I'll try to work on that. |
If one were to use an unusual exit code for that script, one may also have special treatment of this error code one the docker container exited - will definitely try out any suggestions you do 😊 |
I would use already existing exit code |
@catthehacker: I will feature nektos/act in GitHub's upcoming summer fest. I figured you are in a similar time zone and might be interested in listening in. Here is the registration link (everybody is welcome - and there will be swag for the first 200 registrants): https://resources.github.com/webcasts/Summerfest-2021-South-Europe/ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@catthehacker: Wonderful 😻 - I would suggest to change the error message to |
Why isn't the |
So I tried using the medium instead of slim for git, but noticed medium doesn't have yarn :/ |
Not sure if this is useful for anyone, but out of curiosity I've tried to build a 'minimal' runner image based on github's packer scripts. The repo is here, the image is published to DockerHub both for x86 and arm. The idea is to keep the pre-installed amount of tools low because I assume most workflows anyway use I know about existing images, but maybe mine fill a gap and are useful for some people? Let me know if this is useful to you. |
Were you able to resolve this? Should I install |
Is this the command I'm supposed to use please? It doesn't seem to spend time pulling any bigger image though - ./act -P catthehacker/ubuntu:custom-latest-20240215 -s GITHUB_TOKEN=abIUV8V push I still get this error [Test FusionAuth login/run-tests] ✅ Success - Main Get docker-compose.yaml
[Test FusionAuth login/run-tests] ⭐ Run Main Start FusionAuth
[Test FusionAuth login/run-tests] 🐳 docker exec cmd=[bash --noprofile --norc -e -o pipefail /var/run/act/workflow/1-composite-1.sh] user= workdir=faDockerComposeFilePath
| /var/run/act/workflow/1-composite-1.sh: line 2: docker: command not found
[Test FusionAuth login/run-tests] ❌ Failure - Main Start FusionAuth
[Test FusionAuth login/run-tests] exitcode '127': command not found, please refer to https://github.com/nektos/act/issues/107 for more information same as when I tried running ./act -P ubuntu-22.04=-self-hosted |
What's interesting is the runner links are broken above, and I would love to know how to use the 18GB runner right now. |
For those looking, the docs on runners have apparently moved here: https://nektosact.com/usage/runners.html also my issue is one of surprise. The first run I was asked how large an env would I like. I chose micro, because I'm just starting. By making that uninformed choice, I spent the last couple hours trying to figure out what issue 107 meant and how to do |
I added these steps and act was able to add
|
Very old issue, but I'm getting around it by installing sudo if jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Act dependencies
if: ${{ env.ACT }}
run: |
apt-get update && apt-get install sudo -y
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install curl build-essential -y |
- See related comments on nektos/act#107 (comment) - Hopefully all these workarounds can be removed at some point Signed-off-by: Joel Van Eenwyk <joel.vaneenwyk@gmail.com>
Hi,
as documented here GitHub configures passwordless sudo, so I can have sudo in my shell scripts to perform individual commands as root.
Given this minimal workflow:
The result on Actions is
uid=0(root) gid=0(root) groups=0(root)
Running this workflow in
act
yields this result:Not sure what the most elegant solution would be without re-building the
node:12.6-buster-slim
image to install sudo and configure it passwordless. But I think the goal should be to be 1:1 compatible with actions, if possible.The text was updated successfully, but these errors were encountered: