Skip to content

Commit

Permalink
Add experimental compose rootfs
Browse files Browse the repository at this point in the history
The loss of the buildah feature forces us to have a flow like this.

What we output here is an ostree-container aka `bare-split-xattrs`
format.

Signed-off-by: Colin Walters <[email protected]>
  • Loading branch information
cgwalters committed Feb 6, 2025
1 parent 1549f63 commit f360175
Show file tree
Hide file tree
Showing 7 changed files with 319 additions and 14 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,30 @@ jobs:
run: tar -C / -xzvf install.tar
- name: Integration tests
run: env TMPDIR=/var/tmp JOBS=3 ./tests/compose-image.sh
compose-rootfs:
name: "compose-rootfs tests"
needs: build
runs-on: ubuntu-latest
steps:
# https://github.com/containers/podman/discussions/17362
- name: Get a newer podman for heredoc support (from debian testing)
run: |
set -eux
echo 'deb [trusted=yes] https://ftp.debian.org/debian/ testing main' | sudo tee /etc/apt/sources.list.d/testing.list
sudo apt update
sudo apt install -y crun/testing podman/testing skopeo/testing
- name: Checkout repository
uses: actions/checkout@v3
- name: Download build
uses: actions/[email protected]
with:
name: install.tar
- name: Install
run: tar -C / -xzvf install.tar
- name: Test compose-rootfs
run: |
cd tests/compose
sudo podman build -v ./usr/bin/rpm-ostree:/run/build/rpm-ostree:ro --security-opt=label=disable --cap-add=all --device /dev/fuse -t localhost/test -f Containerfile .
container-encapsulate:
name: "Encapsulate tests"
needs: build
Expand Down
44 changes: 32 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ openssl = "0.10.68"
once_cell = "1.20.2"
os-release = "0.1.0"
# We pull this one from git, as the project is no longer published as an external crate.
ostree-ext = { git = "https://github.com/containers/bootc", rev = "5e0df36305cfda93eab0ca70678b618d1f2844f0" }
ostree-ext = { git = "https://github.com/containers/bootc", rev = "6663e6fe5e4615e99a8e95028f1cb975474ce8ec" }
paste = "1.0"
phf = { version = "0.11", features = ["macros"] }
rand = "0.8.5"
Expand Down
10 changes: 10 additions & 0 deletions rust/src/cli_experimental.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@ enum ComposeCmd {
#[clap(flatten)]
opts: crate::compose::BuildChunkedOCIOpts,
},
Rootfs {
#[clap(flatten)]
opts: crate::compose::RootfsOpts,
},
CommitToContainerRootfs {
#[clap(flatten)]
opts: crate::compose::CommitToContainerRootfsOpts,
},
}

impl ComposeCmd {
fn run(self) -> Result<()> {
match self {
ComposeCmd::BuildChunkedOCI { opts } => opts.run(),
ComposeCmd::Rootfs { opts } => opts.run(),
ComposeCmd::CommitToContainerRootfs { opts } => opts.run(),
}
}
}
Expand Down
Loading

0 comments on commit f360175

Please sign in to comment.