-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Jib sample #1147
Jib sample #1147
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1147 +/- ##
=======================================
Coverage 41.45% 41.45%
=======================================
Files 95 95
Lines 4229 4229
=======================================
Hits 1753 1753
Misses 2305 2305
Partials 171 171 Continue to review full report at Codecov.
|
ping @coollog @briandealwis Do you think this is ok? |
7c0b776
to
a8197b0
Compare
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 assumed the integration
is just duplicate?
examples/annotated-skaffold.yaml
Outdated
@@ -61,6 +61,15 @@ build: | |||
# bazel: | |||
# target: //:skaffold_example.tar | |||
|
|||
# jibMaven is an artifacts built with Maven, typically (but not only) a Java project. |
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.
nit: artifacts
should be singular, or is for artifacts
. Could I suggest the following?
# jibMaven builds containers using the Jib plugin for Maven
Do you see this file as being documentation? Is it worth adding some detail about the module
and profile
items?
examples/annotated-skaffold.yaml
Outdated
# module: modulename | ||
# profile: profilename | ||
|
||
# jibGradle is an artifacts built with Gradle, typically (but not only) a Java project. |
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.
And ditto re: artifacts
or the suggested rewrite.
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'll rewrite it
examples/jib/pom.xml
Outdated
<version>0.9.11</version> | ||
<configuration> | ||
<from> | ||
<image>gcr.io/distroless/java@sha256:b430543bea1d8326e767058bdab3a2482ea45f59d7af5c5c61334cd29ede88a1</image> |
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.
Why did you choose a specific tag, as opposed to :latest
?
@briandealwis I took your feedback into account. |
examples/annotated-skaffold.yaml
Outdated
@@ -61,6 +61,15 @@ build: | |||
# bazel: | |||
# target: //:skaffold_example.tar | |||
|
|||
# jibMaven builds containers using the Jib plugin for Maven. | |||
# jibMaven: | |||
# module: modulename # selects which maven module to build |
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.
for a multimodule project
<configuration> | ||
<container> | ||
<jvmFlags> | ||
<jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag> |
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.
Why the /./
?
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.
Because of a funny bug: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6202721
[Jib](https://github.com/GoogleContainerTools/jib) builds Docker and OCI images | ||
for your Java applications and is available as plugins for Maven and Gradle. | ||
|
||
The way you configure it in `skaffold.yaml` is the following build stanza: |
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 think it's worth mentioning that this example is for a standalone Maven project, where all dependencies are resolved from outside. The Jib builder requires that the projects are configured to use the Jib plugins for Maven or Gradle. Multi-module builds require a bit additional configuration.
hello ! I've tried to run the samples
and then
Using debug logs, I had :
|
ok, so I found and fixed my mistakes :
To fix that one, I just needed to remove the tag after my image name(replacing So I got it working and I could display a brilliant "Hello Anthony" after updating the HelloController :-) |
I have 1 question though : I've seen in the source code, that's it's possible to append profiles, using, for example :
Can we also pass -D vm arguments as well ? |
Not at the moment. You can define Maven properties in a profile. And we don't actually validate the profile value so you should be able to specify multiple profile IDs by separating them with commas. What are you trying to do? |
That would not be convenient to create a profile for each VM argument or their combinations... |
Thank you @anthonydahanne for the feedback. I'll create a ticket for the image name. |
One possible workaround (of sorts) is to use environment variables. You can also activate a profile with an environment variable. It may make sense for Skaffold to expose some information as to the build mode. For example, that |
examples/annotated-skaffold.yaml
Outdated
@@ -61,6 +61,15 @@ build: | |||
# bazel: | |||
# target: //:skaffold_example.tar | |||
|
|||
# jibMaven builds containers using the Jib plugin for Maven. | |||
# jibMaven: | |||
# module: modulename # selects which maven module to build |
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.
Should we leave this out for now? (Since it's currently unimplemented)
<configuration> | ||
<container> | ||
<jvmFlags> | ||
<jvmFlag>-Djava.security.egd=file:/dev/./urandom</jvmFlag> |
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.
Perhaps we should also just include the other container-enabling JVM flags here too:
<jvmFlag>-XX:+UnlockExperimentalVMOptions</jvmFlag>
<jvmFlag>-XX:+UseCGroupMemoryLimitForHeap</jvmFlag>
@GoogleContainerTools/java-tools should be ready for review |
Something is maybe flaky with kaniko local mode |
9b5d41e
to
d75a792
Compare
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
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.
LGTM
No description provided.