Skip to content

Gh act improvements#137

Open
karlatec wants to merge 8 commits into
spdk:mainfrom
karlatec:karlatec/ghact
Open

Gh act improvements#137
karlatec wants to merge 8 commits into
spdk:mainfrom
karlatec:karlatec/ghact

Conversation

@karlatec

@karlatec karlatec commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

Series of changes improving running workflows locally using gh act.

Explanations here to avoid going into commit messages:

  • Add a Dockerfile to allow users quickly creating local version of runner images with Github CLI tool installed. Default act images don't have it in "slim" images (and we don't want to use "full" images as they are 30+GB in size)
  • Add nodejs to list of packages installed by CI Joe into Qcow2 images. Nodejs is needed by some of the actions we use. It doesn't take much space, so won't bloat the images very much.
  • Fix exporting artifact_id in common tests workflow - there was an issue with quoting which gh act JSON parser was complaining about. Interestingly - this worked in Github which might suggest different JSON parsers?
  • Don't use github.token to avoid downloading Qcow2 image on each run when using gh act
  • CI Joe image upgrade was aimed at using configuration files override as described here. Ultimately this was not needed as I've found different way to solve disk.path problem of .toml file, but decided to keep the version upgrade anyway.

@karlatec karlatec marked this pull request as draft January 15, 2026 10:51
@karlatec

Copy link
Copy Markdown
Contributor Author

Still in progress, one more thing left to do.

@karlatec karlatec force-pushed the karlatec/ghact branch 2 times, most recently from 21c0641 to 186770a Compare January 27, 2026 10:57
@karlatec karlatec marked this pull request as ready for review January 27, 2026 11:10
Comment thread .github/workflows/spdk-common-tests.yml
@glimchb

glimchb commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

maybe split in multiple PRs? like cijoe version update separate ?

@karlatec

Copy link
Copy Markdown
Contributor Author

maybe split in multiple PRs? like cijoe version update separate ?

Sure; doesn't really make much difference to me.

@karlatec

Copy link
Copy Markdown
Contributor Author

@glimchb removed this particular commit from the PR

@karlatec karlatec requested a review from glimchb January 28, 2026 08:01
run: |
dnf update -y
dnf install -y git perl-JSON-PP
dnf install -y git perl-JSON-PP nodejs

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Even more so than above. The FreeBSD VM images are not used as container images for executing GH actions.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

Comment thread .github/workflows/spdk-common-tests.yml Outdated
Comment thread .github/workflows/spdk-common-tests.yml Outdated
Comment thread .github/workflows/spdk-common-tests.yml Outdated
@karlatec

Copy link
Copy Markdown
Contributor Author

@tomzawadzki
This has been stale for a while. Will get back to this later this week.

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>
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>
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>
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 this pull request may close these issues.

3 participants