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

move to atomfs with fixed umount, update golang to 1.22 #654

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

Conversation

mikemccracken
Copy link
Contributor

see project-machine/atomfs#27

The MetadataPath field in the MountOCIOpts struct is not needed anymore, if left empty it will use /run/atomfs/ for all mounts.

The atomfs.bats file is not passing locally even though the equivalent test does pass in atomfs#27. Creating this PR to see if it passes in jenkins. It is something about the base image's verity device being in use. I suspect another test is not unmounting the shared base busybox image - maybe we need to isolate the tests better here, or just delete the atomfs test in stacker because it's covered in atomfs now

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mikemccracken mikemccracken marked this pull request as draft December 19, 2024 00:52
@mikemccracken
Copy link
Contributor Author

Converted to draft because we shouldn't merge this, we should wait until atomfs merges atomfs#27 and then update to the main repo

@mikemccracken mikemccracken force-pushed the 2024.12.02/main/atomfs-top branch 2 times, most recently from 7eb9274 to 81a78db Compare December 19, 2024 00:55
@mikemccracken mikemccracken force-pushed the 2024.12.02/main/atomfs-top branch from 81a78db to 15b4b28 Compare January 10, 2025 01:01
@mikemccracken
Copy link
Contributor Author

this should work now but will need a change to the first commit to bring in the real atomfs repo once project-machine/atomfs#27 is merged.

@mikemccracken mikemccracken force-pushed the 2024.12.02/main/atomfs-top branch 3 times, most recently from bc09e19 to 9f04ece Compare January 11, 2025 00:13
@mikemccracken mikemccracken changed the title temp: move to atomfs with fixed umount move to atomfs with fixed umount, update golang to 1.22 Jan 11, 2025
atomfs 1.1.3 has a new API for mounting that changes it to store metadata
about the mounted molecules in a known location. It also cleans up the
unmount code path and added a lot of tests to atomfs.

This moves to the new atomfs version and removes an obsolete mount
option.

atomfs also has a min golang version of 1.22, which we adopt for stacker
here too because 1.21 is EOL at this time. This requires a go mod bump
and tweaks to a few github CI yamls.

note the build.yaml stackerfile now exports GOTOOLCHAIN=auto, which is
the default set in $GOROOT/go.env if you install go via the tgz at
go.dev/dl, but apparently the alpine package doesn't do that. We want
auto, in order to have go respect the `toolchain` directive in go.mod.
This does download a new go toolchain during the build, though, so one
could argue that the right thing here would be to just update the alpine
package, but we can do that at a later time.

It also fixes a typo in atomfs.bats - this test case is also now run in
the atomfs repo itself and the typos were fixed there, but we leave it
here for extra coverage.

Signed-off-by: Michael McCracken <[email protected]>
A previous test bug would have been caught by linting the bats test
code, so let's do that now.

That error was using an undefined variable in a test. ($last_layer_hash
in atomfs.bats) It had been defined in a different test in the same
file, but was undefined in the test in question. Unfortunately because
of the way bats does bash, shellcheck only identifies that as an INFO
level possible error SC2031.

So this adds a new `lintbats` target that first checks for JUST SC2031,
then checks separately for only error level issues.

This commit also fixes a few error level issues in other files:
- asterisk and whiteout : use glob instead of looping over ls. /shrug
- bom: [ -n "${ZOT_HOST}:${ZOT_PORT}" ] will always be true because of
the colon in there, so this commit eliminates the colon.
- config.bats had a complaint about the indentation of the EOF because
it's in yaml in another here doc? OK then.

Also add the shellcheck package to the build deps.

Signed-off-by: Michael McCracken <[email protected]>
this is testing import of squash images then building tar on top, we can
test that without also testing zothub.io's nine fives.

Signed-off-by: Michael McCracken <[email protected]>
@mikemccracken mikemccracken force-pushed the 2024.12.02/main/atomfs-top branch from 9f04ece to 3627cc9 Compare January 11, 2025 00:43
Instead of using `go get` which now does nothing after moving to 1.22,
or `go install` which fails in github CI, let's just clone and build
umoci ourselves.

Signed-off-by: Michael McCracken <[email protected]>
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.

1 participant