-
Notifications
You must be signed in to change notification settings - Fork 198
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
[merged] compose: support adding external files #253
Conversation
#96 is related here. But there's multiples reasons I've hesitated on this until now. It's an obvious feature but the thing is, as soon as it's introduced, it breaks the default "skip if unchanged" logic we have now which understands just RPMs. It means that anyone doing a build system now needs to know about both RPMs and files (presumably stored in git). We'd then need to separate out the logic for "detect if RPM set is unchanged" from "detect if files are changed". Or alternatively we could add the external files into the checksum? Or another approach - automatically synthesize a noarch RPM from them? |
I've really struggled with this problem...convenience (aka Particularly since for the use case you're thinking of is Docker format, we could maybe merge together
? |
We already had the checksum/check-if-changed problem with |
Even if it can be used by Docker, my idea is to skip Docker completely and use directly an ostree commit for storing the container image. My other doubt about having add-files is: how will this co-exists with the new |
actually not, files under /exports will be deleted even if I add them through a .rpm: #233 I have added a new patch, that takes added-files into account for the cache. Would something like this work? |
e7f2d48
to
1d8d0a1
Compare
|
||
{ | ||
g_autofree guchar *ret_csum = NULL; | ||
if (!ostree_checksum_file (srcfile, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment in ostreedev/ostree#219 (comment) - this will also checksum uid/gid/xattrs, which is a bit weird since we'll be checksumming e.g. security.selinux
on the host system, but on target may have a different one.
This does raise a general question about what the uid/gid for copied files should be. If for example rpm-ostree starts supporting non-root operation, we'd still want the target files to be owned by UID 0
, not whatever UID was used to build the system.
I hadn't seen this updated PR before my comments in our standup today. It is looking like a good start. I don't want to block this, and it looks like it won't conflict too much with @jlebon 's work. That said we don't have any tests yet either, and I'm worried about adding more features without those. I'll work some more on that. |
Definitely shouldn't be an issue to rebase pkg-layering on this. |
I can add tests. I have not done it yet as this version was still a RFC |
I added a fixup ⬆️ to use only the file content for the checksum. I added some tests as well |
d54d24e
to
d3ce708
Compare
tests fixed now |
Can you have the test also use |
|
||
"repos": ["test-repo"], | ||
|
||
"bootstrap_packages": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd just delete this now.
I have added |
I meant that we change one of the external files, verify that results in a new commit. And conversely that not changing the files shouldn't result in a new commit. |
26c0850
to
ef01415
Compare
I have changed the patch to also test the file changed case ⬆️ |
Forgotten
|
ops I forgot to git add the Makefile-tests.am file. Done now. |
Unfortunately |
17edb42
to
b07663f
Compare
This will allow to copy arbitrary files into the rootfs, specifying something like: "add-files": [["service.template", "/exports/service.template"], ["config.json.template", "/exports/config.json.template"]] It is quite useful when building a container image. Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
Signed-off-by: Giuseppe Scrivano <[email protected]>
b07663f
to
4ccea7b
Compare
I still have a hesitation about this regarding overall philosophy (having components come purely as RPM vs |
This will allow to copy arbitrary files into the rootfs, specifying something like: "add-files": [["service.template", "/exports/service.template"], ["config.json.template", "/exports/config.json.template"]] It is quite useful when building a container image. Signed-off-by: Giuseppe Scrivano <[email protected]> Closes: #253 Approved by: cgwalters
Signed-off-by: Giuseppe Scrivano <[email protected]> Closes: #253 Approved by: cgwalters
Signed-off-by: Giuseppe Scrivano <[email protected]> Closes: #253 Approved by: cgwalters
💔 Test failed - status-atomicjenkins |
Looks like it was merged, so it should probably work now. |
Signed-off-by: Giuseppe Scrivano <[email protected]> Closes: #253 Approved by: cgwalters
Signed-off-by: Giuseppe Scrivano <[email protected]> Closes: #253 Approved by: cgwalters
☀️ Test successful - status-atomicjenkins |
@giuseppe @cgwalters A couple of thoughts (I'm not yet running a version that has this feature, but I find it appealing):
|
|
This will allow to copy arbitrary files into the rootfs, specifying something like:
"add-files": [["service.template", "/exports/service.template"],
["config.json.template", "/exports/config.json.template"]]
It is quite useful when building a container image.
Signed-off-by: Giuseppe Scrivano [email protected]