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

Drop tmpfiles var #3168

Merged
merged 2 commits into from
Feb 12, 2024
Merged

Drop tmpfiles var #3168

merged 2 commits into from
Feb 12, 2024

Conversation

cgwalters
Copy link
Member

ostree-tmpfiles.conf: Drop var entry

We are backing away from this semantic, and moving towards
/var only being initialized at initial provisioning.


docs/var: Update for latest

This reorients things here around the latest VOLUME /var approach.


docs/var.md Outdated Show resolved Hide resolved
We are backing away from this semantic, and moving towards
`/var` only being initialized at initial provisioning.
This reorients things here around the latest `VOLUME /var` approach.
@travier
Copy link
Member

travier commented Feb 12, 2024

(I'm still reading and trying to understand the new implications of this change).

@cgwalters
Copy link
Member Author

Makes sense! Happy to chat btw

@jmarrero
Copy link
Member

The main changes already landed, so lgtm. I think we could have a meeting to make sure we all understand what this means.
But as I understand it.

Now when doing a deployment from a container we will copy whatever thing is in /var in the container to the host's /var. However the container is not the source of truth for /var and it also does not work like we do with /etc. It will not touch var as long as there is content in it. If someone wants to get the content in /var from each container update they would need to delete /var before each reeboot after a deployment.

@cgwalters
Copy link
Member Author

If someone wants to get the content in /var from each container update they would need to delete /var before each reeboot after a deployment.

Yeah...though in theory one could manually grab updated content, it'd just be annoying to do because it's somewhat "hidden". Unlike the ostree semantics where /usr/etc always has the new content. Hmm. I guess we could make up something that's mounted at runtime dynamically like /usr/var or so that always has the latest, so if anyone wants to sync it they can just cp (or write a systemd unit etc.)

@cgwalters cgwalters merged commit 15b4ee8 into ostreedev:main Feb 12, 2024
24 checks passed
@jmarrero
Copy link
Member

Hmm. I guess we could make up something that's mounted at runtime dynamically like /usr/var or so that always has the latest, so if anyone wants to sync it they can just cp (or write a systemd unit etc.)

Why would /var acting more like /etc would not be a good idea?

I guess the whole "container is the source of truth" makes me think that if I put something in the container it will land in my host, If we are going to preserve state in /etc and /var would be interesting to see how we can make them more similar behaviors.

@cgwalters
Copy link
Member Author

cgwalters commented Feb 13, 2024 via email

@jlebon
Copy link
Member

jlebon commented Feb 13, 2024

I think this makes sense overall, though I also suspect like @jmarrero that people will probably be surprised to not see their updated /var container content show up on their host. One seemingly obvious thing to do is enforce that /var is marked as a VOLUME in the image itself to make this explicit. But in practice, we'd probably want to define that in our base images, which would make it invisible to derived images. Another simpler approach is to just have ostree container commit print something if /var is non-empty?

Exposing a /usr/var makes a lot of sense to me (I'd even actually literally move /var into /usr/var in the OSTree commit itself to make this clearer -- having it hidden behind the /var mount feels odd).

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.

4 participants