Skip to content

Commit

Permalink
chore: temp: move to atomfs with fixed umount
Browse files Browse the repository at this point in the history
do not merge.

Signed-off-by: Michael McCracken <[email protected]>
  • Loading branch information
mikemccracken committed Dec 19, 2024
1 parent ad9a694 commit 81a78db
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
7 changes: 0 additions & 7 deletions cmd/stacker/internal_go.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"os"
"path"
"runtime"
"strings"

Expand Down Expand Up @@ -177,14 +176,8 @@ func doAtomfsMount(ctx *cli.Context) error {
tag := ctx.Args().Get(0)
mountpoint := ctx.Args().Get(1)

wd, err := os.Getwd()
if err != nil {
return errors.WithStack(err)
}

opts := atomfs.MountOCIOpts{
OCIDir: config.OCIDir,
MetadataPath: path.Join(wd, "atomfs-metadata"),
Tag: tag,
Target: mountpoint,
AllowMissingVerityData: true,
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -289,5 +289,6 @@ require (

replace (
github.com/opencontainers/umoci => github.com/project-stacker/umoci v0.0.0-20240906174318-e9397ba4ced0
machinerun.io/atomfs => github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd
stackerbuild.io/stacker-bom => github.com/project-stacker/stacker-bom v0.0.0-20240509203427-4d685e046780
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,8 @@ github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKju
github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI=
github.com/miekg/pkcs11 v1.1.1 h1:Ugu9pdy6vAYku5DEpVWVFPYnzV+bxB+iRdbuFSu7TvU=
github.com/miekg/pkcs11 v1.1.1/go.mod h1:XsNlhZGX73bx86s2hdc/FuaLm2CPZJemRLMA+WTFxgs=
github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd h1:78AivBFUMgHBX7W2tIKVQC5yJaDhiQujQcc/I6aJOpM=
github.com/mikemccracken/atomfs v0.0.0-20241219002031-7673e529b9cd/go.mod h1:cidyEmsNeeo+9f7OiHl/nA+8KS7Vj5XOslR87VkIebM=
github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
github.com/mistifyio/go-zfs/v3 v3.0.0 h1:J5QK618xRcXnQYZ2GE5FdmpS1ufIrWue+lR/mpe6/14=
Expand Down Expand Up @@ -1592,8 +1594,6 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
machinerun.io/atomfs v1.1.1 h1:EprTiYMzAlKL+3S7woe9DsCJGwO2dkHTlvmjlVNO8pY=
machinerun.io/atomfs v1.1.1/go.mod h1:cidyEmsNeeo+9f7OiHl/nA+8KS7Vj5XOslR87VkIebM=
modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw=
modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE=
modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4=
Expand Down
4 changes: 2 additions & 2 deletions test/atomfs.bats
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ EOF
# first layer should still exist since a is still mounted
manifest=$(cat oci/index.json | jq -r .manifests[0].digest | cut -f2 -d:)
first_layer_hash=$(cat oci/blobs/sha256/$manifest | jq -r .layers[0].digest | cut -f2 -d:)
[ ! -b "/dev/mapper/$last_layer_hash-verity" ]
[ ! -b "/dev/mapper/$first_layer_hash-verity" ]

mkdir c
stacker internal-go atomfs mount c-squashfs c
Expand All @@ -120,7 +120,7 @@ EOF
# first layer should still exist since c is still mounted
manifest=$(cat oci/index.json | jq -r .manifests[0].digest | cut -f2 -d:)
first_layer_hash=$(cat oci/blobs/sha256/$manifest | jq -r .layers[0].digest | cut -f2 -d:)
[ ! -b "/dev/mapper/$last_layer_hash-verity" ]
[ ! -b "/dev/mapper/$first_layer_hash-verity" ]

# c should still be ok
[ -f c/c ]
Expand Down

0 comments on commit 81a78db

Please sign in to comment.