-
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
[Proposal] CBI: Container Builder Interface (Docker, BuildKit, Buildah, kaniko, img, Google Cloud Container Builder, OpenShift Source-to-Image...) #596
Comments
Nice! A few overall questions. What does cbi currently require to run in the cluster? Is there any type of daemon, or is the whole lifecycle managed during a single build? The cbi types are currently v1alpha1. How much do you expect these to change? |
Yes, there is a CRD controller daemon called Flow:
Likely to change, and proposals for changes are highly welcome 😃 . For v1alpha1, I'm likely to add:
For breaking changes, I will bump-up the API version e.g. Please be noted that bump-up of CBI API version does not require bump-up of Skaffold API version. |
I like this idea. I think we'll have to think through our artifact-builder compatibility matrix finally (not all artifact types can be built with all builders) and how we reconcile our existing GCB and Kaniko integrations with the ones in the CBI, but I don't see those as blockers. |
The existing Scaffold-native builders can be kept and are still useful for those don't want CBI dependency. |
@AkihiroSuda what do you think about just accepting a CBI yaml file instead of the full spec? apiVersion: skaffold/v1alpha2
kind: Config
build:
artifacts:
- imageName: gcr.io/k8s-skaffold/skaffold-example
workspace: .
s2i: {}
cbi:
buildJobTemplate: cbi.yaml |
SGTM. Maybe we can have both |
@AkihiroSuda sorry the delay in getting back to you. We'd happily accept a PR for either |
Thanks! I will open PR, probably after DockerCon. |
Sorry for delay, but before opening the PR, let me look into whether we can consolidate into Knative: knative/build#284 |
As Knative Build (#851) turned our to share the same goal as CBI, I'm closing this proposal and going to port over CBI features to Knative Build. |
I'm working on a project called CBI (Container Builder Interface), which provides a vendor-neutral interface for building container images on top of a Kubernetes cluster: https://github.com/containerbuilding/cbi
The following plugins are implemented so far:
cloudbuild.yaml
docker
buildkit
buildah
kaniko
img
gcb
s2i
I'd like to propose adding CBI support to build-related tools such as Skaffold, so that new builders and artifact languages can be easily integrated to these tools without reinventing the wheel.
Integration to Skaffold
Here is a POC of CBI integration to Skaffold, with some examples: AkihiroSuda@55fb5ed
examples/getting-started
: Dockerfile + CBI BuildKit pluginThe
cbi
builder requiresbuild.cbi.buildJobTemplate
to be set to a template of CBIBuildJob
CRD ( https://github.com/containerbuilding/cbi/blob/master/pkg/apis/cbi/v1alpha1/types.go ).Usually, a user only needs to set
build.cbi.buildJobTemplate.spec.registry.secretRef.name
to be a name of Docker registry secret created withkubectl create secret docker-registry ...
.Other fields are set automatically.
The user can also set
...spec.pluginSelector
to specify the CBI plugin explicitly.The workspace is uploaded to a temporary nginx on the Kubernetes cluster using
kubectl cp
.(So, unlike the standard Skaffold kaniko builder, CBI kaniko plugin does not require GCS.)
As CBI supports several build context providers such as Git, GCS, S3, SFTP, WebDAV, and even Dropbox (by using Rclone), we could also instrument Skaffold+CBI to access such remote workspaces.
examples/cbi-s2i
: OpenShift Source-to-Image artifact + CBI S2I pluginCBI can also support non-Dockerfile artifact language as the OpenShift S2I (#518) example above.
We could also add Bazel (on cluster)/Box/Jib support to CBI. (#479 #241 #241 )
cc @r2d4 @dlorenc @mattmoor
The text was updated successfully, but these errors were encountered: