Skip to content

Commit

Permalink
Stabilize container functionality
Browse files Browse the repository at this point in the history
I think we have sufficient experience with this to call this
functionality officially stable.
  • Loading branch information
cgwalters committed Nov 4, 2022
1 parent ecdcfb8 commit 44f8be7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 17 deletions.
9 changes: 2 additions & 7 deletions docs/container.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
---
parent: Experimental features
nav_order: 1
nav_order: 5
---

# ostree native containers

For more information on this, see [CoreOS layering](https://github.com/coreos/enhancements/pull/7).

rpm-ostree inherits work in [ostree-rs-ext](https://github.com/ostreedev/ostree-rs-ext/) to
create "container native ostree" functionality. This elevates OCI/docker containers to
be natively supported as a transport mechanism for bootable operating systems.
Expand All @@ -16,11 +13,9 @@ be natively supported as a transport mechanism for bootable operating systems.
Use this to switch to booting from a container image:

```
$ rpm-ostree rebase --experimental ostree-unverified-registry:quay.io/coreos-assembler/fcos:testing-devel
$ rpm-ostree rebase ostree-unverified-registry:quay.io/fedora/fedora-coreos:stable
```

In the near future, we hope to push this more officially to `quay.io/fedora/coreos:stable`.

However, this model would just be using Docker/OCI transport "on the wire"
for content that already exists today. This would aid things like mirroring
the OS alongside other container images, but for many users the next step
Expand Down
2 changes: 1 addition & 1 deletion docs/layering.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ We need to stop the Zincati service so that auto-updates won't interfere with ou
Next, we call `rpm-ostree` to rebase our system using the image we just pushed to quay.

```bash
[core@tutorial ~]$ sudo rpm-ostree rebase --experimental \
[core@tutorial ~]$ sudo rpm-ostree rebase \
ostree-unverified-registry:quay.io/<YOURUSER>/my-custom-fcos
```

Expand Down
3 changes: 1 addition & 2 deletions rust/src/cliwrap/yumdnf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,7 @@ fn disposition(opt: Opt, hosttype: SystemHostType) -> Result<RunDisposition> {
ImageCmd::Rebase(rebase) => {
let container_ref = rebase.to_ostree_container_ref()?;
let container_ref = container_ref.to_string();
let experimental = rebase.experimental.then(|| "--experimental");
let cmd = ["rebase"].into_iter().chain(experimental).chain([container_ref.as_str()])
let cmd = ["rebase"].into_iter().chain([container_ref.as_str()])
.map(|s| s.to_string()).collect::<Vec<String>>();
RunDisposition::ExecRpmOstree(cmd)
},
Expand Down
3 changes: 0 additions & 3 deletions src/app/rpmostree-builtin-rebase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ rpmostree_builtin_rebase (int argc, char **argv, RpmOstreeCommandInvocation *inv

if (refspectype == rpmostreecxx::RefspecType::Container)
{
if (!opt_experimental)
return glnx_throw (error,
"Rebasing to a container image reference requires --experimental");
/* When using the container refspec type, if rebasing to a specific commit, we expect a
* specific digest tag in the refspec, not in a separate argument */
if (revision)
Expand Down
9 changes: 5 additions & 4 deletions tests/kolainst/destructive/container-image
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in
# Since we're switching OS update stream, turn off zincati
systemctl mask --now zincati

ostree container encapsulate --compression-fast --repo=/ostree/repo ${checksum} "${image}"
rpm-ostree rebase "$image_pull" --experimental | tee out.txt
ostree container encapsulate --repo=/ostree/repo ${checksum} "${image}"
# This one keeps --experimental, but we also test without it below
rpm-ostree rebase --experimental "$image_pull" | tee out.txt
assert_file_has_content out.txt 'Importing.*'"$image_pull"
rpmostree_assert_status ".deployments[0][\"container-image-reference\"] == \"ostree-unverified-image:$image\""
rpmostree_assert_status ".deployments[0][\"checksum\"] == \"${checksum}\""
Expand All @@ -61,7 +62,7 @@ case "${AUTOPKGTEST_REBOOT_MARK:-}" in

# Test rebasing back to ostree https://github.com/coreos/rpm-ostree/issues/3677
rpm-ostree rebase "$checksum"
rpm-ostree rebase "$image_pull" --experimental
rpm-ostree rebase "$image_pull"

/tmp/autopkgtest-reboot 1
;;
Expand Down Expand Up @@ -183,7 +184,7 @@ EOF
fi
derived=oci:$image_dir:derived
skopeo copy containers-storage:localhost/fcos-derived $derived
rpm-ostree rebase --experimental ostree-unverified-image:$derived
rpm-ostree rebase ostree-unverified-image:$derived
rm $image_dir -rf
/tmp/autopkgtest-reboot 3
;;
Expand Down

0 comments on commit 44f8be7

Please sign in to comment.