-
Notifications
You must be signed in to change notification settings - Fork 345
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
Refactor build, deploy and run workflow #107
Conversation
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.
Generally it seems ok. If it works, I can start from this to separate classpath computation from image publishing and to define different strategies for the latter..
@@ -1,9 +1,12 @@ | |||
apiVersion: camel.apache.org/v1alpha1 | |||
kind: IntegrationContext | |||
metadata: | |||
name: root.integrationcontexts.camel.apache.org | |||
name: core.integrationcontexts.camel.apache.org |
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 not just "core"?
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 it's too simple :)
let me do some cleanup |
23fb6d5
to
4238889
Compare
context with dependencies: $ oc get ictx groovy -o yaml
apiVersion: camel.apache.org/v1alpha1
kind: IntegrationContext
metadata:
clusterName: ""
creationTimestamp: 2018-09-20T15:36:35Z
generation: 0
labels:
app: camel-k
camel.apache.org/context.created.by.kind: Operator
camel.apache.org/context.created.by.name: core
camel.apache.org/context.type: platform
name: groovy
namespace: camel-k
resourceVersion: "179138"
selfLink: /apis/camel.apache.org/v1alpha1/namespaces/camel-k/integrationcontexts/groovy
uid: f4cc58fc-bcea-11e8-97bd-525400eed8b1
spec:
classpath:
- id: org.apache.camel.k:camel-k-runtime-jvm:jar:0.0.3-SNAPSHOT
location: /tmp/artifacts/m2/org/apache/camel/k/camel-k-runtime-jvm/0.0.3-SNAPSHOT/camel-k-runtime-jvm-0.0.3-SNAPSHOT.jar
- id: org.slf4j:slf4j-api:jar:1.7.25
location: /tmp/artifacts/m2/org/slf4j/slf4j-api/1.7.25/slf4j-api-1.7.25.jar
- id: org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.0
location: /tmp/artifacts/m2/org/apache/logging/log4j/log4j-slf4j-impl/2.11.0/log4j-slf4j-impl-2.11.0.jar
- id: org.apache.logging.log4j:log4j-api:jar:2.11.0
location: /tmp/artifacts/m2/org/apache/logging/log4j/log4j-api/2.11.0/log4j-api-2.11.0.jar
- id: org.apache.logging.log4j:log4j-core:jar:2.11.0
location: /tmp/artifacts/m2/org/apache/logging/log4j/log4j-core/2.11.0/log4j-core-2.11.0.jar
- id: org.jooq:joor-java-8:jar:0.9.9
location: /tmp/artifacts/m2/org/jooq/joor-java-8/0.9.9/joor-java-8-0.9.9.jar
- id: commons-io:commons-io:jar:2.6
location: /tmp/artifacts/m2/commons-io/commons-io/2.6/commons-io-2.6.jar
- id: org.apache.commons:commons-lang3:jar:3.8
location: /tmp/artifacts/m2/org/apache/commons/commons-lang3/3.8/commons-lang3-3.8.jar
- id: org.apache.camel:camel-core:jar:2.22.1
location: /tmp/artifacts/m2/org/apache/camel/camel-core/2.22.1/camel-core-2.22.1.jar
- id: com.sun.xml.bind:jaxb-core:jar:2.3.0.1
location: /tmp/artifacts/m2/com/sun/xml/bind/jaxb-core/2.3.0.1/jaxb-core-2.3.0.1.jar
- id: com.sun.xml.bind:jaxb-impl:jar:2.3.0.1
location: /tmp/artifacts/m2/com/sun/xml/bind/jaxb-impl/2.3.0.1/jaxb-impl-2.3.0.1.jar
- id: org.apache.camel:camel-groovy:jar:2.22.1
location: /tmp/artifacts/m2/org/apache/camel/camel-groovy/2.22.1/camel-groovy-2.22.1.jar
- id: org.codehaus.groovy:groovy-all:jar:2.4.15
location: /tmp/artifacts/m2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.jar
dependencies:
- camel:core
- camel:groovy
status:
digest: vTA1Ab9PkI7TjboutWhUsury6fw-NYeOzlzHNUfydMfw
image: 172.30.1.1:5000/camel-k/camel-k-context-groovy:179015
phase: Ready |
classpath file content:
|
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.
Really good! Just few comments, mainly for clarification..
pkg/apis/camel/v1alpha1/types.go
Outdated
@@ -125,6 +125,7 @@ type IntegrationContext struct { | |||
// IntegrationContextSpec -- | |||
type IntegrationContextSpec struct { | |||
Dependencies []string `json:"dependencies,omitempty"` | |||
Classpath []ClasspathEntry `json:"classpath,omitempty"` |
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 move this to "status"? I don't think it's something the user should set. It's computed from the dependencies.
pkg/apis/camel/v1alpha1/types.go
Outdated
// ClasspathEntry -- | ||
type ClasspathEntry struct { | ||
ID string `json:"id" yaml:"id"` | ||
Location string `json:"location,omitempty" yaml:"location,omitempty"` |
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.
We store both the ID and the relative location?
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.
Or that is intended to be the location in the m2 repo in the builder pod? (or both?)
<modelVersion>4.0.0</modelVersion> | ||
<packaging>maven-plugin</packaging> | ||
|
||
<artifactId>camel-k-runtime-dependency-lister</artifactId> |
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 we can give it a more generic name and reuse it for other tasks (in the future, not necessarily now). E.g. "camel-k-runtime-meta-plugin".
I'm thinking e.g. to have a mojo that extract info on the route (to be called out-of-band respect to image build), in order to have full info about the route and then apply the optimizations we talked about in the dev mailing list. Just thinking..
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.
agree, feel free to rename it :)
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.
Awesome
@nicolaferraro here the new context: apiVersion: camel.apache.org/v1alpha1
kind: IntegrationContext
metadata:
clusterName: ""
creationTimestamp: 2018-09-20T16:17:00Z
generation: 0
labels:
app: camel-k
camel.apache.org/context.created.by.kind: Operator
camel.apache.org/context.created.by.name: core
camel.apache.org/context.type: platform
name: groovy
namespace: camel-k
resourceVersion: "182724"
selfLink: /apis/camel.apache.org/v1alpha1/namespaces/camel-k/integrationcontexts/groovy
uid: 9a9901a5-bcf0-11e8-97bd-525400eed8b1
spec:
dependencies:
- camel:core
- camel:groovy
status:
classpath:
- org.apache.camel.k:camel-k-runtime-jvm:jar:0.0.3-SNAPSHOT
- org.slf4j:slf4j-api:jar:1.7.25
- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.0
- org.apache.logging.log4j:log4j-api:jar:2.11.0
- org.apache.logging.log4j:log4j-core:jar:2.11.0
- org.jooq:joor-java-8:jar:0.9.9
- commons-io:commons-io:jar:2.6
- org.apache.commons:commons-lang3:jar:3.8
- org.apache.camel:camel-core:jar:2.22.1
- com.sun.xml.bind:jaxb-core:jar:2.3.0.1
- com.sun.xml.bind:jaxb-impl:jar:2.3.0.1
- org.apache.camel:camel-groovy:jar:2.22.1
- org.codehaus.groovy:groovy-all:jar:2.4.15
digest: vTA1Ab9PkI7TjboutWhUsury6fw-NYeOzlzHNUfydMfw
image: 172.30.1.1:5000/camel-k/camel-k-context-groovy:182662
phase: Ready |
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.
Very nice!
removed:
mvn dependency:copy-dependencies
improved:
new things:
mvn dependency:build-classpath
notes:
run-java.sh
appears to have troubles in caseJAVA_APP_JAR
is not set/tmp/artifacts/m2
to runtime/runtime/m2