Skip to content
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

feat(build): Task-based builds #1121

Merged
merged 13 commits into from
Dec 18, 2019
Merged

feat(build): Task-based builds #1121

merged 13 commits into from
Dec 18, 2019

Conversation

astefanutti
Copy link
Member

@astefanutti astefanutti commented Dec 5, 2019

Move to a task-based build API. This enables decoupling the build scheduling logic from the actual build logic.

This brings more flexibility in the way build logic gets scheduled and executed. For example, tasks can be scheduled using init-containers, hence removing the requirement of relying on persistent volumes to coordinate inputs and outputs of sequential tasks.

Fixes #1069. It enables to use an emptyDir volume to coordinate the Camel Maven build and the Kaniko image build, instead of relying on the creation of a persistent volume claim.

It disables the execution of the Kaniko cache warmer pod, as it seems unreliable with the current Kaniko version and requires relying on a persistent volume. For information, here is the penalty of disabling the cache for the duration of integration kit builds:

$ kubectl get builds.camel.apache.org 
NAME             PHASE       AGE   STARTED   DURATION         ATTEMPTS
kit-route-rest   Succeeded   15m   15m       1m8s    
kit-simple       Succeeded   10m   10m       1m16s   

without caching:

$ kubectl get builds.camel.apache.org 
NAME             PHASE       AGE   STARTED   DURATION         ATTEMPTS
kit-route-rest   Succeeded   15m   15m       3m42s    
kit-simple       Succeeded   10m   10m       3m47s   

This incidentally cleans-up the build API. It removes the embedded integration platform struct from the build CR.

TODO:

  • Define tasks build API
  • Create build tasks for kit builds
  • Adapt build pod scheduling
  • Adapt build routine scheduling
  • Create S2I task API (Postponed to a subsequent PR)

Release Note

feat(build): Task-based builds
fix(build): Use EmptyDir volumes for Kaniko builds when caching is disabled 
fix(build): Disable Kaniko cache by default

@astefanutti astefanutti added area/build-operator Related to the internal image build operator kind/feature New feature or request labels Dec 5, 2019
@astefanutti astefanutti added this to the 1.0.0-CR1 milestone Dec 5, 2019
@nicolaferraro
Copy link
Member

Seems much cleaner. Should we have also a S2I take type later?

Some ideas on running multiple containers that share data from latest Kubecon: https://youtu.be/iz9_omZ0ctk?t=446

@astefanutti
Copy link
Member Author

Seems much cleaner. Should we have also a S2I take type later?

I think so yes.

@astefanutti astefanutti marked this pull request as ready for review December 11, 2019 18:05
Copy link
Member

@nicolaferraro nicolaferraro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Impressive work. You've also removed the requirement for PVC!

APIs are nicer and much more extensible.

@nicolaferraro
Copy link
Member

Can you check conflicts @astefanutti ?

@astefanutti
Copy link
Member Author

@nicolaferraro Sure, I'm on it.

@astefanutti
Copy link
Member Author

astefanutti commented Dec 18, 2019

I've pushed d10606f so that an emptyDir volume is always used for the build, and that isolates the persistent volume to the sole use of Kaniko image caching.

@nicolaferraro nicolaferraro mentioned this pull request Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build-operator Related to the internal image build operator kind/feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove requirement for PVC on vanilla Kube
2 participants