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

Can one use Kaniko with a RAMdisk to improve snapshotting performance? #1310

Open
jae-63 opened this issue Jun 10, 2020 · 2 comments
Open

Can one use Kaniko with a RAMdisk to improve snapshotting performance? #1310

jae-63 opened this issue Jun 10, 2020 · 2 comments
Labels
area/performance issues related to kaniko performance enhancement kind/question Further information is requested priority/p3 agreed that this would be good to have, but no one is available at the moment.

Comments

@jae-63
Copy link

jae-63 commented Jun 10, 2020

Hi,

We use Kaniko within Gitlab (using our own GItlab environment and GItlab runner, all within AWS/EKS) to build some fairly complex Docker images. We've recently observed that the "snapshotting" which Kaniko performs makes it impractical to build our most complex Docker image, because it takes too long to run. Within Gitlab, we run Kaniko by invoking '/kaniko/executor' and we're currently using gcr.io/kaniko-project/executor:debug

That Gitlab runner is already using an SSD for /var/lib/docker but we wonder if we could obtain better performance if we used a RAMdisk for the portions of the filesystem which Kaniko is snapshotting.

Our initial analysis suggests that Kaniko might be snapshotting '/' but hopefully that's incorrect.

Can you advise us which filesystems we should use RAMdisks for? Perhaps there's a way to configure this in our /kaniko/.docker/config.json file ? And perhaps we can mount a RAMdisk volume from the Gitlab runner.

Thanks.

@tejal29
Copy link
Contributor

tejal29 commented Jun 13, 2020

@jae-63 Kaniko does snapshot "". Kaniko reads the mount info and ignores mounted filesystems.
I recently created an optimized images with 2 strategies,

  1. Using a fast snapshotting strategy. - does not involving hashing the contents.
  2. Use another implementation run command which does not rely on snapshotting.

Please see the details here #1305

Irrespective of these, Kaniko would walk the filesystem "/" to determine file changes.

@tejal29 tejal29 added the area/performance issues related to kaniko performance enhancement label Jun 13, 2020
@mitar
Copy link

mitar commented Jan 27, 2021

I am interested in this as well. I can configure GitLab CI to use a ramdisk for the build directory where it clones the project and I can then set that as context. But I am not sure where does kaniko then write files during the build process?

@aaron-prindle aaron-prindle added kind/question Further information is requested priority/p3 agreed that this would be good to have, but no one is available at the moment. labels Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/performance issues related to kaniko performance enhancement kind/question Further information is requested priority/p3 agreed that this would be good to have, but no one is available at the moment.
Projects
None yet
Development

No branches or pull requests

4 participants