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

WIP: Check if storage driver is overlay2 before preload #7628

Closed
wants to merge 1 commit into from

Conversation

afbjorklund
Copy link
Collaborator

For #7626

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 12, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested review from blueelvis and RA489 April 12, 2020 08:11
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 12, 2020
@codecov-io
Copy link

Codecov Report

Merging #7628 into master will decrease coverage by 0.04%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7628      +/-   ##
==========================================
- Coverage   36.49%   36.44%   -0.05%     
==========================================
  Files         147      147              
  Lines        9139     9150      +11     
==========================================
  Hits         3335     3335              
- Misses       5416     5427      +11     
  Partials      388      388              
Impacted Files Coverage Δ
pkg/minikube/download/preload.go 0.00% <0.00%> (ø)

@@ -91,6 +94,22 @@ func PreloadExists(k8sVersion, containerRuntime string) bool {
return false
}

cmd := exec.Command("docker", "info", "-f", "{{.Info.Driver}}")
Copy link
Member

Choose a reason for hiding this comment

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

lets use the oci.DaemonInfo for this (add the storage driver to it)
(we can later make that a cached call so we dont have to keep calling it)

also lets try to download the image for that driver
if that driver doesnt exist then dont preload
(we have the storage driver in the filename) so that shoudl make it easy.

so in the future if we mmake preload images for that storage driver we can suppor it
#7626 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

here is the link for DaemonInfo

I believe u could update the struct with the new format, so the Storage Driver be unmarshalized into it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@afbjorklund
Copy link
Collaborator Author

The current code is just to stop minikube from killing docker (the current behavior)

Adding a working cache for non-overlayfs2 requires more work, and might not be doable
(for instance with some drivers - like dm, the actual content was kept on another partition)

So it was not part of this PR. Could use the so called "oci" DaemonInfo, though.

@afbjorklund afbjorklund changed the title Check if storage driver is overlay2 before preload WIP: Check if storage driver is overlay2 before preload Apr 12, 2020
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 12, 2020
@medyagh
Copy link
Member

medyagh commented Apr 12, 2020

The current code is just to stop minikube from killing docker (the current behavior)

Adding a working cache for non-overlayfs2 requires more work, and might not be doable
(for instance with some drivers - like dm, the actual content was kept on another partition)

So it was not part of this PR. Could use the so called "oci" DaemonInfo, though.

I agree adding new storage should not be part of this PR,
what I meant was
we should check for the existance of the URL (which includes the storage driver in the filename) if the URL (with correct storage driver) doesnt exist then we will skip preload.

@afbjorklund
Copy link
Collaborator Author

Need to make sure it is using the correct docker daemon, when determining storage driver...

In this case, the none driver was using aufs but the docker driver was using overlay2

@medyagh
Copy link
Member

medyagh commented Apr 12, 2020

Need to make sure it is using the correct docker daemon, when determining storage driver...

In this case, the none driver was using aufs but the docker driver was using overlay2

do you mean pointing to the Docker on the user's system and not inside minikube ? if thats what you mean, we have a func "PointToHostDockerDaemon()" that we run during init

do you mean the Docker inside Docker should use the same storage driver as the Host ? (if yes why ? is it there evidence it doesnt work ? )

@afbjorklund
Copy link
Collaborator Author

do you mean the Docker inside Docker should use the same storage driver as the Host ? (if yes why ? is it there evidence it doesnt work ? )

It is fine if we hardcode the internal storage driver, but the external one could be anything...

@tstromberg
Copy link
Contributor

What do we need to move this PR forward?

@afbjorklund
Copy link
Collaborator Author

What do we need to move this PR forward?

I got confused half-way through the implementation...

I thought that we could continue with hardcoding the internal storage driver (to overlay2) and let the user choose whatever external storage driver they want... But it turns out that if you pick an odd outer storage, that could limit your internal options (to something basic like vfs). So we probably need to re-visit this, and have it silently fallback to not use any preloads in such cases ?

@tstromberg
Copy link
Contributor

Closing until we're sure what to do with this. Please feel free to /reopen once clarity can be achieved.

@tstromberg tstromberg closed this May 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants