Re: Moving existing ostree users to a new branch



On Fri, Mar 17, 2017, at 11:12 AM, Daniel Drake wrote:

We now need to implement this automatic migration. I understand there
have been some previous conversations touching on the possibility of
having a new commit type which marks a specific branch as end-of-life.
I now plan to implement such functionality. I will aim for inclusion
upstream once the initial implementation is ready, so I would
appreciate any quick design guidance before I get into it.

One option is to include a systemd unit
which executes an idempotent script to change the config as part of an update.
I've thought a few times about writing a general framework for something
like this that has a "versioned" concept of configuration and makes it
easy to drop in snippets, but anyways the crude version is:

systemd unit:
Before=eos-updater.service
ConditionPathExists=!/var/lib/eos/newhotness-origin-transition
ExecStart=/usr/bin/eos-newhotness-transition.sh

shell (usr/bin/eos-newhotness-transition.sh)
origin=$(ostree admin --print-current-dir).origin
if grep -q /oldhardware/ ${origin}; then
  sed -i -e s,oldhardware,newhotness, ${origin}
  touch /var/lib/eos/newhotness-origin-transiction
fi

My thinking is that this new commit type would also point to a new
branch that the client should switch to. When doing an ostree update
that ends up on this type of commit, the client would then update the
local repo config to point at the new branch. Then it would restart
the update process using the new branch.

The ugly thing about this is going to be it crosses layers - the "repo pull"
part of libostree (OstreeRepo) is lower level than the "sysroot management"
(OstreeSysroot).  That's not insurmountable obviously...maybe the rebase
target could be provided as part of the status?  A little ugly...

It would make sense to me to have standardized metadata for this though;
a a{sv} entry "ostree.endoflife"  => string:"some reason text here"?
And an optional "ostree.endoflife-rebase" string"exampleos/42/x86_64/newhotness" ?


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