-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
control-service: job-builder uisng kaniko fix
The way we are preparing our job-builder image is like this: ``` FROM gcr.io/kaniko-project/executor FROM alpine COPY --from=0 /kaniko /kaniko ``` This is apparently known issue : https://github.com/GoogleContainerTools/kaniko#known-issues > Running kaniko in any Docker image other than the official kaniko image is not supported (ie YMMV). > This includes copying the kaniko executables from the official image into another image. So instead making sure we built from kaniko image directly should fix the issue See #2391 Google Java Format control-service: job-builder uisng kaniko fix
- Loading branch information
1 parent
d471dd4
commit 09955b0
Showing
12 changed files
with
281 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,11 @@ | ||
# Used to trigger a build for a data job image. | ||
|
||
FROM gcr.io/kaniko-project/executor | ||
|
||
FROM alpine | ||
|
||
COPY --from=0 /kaniko /kaniko | ||
|
||
|
||
ENV PATH $PATH:/kaniko | ||
ENV SSL_CERT_DIR=/kaniko/ssl/certs | ||
ENV DOCKER_CONFIG /kaniko/.docker/ | ||
FROM gcr.io/kaniko-project/executor:debug | ||
|
||
WORKDIR /workspace | ||
|
||
COPY Dockerfile.python.vdk /workspace/Dockerfile | ||
COPY build_image.sh /build_image.sh | ||
RUN chmod +x /build_image.sh | ||
|
||
|
||
# Setup Python and Git | ||
## Update & Install dependencies | ||
RUN apk add --no-cache --update \ | ||
git \ | ||
bash | ||
|
||
RUN apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.10/main python3=3.7.10-r0 py3-pip \ | ||
&& pip3 install awscli \ | ||
&& apk --purge -v del py3-pip \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
ENTRYPOINT ["/build_image.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
# Job Builder | ||
This package provides a way to configure and build your own Data Job images. | ||
|
||
Job Builder is a component that helps the Control Service build data job images. | ||
It forms an essential part of the setup and installation of the Control Service and is used by Control Service Deployment APIs. | ||
|
||
See [this activity diagram for reference](https://www.plantuml.com/plantuml/svg/bP9FJzj04CNl_XHFzD0WjLyW7CgVeAeKgGWgSTxOOpDbFUFExaAjgj-ztcnZGGX8lIIhdNc_UM_Mno4wYwdtLRXd6Pov7YTrv0UE8tvN073gwllED4bpfbuDtvFzJCg1IbMj8IkLKp-rLd-gFQmLkrwbUGLvoTrTFFNfBMJsMLNLyYOVi4xi6vOEZOiEFtGDxbr7HnMtMAoK0XnMkNInBO5-SOXerH3lE6JD-u07ii0gdmwdIn8iHWg76nFlhfodpqOao_CipBCAfys-Fo147J2OrXJ2qKQIRohoWR0GBPJbcPEQFEWVelWcAuvRS9myM1APQWMI_NE0KJSfR4GS1yB9xGqEpi-k3vxvH1QKAKOk4gOEr2hHiP31QD30KIT82KtpiigevrP96cwBwKkNfBw3Wz1ZSGmLV4rhCg580IbCVZCnmpvkCvKNm1pZreLj3mebf3glgqt-vS9tbdunYshj1q-HdihzUBHFjABScCbF5rrQvnTw4RrG1fRx9Quf6jC3mMiNeEthB6uNNqe-CbD3xLAW1kjnSvVjVtiKih0dwSxC6v86ef5RhbrabGchEvHvxawGdJ3_HR_oBhPgFKwQdkNj4VF7KKxbztZwIxt_2m00) | ||
|
||
The Data Job Build process goes over those steps: | ||
1. It uses Git to fetch the data job source code for given version (git commit) | ||
- Each top level folder in the Git repo represents a single data job | ||
2. It installs required python dependecies of the job found in requirements.txt in job's root directory | ||
3. It uses Kaniko to build the Data Job Docker image and push it to a container registry. | ||
|
||
Upon failure the Control Service inspects the logs for errors.It looks specifacally for | ||
- logs containing `>requirements_failed<` indicating it fails to install a job python requirement | ||
- logs containing `>data-job-not-found<` or `failed to get files used from context` indicating user is trying to deploy job that no longer exists | ||
|
||
In both cases it reports user error and sends notification to job owners (if such are configured) | ||
|
||
In all other cases it sends notifications to Control Service administrators | ||
|
||
## Installation | ||
|
||
To install the job-builder-image, you would configure it in the Control Service usually in production using helm chart. | ||
|
||
In helm chart `deploymentBuilderImage` configuration options control which builder image is used. | ||
[More details here](https://github.com/vmware/versatile-data-kit/blob/main/projects/control-service/projects/helm_charts/pipelines-control-service/values.yaml#L51) | ||
|
||
Locally for debugging purposes you can run it with `docker run` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.3.3 | ||
1.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.