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

upgrader: Use "pending" deployment for origin by default #611

Closed
wants to merge 1 commit into from

Conversation

cgwalters
Copy link
Member

Until now, we always used the booted deployment, and would
garbage collect the "pending" deployment. This is the
way OSTree was designed, but I think for rpm-ostree given
how mutable we are on the client side, there's a much stronger
argument for being more stateful too.

This is a relatively simple code change to split the "merge deployment"
concept into two. There's now the "config merge deployment" and the
"origin merge deployment".

Basically, rpm-ostree install foo; rpm-ostree install bar will
now install both foo and bar. But we will still use the booted
deployment for /etc.

Down the line, I think I'd like to drive into OSTree the concept of
a "staged" deployment, that has the hardlink checkout done, but doesn't
have the config merge.

But we don't need to change the OSTree core for this yet; we can
do it here in rpm-ostree, and this relatively simple code change
fixes many issues at once.

For example, rpm-ostree upgrade && rpm-ostree install foo now
does what you expect as well.

Obviously, we want to enable doing multiple things in one transaction,
and we're not far away, but I think this is also the right thing to do now.

I'm relatively confident it won't break anyone's workflow, as what
we did before wasn't generally that useful. However, people will
need to learn to ostree admin undeploy 0 if they don't want
this behavior. (We need to have rpm-ostree cleanup).

Closes: #406

@cgwalters
Copy link
Member Author

If we agree on this I'll do the tests.

@jlebon
Copy link
Member

jlebon commented Feb 8, 2017

Yeah, I think that makes sense overall. We'll need to remember to note the backwards incompatibility at release time, even though the new behaviour is probably what most people want.

@cgwalters
Copy link
Member Author

Rebased 🏄 and with tests ☑️


# rollup: install/deploy/uninstall

assert_status_jq ".deployments[0][\"base-checksum\"] == \"${commit}\"" \
Copy link
Member

Choose a reason for hiding this comment

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

Ahh, I renamed this to vm_assert_status_jq in my last PR. :)

'.deployments[0]["packages"]|index("nonrootcap")|not'
vm_rpmostree install nonrootcap
assert_status_jq ".deployments[0][\"base-checksum\"] == \"${commit}\"" \
'.deployments[0]["packages"]|index("foo") >= 0' \
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 there's an has() operator that would be nice here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Doesn't do what you'd think:

echo '["foo", "bar"]' | jq 'has("foo")'
jq: error (at <stdin>:1): Cannot check whether array has a string key

I looked but didn't see a jq operator for searching an array.

Copy link
Member

Choose a reason for hiding this comment

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

Ahhh gotcha!

Until now, we always used the booted deployment, and would
garbage collect the "pending" deployment.  This is the
way OSTree was designed, but I think for rpm-ostree given
how mutable we are on the client side, there's a much stronger
argument for being more stateful too.

This is a relatively simple code change to split the "merge deployment"
concept into two.  There's now the "config merge deployment" and the
"origin merge deployment".

Basically, `rpm-ostree install foo; rpm-ostree install bar` will
now install both `foo` and `bar`.  But we will still use the booted
deployment for `/etc`.

Down the line, I think I'd like to drive into OSTree the concept of
a "staged" deployment, that has the hardlink checkout done, but doesn't
have the config merge.

But we don't need to change the OSTree core for this yet; we can
do it here in rpm-ostree, and this relatively simple code change
fixes many issues at once.

For example, `rpm-ostree upgrade && rpm-ostree install foo` now
does what you expect as well.

Obviously, we want to enable doing multiple things in *one* transaction,
and we're not far away, but I think this is also the right thing to do now.

I'm relatively confident it won't break anyone's workflow, as what
we did before wasn't generally that useful.  However, people will
need to learn to `ostree admin undeploy 0` if they *don't* want
this behavior.  (We need to have `rpm-ostree cleanup`).

Closes: coreos#406
@cgwalters
Copy link
Member Author

Rebased 🏄

@jlebon
Copy link
Member

jlebon commented Feb 8, 2017

@rh-atomic-bot r+ 123a5b6

@rh-atomic-bot
Copy link

⌛ Testing commit 123a5b6 with merge 0a1289a...

@rh-atomic-bot
Copy link

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 0a1289a to master...

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.

consecutive 'pkg-*' operations discard all earlier state
3 participants