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

base-job-image: automatic image cleanup #1636

Merged
merged 12 commits into from
Feb 17, 2023

Conversation

mivanov1988
Copy link
Contributor

@mivanov1988 mivanov1988 commented Feb 14, 2023

Why

Currently, the base job image contains a lot of binaries/executables (including the package manager) which increases the attack surface of the data job.

What

Integrated docker-slim in order to reduce the number of binaries/executables. Docker-slim analyzes the image and produces a much cleaner one based on the application usage.

Testing done

Local execution of docker-slim and CI/CD - https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/3768967625.

Signed-off-by: Miroslav Ivanov miroslavi@vmware.com

@mivanov1988 mivanov1988 changed the title [DRAFT] job-builder: integrate docker-slim base-job-image: automatic image cleanup Feb 15, 2023
@doks5
Copy link
Contributor

doks5 commented Feb 15, 2023

Is the gradle jar necessary?

@mivanov1988
Copy link
Contributor Author

Is the gradle jar necessary?

No, it is not. Thanks!

@antoniivanov
Copy link
Collaborator

Local execution of docker-slim and CI/CD - https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/3768967625.

If I understand correctly (IIUC) , this tests the creation of the image.
But how can we test its usage ? Basically that control service can use it to build jobs ?

WIth a lot of job-builder images (2 or 3) we need some way to deploy them and run them. Have you thought about that ?

@mivanov1988
Copy link
Contributor Author

mivanov1988 commented Feb 16, 2023

Local execution of docker-slim and CI/CD - https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/3768967625.

If I understand correctly (IIUC) , this tests the creation of the image. But how can we test its usage ? Basically that control service can use it to build jobs ?

WIth a lot of job-builder images (2 or 3) we need some way to deploy them and run them. Have you thought about that ?

It does not test the image, it produces a cleaner one. The testing strategy remains the same through the pre_release_test phase.

@mivanov1988 mivanov1988 enabled auto-merge (squash) February 16, 2023 13:23
@mivanov1988 mivanov1988 merged commit 84062be into main Feb 17, 2023
@mivanov1988 mivanov1988 deleted the person/miroslavi/integrate-docker-slim branch February 17, 2023 13:18
@antoniivanov
Copy link
Collaborator

antoniivanov commented Feb 17, 2023

It does not test the image, it produces a cleaner one. The testing strategy remains the same through the pre_release_test phase.

In pre_release_test we test against deployed version of the control service and that version uses data-job-base-python-3.7 base image and not this one. Which means this image is not tested.

I think we need a strategy for testing it. Until then we should consider the image in development only really (dev version - 0.y.z).

@mivanov1988
Copy link
Contributor Author

I think we are ready to switch to the secure one.

ivakoleva pushed a commit that referenced this pull request Feb 20, 2023
# Why
Currently, the base job image contains a lot of binaries/executables
(including the package manager) which increases the attack surface of
the data job.

# What
Integrated [docker-slim](https://github.com/slimtoolkit/slim) in order
to reduce the number of binaries/executables. Docker-slim analyzes the
image and produces a much cleaner one based on the application usage.

# Testing done
Local execution of docker-slim and CI/CD -
https://gitlab.com/vmware-analytics/versatile-data-kit/-/jobs/3768967625.

Signed-off-by: Miroslav Ivanov miroslavi@vmware.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants