[WIP] New .dockerignore implementation#20128
Conversation
|
@pwaller it would be awesome if we could have unit tests and benchmarks for this. |
|
nice timings! |
1667362 to
32cbd92
Compare
|
I'm still working on this, but I've been a busy with other things. I hope to complete it within the next week. Please ping me if it is quiet longer than that. Feedback on the approach welcomed. Right now it still needs a few more tests writing (best based from the documentation), and one of the tests doesn't pass, so the implementation isn't quite complete yet. (dco/no is intentional until it is complete). |
95c4a1b to
2524e4f
Compare
|
OK. leaving it alone for now. Last failing test: It should ignore anywhere, but right now it only only ignores in directories which aren't the root. So a bit more work required to fix that. But almost there I think! |
|
I'll change the PR's title to "WIP" please ping if it's ready for review ❤️ |
Signed-off-by: Peter Waller <p@pwaller.net>
Signed-off-by: Peter Waller <p@pwaller.net>
2524e4f to
278e30f
Compare
|
In light of #20165, I have to move builder/dockerignore to pkg/dockerignore. Does that sound OK? |
|
@pwaller I think a better option is to not have the I do not want to move the whole |
|
I'm having difficulty proceeding development because when I run the unit tests locally, they hang indefinitely immediately after the btrfs test. I've waited more than 30 minutes with no apparent progress. Is that expected? I'm currently trying to run just the tests on |
|
OK, it finally failed after two hours. Any ideas how to fix? (I'm searching, too). |
|
Ping docker team. What is the best way getting help here? I'm a bit stuck and I don't have many spare cycles left for this at the moment. |
|
ping @duglin would you be able to help out? |
|
let's see what #20470 does w.r.t. timings first. |
|
@pwaller what's in your test .dockerignore file? I'm trying to reproduce it. |
|
Trivial reproducer, no directories, no negations. |
|
For me with Docker 1.10.1, with nfiles=10k, nignore = 20: with nfiles=10k, nignore = 40: nfiles=5k, nignore=20 nfiles=5k, nignore=40 |
|
Forgot to include the obvious |
|
|
||
| "github.com/Sirupsen/logrus" | ||
| "github.com/docker/docker/pkg/fileutils" | ||
| "github.com/docker/docker/builder/dockerignore" |
There was a problem hiding this comment.
This isn't permitted. A package shouldn't depend on the Docker internals.
There was a problem hiding this comment.
agreed. This archive package must not depend on docker internals. The Excluder struct should be moved to this package, without the whole dockerignore package.
|
@pwaller been trying to find time to look at this and help but I have a question for ya.... |
|
@pwaller Thanks! Have you seen the CI failures? it seems the code adds some unwanted dependency from |
|
Hi @icecrime, I'm still blocked on not being able to run the tests locally. I'm picking it up every few days, but then still more or less stuck. I'll make another attempt this evening but I'm more or less depleted on cycles for this. |
|
@duglin apologies, I replied by email but it seems my reply was lost. Basically, |
|
Hey @pwaller, I'm going to temporarily close this PR. It still looks like a good idea, but we cannot take it like this. Please, feel free to open a new PR once you have a clear branch with these changes. My piece of advice to make sure the tests run cleanly is to start a dedicated docker daemon in another location, that way you don't need to worry about what's going on with your main installation while working on this. I think GitHub doesn't allow to re-open this as soon as I close it, but feel free to ping me here or IRC and I'll reopen it for you when you have the code in a better shape, if you don't want to open a new one. Thanks a lot for your hard work. |
|
No worries @calavera. Unfortunately I ran myself out of time for this for now. I was able to run the tests but I was hitting a specific problem. Maybe enough time has elapsed / development has happened that now it's no longer a problem. I can see that other things have happened in the meantime, and #21020 is in flight. It looks like my concerns may become addressed without too much further input from me, which is great. I'll try and find the time to feed back some performance numbers there too. All the best. |
|
Filed #26816 |
This is a followup to #20088, and a project I wrote which shows the context of the docker context.
Headline figure: This reduces the
docker buildruntime for a largish project of mine by 10x:To:
(That's a 100x CPU speedup!).
Detail: I have 14,000 files across 2GiB, with 18 .dockerignore instructions. It turns out that the old implementation was compiling a regular expression for every 14,000 * 18, an profiling showed it spent the majority of time there.
For a no-op docker build itself, it reduces from:
To:
Which is more modest, but only the case because docker's
.dockerignorehas only three lines in it.I'm sending this PR for early review now. There is still a bit more work to be done, and a few broader implications to check as well. I could use some help there. Also I note that the logic is implemented by a few other projects (docker-compose interests me in particular) and I guess it would be good to get the logic to be the same there too at some point.
There is still a bit more work to do, including: