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

overlay.d/15fcos: add a migration script to move to OCI images #3355

Open
wants to merge 1 commit into
base: testing-devel
Choose a base branch
from

Conversation

jbtrystram
Copy link
Contributor

@jbtrystram jbtrystram commented Feb 7, 2025

to simplify testing for coreos/fedora-coreos-tracker#1823
ship a script to fake the ostree origin to appear like it's on an
OCI deployement.

Just ship the migration script for now, without the systemd unit, to allow testing.

To simplify testing for coreos/fedora-coreos-tracker#1823
ship a script to fake the ostree origin to appear like it's on an
OCI deployement.

Just ship the migration script for now, without the systemd unit, to
allow testing.
@jbtrystram jbtrystram changed the title [testing] deploy container images by default overlay.d/15fcos: add a migration script to move to OCI images Feb 7, 2025
@jbtrystram
Copy link
Contributor Author

There is at least one missing bit here : I found out that when faking the origin file, rpm-ostree --status doesn't pick up the change immediately.
Something like rpm-ostree useoverlay does it, but obviously it's not great. I tried to restart the service rpm-ostreed, found a refresh subcommand, but no luck.


motd_path=/run/motd.d/40-fcos-oci-rebase.motd

cat << EOF > "${motd_path}"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should have a separate script that writes out the MOTD and it should run on every boot unless the user has neutered it by touching a stamp file.

Copy link
Member

Choose a reason for hiding this comment

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

basically we can roll out the MOTD script later (i.e. like a month in to F42 or something).



# Restart Zincati
systemctl restart zincati
Copy link
Member

Choose a reason for hiding this comment

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

this happening here leads to temporary problems.. basically if there is an update available $now (which I guess is unlikely but could be the case when older systems are jumping through this new barrier we are going to create) then zincati will do it's thing and rpm-ostree will too, but if rpm-ostreed hasn't timed out and deactivated since we wrote the custom origin file then it will complain:

Feb 27 22:01:40 cosa-devsh rpm-ostree[3917]: Txn Deploy on /org/projectatomic/rpmostree1/fedora_coreos failed: Cannot look up version while tracking a container image reference

Maybe we should restart rpm-ostreed here too just to make sure it's picked up the new custom origin?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting scenario, I didn't thought of that.
This definitely requires more testing in these corner cases.

@dustymabe
Copy link
Member

dustymabe commented Feb 27, 2025

One thing I notice that isn't great is it still says CustomOrigin even after the update to the container from the registry:

[core@cosa-devsh ~]$ rpm-ostree status 
State: idle
Deployments:
● quay.io/fedora/fedora-coreos@sha256:40c0e515ed93cb8a9d5a773fb5a206b13e2edda02d92c6011a84399ceb31ed03
             CustomOrigin: Fedora CoreOS testing stream
                  Version: 41.20250215.1.0 (2025-02-17T11:44:02Z)

  ostree-remote-image:fedora:registry:quay.io/fedora/fedora-coreos@sha256:fcd6c0e85b1f80ba23b01d280db9f3e273ba9e4bfde9d00820d5141404ae0918
             CustomOrigin: Fedora CoreOS testing stream
                  Version: 41.20250130.1.0 (2025-01-31T20:20:28Z)

is that expected?

booted_imgref=$(rpm-ostree status --json --booted | jq -r '.deployments[0]."container-image-reference"')

if [ "$booted_imgref" != "null" ]; then
echo "The booted deployement is already an OCI container."
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
echo "The booted deployement is already an OCI container."
echo "The booted deployment is already an OCI container."

@dustymabe
Copy link
Member

Also on the system I see a bunch of these messages. Not sure if we can do anything about them:

Feb 27 22:08:58 cosa-devsh rpm-ostree[3591]: failed to query container image base metadata: Reading manifest data from commit: Missing ostree.manifest-digest metadata on merge commit

Comment on lines +44 to +45
cincinnati_url="https://raw-updates.coreos.fedoraproject.org/v1/graph?basearch=$arch&stream=$stream&oci=true"
imgref=$(curl "$cincinnati_url" -s | jq --arg VERSION "$version" -r '.nodes[] | select(.version==$VERSION) | .payload')
Copy link
Member

@dustymabe dustymabe Feb 28, 2025

Choose a reason for hiding this comment

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

We should make a failure here nonfatal. IIUC the reason for the curl is more cosmetic than anything else (so rpm-ostree status shows something not unexpected), but if it fails for whatever reason I think we should continue the migration.

Things that could cause this to fail could be complicated network environments like proxies, or maybe wifi where the NIC hasn't come up fully yet or something.

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.

2 participants