[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [atomic-devel] Refspec used by "atomic host upgrade"

Colin Walters <walters verbum org> writes:

> All of that philosophy aside, there are many ways to do this:

Thanks a lot!

Here is our code:


I think it does a lot of what you mention.

It does roughly the following, if I read it right:

    # atomic host upgrade
    # ostree checkout $ref /var/local-tree

    # reboot

    # ostree init --repo /var/local-repo --mode archive-z2

    # rpm -e ... --root /var/local-tree --dbpath /usr/share/rpm
    # rpm -U ... --root /var/local-tree --dbpath /usr/share/rpm

    # ostree commit -s cockpit-tree --repo /var/local-repo \
      -b $ref --tree-dir=/var/local-tree
    # ostree trivial-httpd /var/local-repo -p - -d
    # ostree remote add local$port

    (one of these, not sure which in which situation)
    # rpm-ostree upgrade
    # rpm-ostree rebase:$ref

I think this is your #1, right?

We were using this successfully for a long time, but recently the
"ostree checkout" at the top started producing the wrong tree.  It used
to give us the new, post-upgrade tree, but now we get the old,
pre-upgrade tree.  (On RHEL, on Fedora we still get the post-upgrade

(This can probably be fixed by doing the "ostree checkout" after the
reboot, but we rather do it before since then we only need to do it once
per image creation, and not once per test run.)

>> Now we need to prefix the remote as well, like this:
>>     ostree checkout \
>>       rhel-atomic-host-ostree:rhel-atomic-host/7/x86_64/standard \
>>       /var/local-tree
>> "atomic host upgrade" has a way to compute this refspec.  How can we
>> reliably get the same value?
> It's in the .origin file.

And where is that file? :-)

I am doing this now, and that also works for our case:

    remote=$(ostree remote list)
    ref=$(python -c 'import json; print json.load(open("/usr/share/rpm-ostree/treefile.json"))["ref"]')
    ostree checkout "$remote:$ref" /var/local-tree

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]