-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow to use jib instance as base-image in multi-project builds #1807
Comments
Is this different from #1778 and #1756? What are the differences? I think I got a vague picture, but with all these 3 issues, I really have hard time digesting all the information that touches a lot of aspects that all seem related but speak something slightly different. @loosebazooka may have understood all of these, but I don't really have great expertise in Gradle, so I think it would also help if you separate 1) what are the concrete changes necessary in Jib in a bit concise manner; and 2) the background/overview/rationale for the changes. And if you have multiple potential ideas for (1), it would help if you list them in a more clear way. |
three very different tickets I would say. Seperating build from publishing is a general Gradle convetion (#1756) and is of importance in various areas like up-to-date checking. If one does #1778 one could start "hack" this ticket into jib manually without direct support (assuming that further classpath manipulation are added as well to add the JARs from the base image again). Question would be whether there is a desire to support more advanced layering in Jib that go beyond more basic/single-project builds or whether project should move to the use of jib-core for custom builds or alternatives. There are various questions related to layering floating around, but a solution has been unclear as of yet. This here would be a proposal without having to go into the details of Docker. I added a little example to the issue description how we currently consume/produce 750 MB rather than around 100 MB of layer data due to the lack of multi-project support, filling-up our Docker registries and slowing down the builds. So something in the area would be great to have. And I guess Gradle multi-project builds are quite common nowadays. I also refined the steps to implement it a bit in the issue description. |
@remmeier Can you provide a more concrete example of what you're doing? It's not super clear on what you're trying to do that cannot be solved using current gradle mechanisms. |
Our application looks like:
Gradle up-to-date checking, caching, size of build artifacts and incremental updates of Kubernetes are one of our primary concerns/goals in the area to make it efficiently even tough the project is larger in size. We do not want to split up the project into many small parts and have to start versioning and manage them independently as it would drastically increase our efforts. Over the past months I created a number of tickets to make it work. It works in general, but the little things still hurt. This one being a primary one. |
close as not planned |
This is a follow-up on #1436 (Optimize Layering for Multi-Project Setups). In Gradle multi-project people typically build and deploy many (micro)services. Accordingly many Docker images are being built. In most cases those images will share a great amount of the techstack and only differ in the business functionality. Accordingly it would make sense to introduce a shared base layer holding third-party dependencies that are shared by all projects, whereas the individual projects only hold the delta to those base images. This could look like:
whereas
service-base
holds all the third-party dependencies necessary for the various projects. This would trigger for a service project:service-base
as base layer of the Docker image (no need to specify one)jib
setup proper dependencies.service-base
to fetch the built artifacts.The jib instance in
service-base
would be a regular jib instance.Layering of Docker images has been discussed in other tickets like #403. While a simple/pragmatic solution has been implemented, it does fully address the brought up issues that desires to have more control of the layering. With this ticket here rather advanced layering can be setup transparently in a traditional "Gradle/Maven-way" without having to deal with inner workings of Docker layering or having to manually specify which third-party libraries go into which layer.
as a further benefit the multiple jib instances automatically will be "in-sync" in terms of caching, whereas the actual base layer (some JRE image) will only be downloaded once by
service-base
.The text was updated successfully, but these errors were encountered: