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

Only send the build context for changed files to the Docker daemon #195

Closed
ghost opened this issue Mar 12, 2018 · 8 comments
Closed

Only send the build context for changed files to the Docker daemon #195

ghost opened this issue Mar 12, 2018 · 8 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 12, 2018

Currently, the full build context is being sent to the minikube Docker daemon whenever a change is made. It'd be cool if we could somehow make it more intelligent by only sending files for the stages that are not cached/will need to rerun with the changes made.

@mumoshu
Copy link

mumoshu commented Mar 13, 2018

FYI: Perhaps the recent improvement in docker for sending build context incrementally would help.

@dgageot
Copy link
Contributor

dgageot commented Mar 13, 2018

Since docker v17.07, there's an experimental --stream flag that caches the context on the daemon side. We could try to leverage this flag.

@dlorenc
Copy link
Contributor

dlorenc commented Mar 13, 2018

There are also a few optimizations we can do to only send changed files during a cloud build.

@dlorenc
Copy link
Contributor

dlorenc commented Mar 14, 2018

AFAICT the incremental upload API is still very experimental: https://docs.docker.com/engine/api/v1.36/#operation/Session
moby/moby#32677

and requires the daemon be started with specific flags.

@mumoshu
Copy link

mumoshu commented Mar 24, 2018

@dlorenc @dgageot Thx for the info! Just started playing with it:

$ minikube delete && minikube start --memory 4096 --cpus 2 --docker-opt experimental
$ eval $(minikube docker-env)
$ DOCKER_API_VERSION=1.31 docker version
Client:
 Version:	18.02.0-ce
 API version:	1.31
 Go version:	go1.9.4
 Git commit:	fc4de44
 Built:	unknown-buildtime
 OS/Arch:	darwin/amd64
 Experimental:	false
 Orchestrator:	swarm

Server:
 Engine:
  Version:	17.09.0-ce
  API version:	1.32 (minimum version 1.12)
  Go version:	go1.8.3
  Git commit:	afdb6d4
  Built:	Tue Sep 26 22:45:38 2017
  OS/Arch:	linux/amd64
  Experimental:	true
$ DOCKER_API_VERSION=1.31 docker build --help | grep stream
      --stream                  Stream attaches to server to negotiate build context

@bhack
Copy link

bhack commented Apr 7, 2018

What about a direct file sync phase like https://github.com/vapor-ware/ksync?
Sometime run on the remote cluster is mandatory cause specific resource. So the "build only" approach can create too much lag.

@dlorenc
Copy link
Contributor

dlorenc commented Sep 4, 2018

@balopat balopat added the priority/p2 May take a couple of releases label Sep 4, 2018
@dgageot
Copy link
Contributor

dgageot commented Jan 19, 2019

Let's close this one. It's possible to enable this feature by using useDockerCLI:true on the local builder and #568 is here to implement that in the GCB builder

@dgageot dgageot closed this as completed Jan 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants