Gh act improvements#137
Conversation
|
Still in progress, one more thing left to do. |
21c0641 to
186770a
Compare
|
maybe split in multiple PRs? like cijoe version update separate ? |
Sure; doesn't really make much difference to me. |
186770a to
1d2bb32
Compare
|
@glimchb removed this particular commit from the PR |
| run: | | ||
| dnf update -y | ||
| dnf install -y git perl-JSON-PP | ||
| dnf install -y git perl-JSON-PP nodejs |
There was a problem hiding this comment.
Its not clear to me why this change is needed in the SPDK Fedora 43 image. Actions like download-artifacts are performed on cijoe (VM jobs) or SPDK Fedora 43 (Container jobs) containers, correct ?
Both of those container images stay the same whether we execute in GH or via ACT. Why is it not required currently in GH workflows we have ?
There was a problem hiding this comment.
Actions like download-artifacts are performed on cijoe (VM jobs) or SPDK Fedora 43 (Container jobs) containers, correct ?
Correct, BUT you still need nodejs to run the action.
cijoe has it pre-installed and baked into image, so it just works.
fedora43 does not, but in GHA it gets access to it because it's mounted from the host runner into the container. gh act does not have that feature: nektos/act#973 (comment):
container: is not yet supported (as in, it will run in a container, but you won't get node and other stuff that GHA mounts into that container for it to work properly)
so you need to already have nodejs in the container. Installing nodejs on your host system doesn't solve the issue.
Instead of installing nodejs into the qcow2 image (which is used for Docker image) I could just switch this into a step with contains(github.actor, 'nektos/act') conditional and install nodejs in runtime. But I think having it in the image is just better.
There was a problem hiding this comment.
because it's mounted from the host runner into the container.
Actually this might work differently than that.
Here I am printing nodejs version inside spdk-ci:fedora_43 container. And nodejs is not available. So it looks like it's the GH runner executing action steps.
| - name: guest_update | ||
| run: | | ||
| pkg install -y git | ||
| pkg install -y git nodejs |
There was a problem hiding this comment.
Even more so than above. The FreeBSD VM images are not used as container images for executing GH actions.
There was a problem hiding this comment.
Yeah, they're not. Do several MB more added to the image really hurt though? I'd leave this in, so both OS' can be run as containers if needed.
|
@tomzawadzki |
Add a simple Dockerfile to enable users building a local image which includes Github CLI tool. With this image more workflows can be run locally without the need to temporarily modify the workflows just to install "gh". Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
Installing nodejs into the images fixes running Github Action workflows locally when using "gh act". Specifically: the parts of the workflows where "container:" is used with Fedora and Freebsd Docker images. Without nodejs available some of the actions (for example - actions/download-artifacts) will not work. Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
The version with outer double quotes and single inner quotes
works in Github using github-hosted runners, but not locally
using "gh act". "artifact_id" was actually getting exported
as:
'artifact_id={'\''fedora_43'\'':20878294770,'\''freebsd_14'\'':20878294770}'
Gh act JSON parser complains about single quotes and escape
signs, resulting in expressions being evaluated to NIL.
Use double quote for keys in JSON, which fixes the issue for gh act.
Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
1d2bb32 to
c58d5ab
Compare
The condition was wrong resulting in shutdown being attepmted for container-based workload in local (gh act) environment. We want to do this only on for jobs which spawn a Qemu VM and run either on self-hosted or gh act runners. Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
The step deleting previous caches works directly with remote Github repository, so don't execute it when working locally with gh act. Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
Use 3-rd level headers for "Actions" sub-sections. Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
c58d5ab to
c090d61
Compare
Move the conditional completely to step's "if" statement instead of keeping a part of it inside the "run" script. Signed-off-by: Karol Latecki <karol.latecki@nutanix.com>
Series of changes improving running workflows locally using
gh act.Explanations here to avoid going into commit messages:
artifact_idin common tests workflow - there was an issue with quoting whichgh actJSON parser was complaining about. Interestingly - this worked in Github which might suggest different JSON parsers?gh actdisk.pathproblem of .toml file, but decided to keep the version upgrade anyway.