Commit Graph

603 Commits

Author SHA1 Message Date
dlorenc 48f9968e5b
Move the benchmark files from /workspace to their own mounted volume in tests. (#527)
If we don't do this, they can end up in the built images causing test failures.
2019-01-11 16:04:16 -07:00
dlorenc d9055df304
Make benchmark runs push to a separate namespace. (#526) 2019-01-11 11:38:09 -07:00
dlorenc 996bec885f
Refactor our credential fetching to only get k8s credentials if we are on k8s. (#522) 2019-01-11 11:36:43 -07:00
dlorenc 170e0a2d94
Add a lot more timing data. (#518) 2019-01-10 13:27:55 -07:00
dlorenc 9ab66560db
Simplify snapshotting. (#517) 2019-01-09 15:31:02 -07:00
dlorenc 9d10516698
Reorder the Dockerfile for faster iterations. (#515) 2019-01-09 10:39:41 -08:00
dlorenc 2255837142
Tighten up the timing around Dockerfile commands. (#514)
Right now this timing also includes the snapshot time.
2019-01-09 10:34:23 -08:00
dlorenc ee2baf8025
Set the absolute path of the integration-test.sh script. (#512)
Kokoro runs with a working directory outside of the repo.
2019-01-09 09:34:01 -08:00
Myers Carpenter 1591f41f22 USER command needs /etc/passwd, thus require the fs to be unpacked (#508) 2019-01-08 17:26:54 -08:00
dlorenc 1b9e74334b
Add an entrypoint for kokoro to run benchmarks. (#511) 2019-01-08 17:26:16 -08:00
dlorenc 5f6fbfe74f
Add support for timing data in JSON format. (#510) 2019-01-08 17:24:47 -08:00
dlorenc 859e63c991
Change the CI cloudbuild to stop tagging latest. (#505)
Latest should only be changed during releases.
2019-01-03 15:04:04 -06:00
dlorenc a044e2b6e4
Even faster snapshotting with godirwalk. (#504)
This switches from filepath.Walk to godirwalk.Walk for even faster snapshotting.
A quick test shows a 40% improvement on the dockerfile_mv_add build.
2019-01-03 13:10:18 -06:00
linuxshokunin c3afcc0c7d Adding capability to get Dockerfile from URL. (#500)
* Changed to set http or https in Dockerfile path.

* Fixed return value when error.

* Fixed ineffectual error
2019-01-03 10:42:15 -06:00
MMeent e3bb8bc71a Adds COPY --from=previous stage name/number validation (#491)
* Adds COPY --from=previous stage name/number validation

This fixes an issue in which COPY --from=previous-stage-name would try to download docker image previous-stage-name instead of checking that previous-stage-name could be a named stage.

* Fix linting issues

goimports is implemented as 'gofmt + extras', so this should fix import warnings as well.

* Fix linting issues

Fixes linting issues introduced in the merge

* Fix linting issues.
2019-01-02 11:42:36 -06:00
dlorenc ddeef6d224
Refactor tests and make them run in parallel. (#499) 2018-12-21 12:17:57 -06:00
dlorenc ec1f78a5c4
Deflake the meta_arg_test by setting a specific timestamp in touch. (#498)
This works around mtime-precision issues that cause us to differ from docker-built images
when the touch command executes too quickly to modify the mtime.

Also one fix in the .travis.yml beacuse something appears to have changed in their default
go installation.
2018-12-20 12:33:12 -06:00
dlorenc 8ced0930f4
Add more benchmarks (#487) 2018-12-17 10:23:40 -06:00
Sharif Elgamal 29b7c3e879
Adding TTL to caching (#488)
* Adding TTL to caching

* uncomment added lines

* cache TTL works for layers now

* remove debugging

* parse booleans correctly

* parse booleans correctly everywhere

* fix boolean parsing condition

* refactor benchmarking calls

* defer file properly
2018-12-13 14:20:25 -08:00
priyawadhwa 9116dbc32d
Merge pull request #486 from priyawadhwa/dockerignore
Add support for .dockerignore file
2018-12-11 15:00:16 -08:00
Priya Wadhwa a34ba5c233 Fixed merge conflict 2018-12-11 13:53:19 -08:00
Priya Wadhwa 7fd164deab Only parse .dockerignore once 2018-12-11 13:31:51 -08:00
Priya Wadhwa 9b01772cde Add logging 2018-12-11 12:44:23 -08:00
Priya Wadhwa b0b36ed85a Re-add support for .dockerignore file
This PR adds support for the dockerignore file. Previously when kaniko
had support for the dockerignore file, kaniko first went through the
build context and deleted files that were meant to be ignored. This
resulted in a really bad bug where files in user mounted volumes would
be deleted (my bad).

This time around, instead of modifying the build context at all, kaniko
will check if a file should be excluded when executing ADD/COPY
commands. If a file should be excluded (based on the .dockerignore) it
won't be copied over from the buildcontext and shouldn't end up in the
final image.

I also added a .dockerignore file and Dockerfile as an integration test,
which should fail if the dockerignore is not being processed correctly or if files aren't being excluded correctly.
Also, I removed all the integration testing from the previous version of the
dockerignore support.
2018-12-10 15:20:25 -08:00
dlorenc 009d5aa39f
Add changelog and bump version to 0.7.0 (#485) 2018-12-10 13:40:24 -08:00
Andrew Rynhard 01329d5ac1 Fix intermediate layer caching (#474)
* Fix intermediate layer caching

* Move the if statement into the ShouldTakeSnapshot function.

Also add some unit tests.
2018-12-10 11:34:06 -08:00
Sharif Elgamal 7f9ea39bf7
Avoid the cachedImage/remoteImage call loop (#483)
* Avoid the cachedImage/remoteImage call loop

* missed one function

* fix unit tests

* proper bool comparison
2018-12-10 10:11:05 -08:00
dlorenc 7611ea7a1d
Add support for COPY --from=<an unrelated image>. (#479)
Right now kaniko only supports COPY --from=<another stage>.
This commit adds support for the case where the referenced image is a remote image
in a registry that has not been used as a stage yet in the build.
2018-12-06 12:44:03 -06:00
priyawadhwa 539ddefcae
Merge pull request #476 from bobcatfish/contrib_updates
Add to contributing guide: standards and finding something to work
2018-12-05 11:34:30 -08:00
Christie Wilson 296f695370 Add to contributing guide: standards and finding something to work
Recently I wanted to give feedback on a commit message and I realized we
didn't have anything in our CONTRIBUTING.md about it!

Also added the section on finding issues b/c we'd really like to
encourage folks to get involved with Kaniko.

(This is based on `knative/build-pipeline`'s CONTRIBUTING.md:
https://github.com/knative/build-pipeline/blob/master/CONTRIBUTING.md)
2018-12-03 11:23:54 -08:00
priyawadhwa 0b7fa58ca2
Merge pull request #459 from aduong/symlinks
Overwrite existing dest when copying symlink and preserve link target
2018-11-30 09:28:26 -08:00
Sharif Elgamal 7cde036f44
Add benchmarking code (#448)
* adding benchmarking code

* enable writing to file

* fix build

* time more stuff

* adding benchmarking to integration tests

* compare docker and kaniko times in integration tests

* Switch to setting benchmark file with an env var

* close file at the right time

* fix integration test with environment variables

* fix integration tests

* Adding benchmarking documentation to DEVELOPEMENT.md

* human readable benchmarking steps
2018-11-28 11:54:12 -08:00
Nándor István Krácser a49fd79e0e Fix --cleanup description (#467) 2018-11-27 12:53:40 -08:00
priyawadhwa d1a7d5c97f
Merge pull request #470 from priyawadhwa/remove-dockerignore
Remove support for .dockerignore
2018-11-26 17:03:42 -05:00
Priya Wadhwa e7faec5f0a Skip .dockerignore test 2018-11-26 11:50:57 -08:00
Priya Wadhwa 313250f321 Remove support for .dockerignore
Remove support for .dockerignore file until I can change it to ignore
files in memory instead of deleting them

Refer to #466
2018-11-26 11:11:30 -08:00
Achilleas Pipinellis 097ccb67a7 Cleanup readme (#386)
- Add newlines after headings and remove whitespace
- Use doctoc to update the Table of Contents
- Get additional flags in alphabetical order
2018-11-21 08:59:20 -06:00
priyawadhwa ade42d9105
Merge pull request #461 from priyawadhwa/etc-bug
Only return filepath.SkipDir for directories
2018-11-19 22:15:26 -08:00
priyawadhwa a7599d1563
Merge pull request #456 from priyawadhwa/composer
Fix bug in extracting hardlinks in multistage builds
2018-11-19 22:15:12 -08:00
Priya Wadhwa 2a359f547c Only return filepath.SkipDir for directories
From the docs on filepath.SkipDir:

> If the function returns SkipDir when invoked on a non-directory file, Walk skips the remaining files in the containing directory

This was causing the bug in #457. Since the file `/etc/hosts` was in the whitelist, when filepath.SkipDir was called the entire etc directory was skipped.

This change only returns filepath.SkipDir on directories.
2018-11-19 15:56:11 -05:00
Priya Wadhwa acd45dc894 fixed digests for integration test 2018-11-19 15:26:02 -05:00
Priya Wadhwa edd873d1fe remove unnecessary filepath.Join since dest is always an absolute path 2018-11-19 15:07:56 -05:00
Priya Wadhwa 2cf6f52517 Fix hardlink unit test
Now that hardlink destinations take into account the directory that they are being extracted to, the unit test had to be updated to make sure that two hardlinks were extracted to /tmp/hardlink correctly.
2018-11-19 15:03:31 -05:00
Adrian Duong f23cc32c42 Overwrite existing dest when copying symlink and preserve link target 2018-11-17 23:06:34 -08:00
Adrian Duong 3367268ef9 Test for fs_util.CopySymlink 2018-11-17 23:05:52 -08:00
Priya Wadhwa 9d67953ed3 Fix bug in extracting hardlinks
When we execute multistage builds, we store the fs of each intermediate
stage at /kaniko/<stage number> if it's used later in the build. This
created a bug when extracting hardlinks, because we weren't appending
the new directory to the link path.

So, if `/tmp/file1` and `/tmp/file2` were hardlinked, kaniko was trying
to link `/kaniko/0/tmp/file1` to `/tmp/file2` instead of
`/kaniko/0/tmp/file2`. This change will append the correct directory to
the link, and fixes #437 #362 #352 #342.
2018-11-16 16:18:49 -08:00
dlorenc 0c294138b8
Make snapshotting faster by using filepath.SkipDir. (#451)
filepath.Walk has a special error you can return from your walkFn
indicating it should skip directories. This change makes use of that
to skip whitelisted directories.
2018-11-14 17:44:38 -06:00
priyawadhwa f99e5f5c6d
Merge pull request #447 from priyawadhwa/maintainer
Check if command is nil before optimizing
2018-11-13 10:36:17 -08:00
Priya Wadhwa 5df363a0f6 Check if command is nil before optimizing
MAINTAINER returns nil since it's deprecated, so we should make sure we
don't add to the list of commands to optimize.
2018-11-13 10:12:03 -08:00
Adrian Duong e7d1123073 Hide --azure-container-registry-config flag (#445)
ACR is not supported and the flag is a side-effect of vendoring.
The ACR credentials pkg uses pflag.String directly.
2018-11-13 09:50:55 -06:00