Commit Graph

52 Commits

Author SHA1 Message Date
Ramy f9dcb92c38
add cache run command option (#2032)
Co-authored-by: Rami CHAABANE <rchaabane@scaleway.com>
2022-08-09 08:35:00 -04:00
Tejal Desai b04399eeac
add caching copy layers back (#1518)
* add caching copy layers back

* fix test

* lint

* fix test - 2

* Add integration test

* fix lint
2020-12-11 00:25:03 -08:00
Tinjo Schöni 5f4e2f1366
Fix .dockerignore for build context copies in later stages (#1447)
* Extend .dockerignore integration test with copies in later stages

.dockerignore should continue to apply when copying from the build context in later stages, but it currently doesn't

* Replace excluded global with passed along FileContext struct

This new FileContext struct allows much cleaner handling of context specific file exclusions.
The global excluded file state is no longer needed.

Additionally this also fixes the issue where excluded files aren't being applied for build context copies in later build stages.
2020-10-08 12:47:14 -07:00
Ian Kerins 1240333657
Stop caching COPY layers (#1408)
Cached COPY layers are expensive in that they both need to be retrieved
over the network and occupy space in the layer cache.

They are unnecessary in that we already have all resources needed to
execute the COPY locally, and doing so is a trivial file-system
operation.  This is in contrast to RUN layers, which can do
arbitrary and unbounded work.

The end result is that cached COPY commands were more expensive when
cached, not less.  Remove them.

Resolves #1357
2020-09-30 17:18:50 -07:00
Tejal Desai 2a7d33526b lint 2020-06-06 00:30:07 -07:00
Tejal Desai 43338d4b2f add a new run command along with a new flag 2020-06-05 19:53:16 -07:00
Tejal Desai 32e3336d4c add a new method to indicate if the command provides files to snapshot 2020-05-01 15:50:46 -07:00
Tejal Desai ffc372a63b refactor to add unit tests 2020-03-23 17:48:49 -07:00
Cole Wippern 697037cbcf Add unit tests for compositecache and stagebuilder
* add mock types for testing
* enhance error messaging
* add tests
2019-11-27 21:47:00 -08:00
Don McCasland 1bb5a41d7d
Fixing lint issues. Adding tests for COPY command. Fixing issue with copying files out of snapshots 2019-09-16 10:48:31 -07:00
dlorenc 8408c53aa8
Improve cache layer uploads. (#443)
This change only uploads layers that were created from cache misses on RUN commands.
It also improves the cache-checking logic to handle this case.
Finally, it makes cache layer uploads happen in parallel with the rest of the build, logging
a warning if any fail.
2018-11-12 16:22:04 -06:00
dlorenc 063663e17b
Skip unpacking the base FS if there are no run commands (or only cached ones). (#440)
This is the final part of an optimization that I've been refactoring towards for awhile.
If the Dockerfile consists of no RUN commands, or cached RUN commands, followed by metadata-only
operations, we can skip downloading and unpacking the base image.
2018-11-12 12:51:45 -06:00
dlorenc 58b607b4d0
Fix caching for multi-step builds. (#441)
This change fixes that by properly "replaying" the Dockerfile and mutating the config when
calculating cache keys. Previously we were looking at the wrong cache key for each command
when there was more than one.
2018-11-09 12:28:18 -06:00
dlorenc 52a6ce6685
More cache cleanups: (#397)
- move the layer cache to an interface
- refactor the DockerCommand implementations to support Cached and non-cached implementations.
2018-11-01 09:11:21 -07:00
dlorenc 5ac29a9773
Use only the necessary files in the cache keys. (#387) 2018-10-15 08:56:34 -05:00
dlorenc 734ffe65ce
Rework cache key generation a bit. (#375)
* Rework cache key generation a bit.

Cache keys are now based on the previous commands, rather than the previous state
of the filesystem.

* Refactor command interface a bit, only cache the context for commands that use it.
2018-10-03 16:16:12 -05:00
Priya Wadhwa 4f3ab61b96 Add CacheCommand to DockerCommand interface
CacheCommand returns true if the command should be cached. Currently,
it's only true for RUN but can be added to ADD/COPY later on (these are
different since the contents of files for ADD/COPY need to be included
in the cache key generation).

I also changed CreatedBy to String so that we can log each command
before cache extraction or regular execution takes place.
2018-09-04 13:16:05 -07:00
Nick Kubala e45d1f6aac
Update deps 2018-07-31 16:23:23 -07:00
Jon Johnson 8b0a1a7689 dep update go-containerregistry 2018-06-03 00:59:34 +00:00
Christian Jantz fbe3e05801 WIP: Feature/healthcheck signal (#177)
* added basic healthcheck implementation

* updated go-containerregistry version

* added build args parameter to healthcheck execute

* added go-containerregistry HealthCheck passing

* dereferenced health for conversion
2018-05-14 14:28:24 -07:00
Priya Wadhwa 4de14c34dd
Wrap BuildArgs in our own type 2018-05-11 10:23:13 -07:00
Priya Wadhwa 33f4805f62
Merged master, fixed merge conflict 2018-05-10 13:51:23 -07:00
Priya Wadhwa 26d8501489
Support BuildArgs for arg command 2018-05-09 12:24:38 -07:00
Priya Wadhwa f5b8457405
Add shell command to commands.go 2018-05-09 12:01:05 -07:00
Christian Jantz d73f8c031f added stopsignal implementation 2018-04-28 17:30:18 +02:00
dlorenc cd5b744904
Switch from containers/image to go-containerregistry (#140)
* Vendor changes for go-containerregistry switch.

* Manual changes for go-containerregistry switch.

The biggest change is refactoring the tarball unpacking.

* Pull more of container-diff out.

* More vendor removals.

* More unit tests.
2018-04-25 19:21:05 -07:00
Priya Wadhwa 6548835db5
skip maintainer command 2018-04-16 14:21:37 -07:00
Priya Wadhwa cf90bd73d4
Fixed merge conflict 2018-04-11 15:05:12 -07:00
Sharif Elgamal ce2b515d49
adding VOLUME command (#62)
* adding VOLUME command

* proper test project

* general fixes

* fixing project name

* fixing volume unit test

* fixing integration test

* adding tests

* adding util test

* fixing test

* actually create the volume mounted directory

* fix test
2018-04-06 12:02:57 -07:00
Priya Wadhwa 27f964957b
Support for onbuild and unit test 2018-04-04 17:06:01 -07:00
Priya Wadhwa 32b067af0c
Merged master, fixed conflict 2018-04-04 14:06:38 -07:00
sharifelgamal 7ebc313974 Merge branch 'master' of github.com:GoogleCloudPlatform/k8s-container-builder into user-cmd 2018-03-30 13:43:56 -07:00
Priya Wadhwa 687e00e3aa Fixed merge conflict 2018-03-29 20:50:52 -07:00
sharifelgamal b315cf1049 adding user command to switch 2018-03-29 11:54:51 -07:00
Priya Wadhwa 89400b7410
Add command with unit tests 2018-03-28 13:34:00 -07:00
Priya Wadhwa 1b3b8accab
Fixed merge conflict 2018-03-28 12:47:19 -07:00
Priya Wadhwa 316e2847a7
Fixed merge conflict 2018-03-26 15:51:00 -07:00
Priya Wadhwa 41aed3948b
Merged master, fixed merge confict 2018-03-26 14:57:57 -07:00
Sharif Elgamal f38dd2d85b
Merge pull request #44 from sharifelgamal/label-cmd
adding LABEL command
2018-03-26 14:28:56 -07:00
Priya Wadhwa 0787a93372
Workdir command and unit tests 2018-03-26 11:37:50 -07:00
sharifelgamal ba77ba0822
adding LABEL command 2018-03-21 11:34:37 -07:00
Priya Wadhwa 8d85fe91f3
resolve merge conflict 2018-03-20 15:17:08 -07:00
Priya Wadhwa d49c7c5ed1
Entrypoint command and unit tests 2018-03-20 12:58:38 -07:00
Priya Wadhwa 5da78632a1
CMD command and unit tests 2018-03-20 10:40:45 -07:00
sharifelgamal 5578e683a1
Merge branch 'master' of github.com:GoogleCloudPlatform/k8s-container-builder into expose-cmd 2018-03-19 17:26:30 -07:00
sharifelgamal 288ac0b93b
adding EXPOSE command 2018-03-19 17:25:12 -07:00
Priya Wadhwa 5ba9510ee8
Fixed merge conflict 2018-03-19 11:08:07 -07:00
Priya Wadhwa 21a9207428
Copy command and unit tests 2018-03-14 17:06:46 -07:00
Priya Wadhwa ab0fc3802e
Add ENV command 2018-03-09 13:47:18 -08:00
Priya Wadhwa 27b09f28be
Add config as point to ExecuteCommand, fix snapshots 2018-03-09 11:30:35 -08:00