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

provisioner: only reload docker if necessary, don't install curl #7115

Merged
merged 2 commits into from
Mar 20, 2020

Conversation

tstromberg
Copy link
Contributor

@tstromberg tstromberg commented Mar 20, 2020

This modernizes the provisioner in three important ways:

  • Only calls systemctl reload/restart if docker file has been updated - fixes docker: excessive systemctl reload/restarts #7103
  • Adds it's own NewSystemdProvisioner to avoid unnecessary apt-get commands to install curl.
  • Uses glog for consistency with rest of minikube codebase

This PR improves "minikube start" performance on an already running cluster by a second or so.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 20, 2020
@tstromberg tstromberg changed the title Only restart docker service if unit file has updated provisioner: Only restart docker service if unit file has updated Mar 20, 2020
@tstromberg tstromberg changed the title provisioner: Only restart docker service if unit file has updated provisioner: Only reload docker if unit file changed Mar 20, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tstromberg

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 20, 2020
@tstromberg tstromberg changed the title provisioner: Only reload docker if unit file changed provisioner: Only reload systemctl/docker if unit has changed Mar 20, 2020
@tstromberg tstromberg changed the title provisioner: Only reload systemctl/docker if unit has changed provisioner: Only reload docker if unit has changed Mar 20, 2020
@tstromberg tstromberg changed the title provisioner: Only reload docker if unit has changed Make the provisioner do less unnecessary work Mar 20, 2020
@tstromberg tstromberg changed the title Make the provisioner do less unnecessary work provisioner: only reload docker if necessary, don't install curl Mar 20, 2020
@codecov-io
Copy link

Codecov Report

Merging #7115 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7115      +/-   ##
==========================================
- Coverage   37.19%   37.14%   -0.05%     
==========================================
  Files         146      146              
  Lines        9106     9118      +12     
==========================================
  Hits         3387     3387              
- Misses       5303     5315      +12     
  Partials      416      416              
Impacted Files Coverage Δ
pkg/minikube/machine/client.go 38.46% <ø> (ø)
cmd/minikube/cmd/docker-env.go 37.30% <0.00%> (-1.87%) ⬇️
cmd/minikube/cmd/start.go 37.31% <0.00%> (-0.39%) ⬇️

@tstromberg
Copy link
Contributor Author

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 20, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

@afbjorklund
Copy link
Collaborator

afbjorklund commented Mar 20, 2020

The "curl" package is being installed, because the default install command is curl | sh

func installDockerGeneric(p Provisioner, baseURL string) error {
	// install docker - until cloudinit we use ubuntu everywhere so we
	// just install it using the docker repos
	if output, err := p.SSHCommand(fmt.Sprintf("if ! type docker; then curl -sSL %s | sh -; fi", baseURL)); err != nil {
		return fmt.Errorf("error installing docker: %s", output)
	}

	return nil
}

However, the curl package is a part of the regular Ubuntu cloud images nowadays.

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docker: excessive systemctl reload/restarts
5 participants