Commit Graph

62 Commits

Author SHA1 Message Date
Gabriel Nützi 90e426ba3f
refactor: Make CLI argument names consistent (#2084)
* fix: Wrong argument naming

* fix: tarPath as well

* Test

* fix: Fix tests

* np: Format markdown

* fix: Review changes
2022-08-22 09:10:11 -04:00
Lukas 679c71c907
refactor: simpler local integration tests (#2110)
* tests(integration): add fake gcs server and use sdk instead of gsutil

* tests(integration): add flag to run tests for a subset of dockerfiles

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* tests(integration): conditionally create gcs client

* refactor: create package for gcs bucket interaction

* tests(integration): use util.Tar for integration tarball creation

* refactor: create TarballOfDirectory func

* chore: add dockerignore for faster builds

* docs: add docs for dockerfile pattern

* fix: issue during personal review

* chore: cleanup

Signed-off-by: Höhl, Lukas <lukas.hoehl@accso.de>

* fix(integration-tests): remove default bucket

Signed-off-by: Lukas Hoehl <ludi.origin@gmail.com>
2022-06-14 13:38:01 -04:00
Gabriel Nützi 323e616a67
fix: Refactor `LayersMap` to correct old strange code behavior (#2066)
* fix: Correct flatten function in layers

- Added a test.
- Cache current image, track deletes in `whiteouts` as well as normal adds in `layers`.
- Fix ugly delete behavior of `layerHashCache`.
  Delete it when crerating a new snapshot.
- Slight cleanup in `snapshot.go`.
- Format ugly `WalkFS` function.

* fix: Add symbolic link changes  to Hasher and CacheHasher

* fix: Better log messages

* fix(ci): Integration tests

* fix(ci): Add `--no-cache` to docker builds

* fix(ci): Pass credentials for error integration test

* np: Missing .gitignore in `hack`

* np: Capitalize every log message

- Correct some linting.

* fix: Key function

- Merge only last layer onto `currentImage`.

* fix: Remove old obsolete `cacheHasher`
2022-05-17 20:30:58 -04:00
Jason Hall 76624697df
Bump github.com/docker/docker to latest release (#1866)
* Bump github.com/docker/docker to latest release

* Pin deps to docker/docker's requirements

fix build breakages
fix unit test
Trying to see whether am-i-in-a-container checks are broken for integration tests...
2022-01-14 15:58:32 -05:00
Matt Moore 49f0154b3f
Fix the e2e K8s test (#1842)
* Debugging the integration testing.

It seems to be consistently failing (also fix a typo in the file/leg name).

I'm disabling `-v` for `go test` because it interleaves the test output in ways that make it painful to read a single failing test's output when `t.Parallel` is involved.

* Try swapping registry:2 for the registry add-on

* Drop logf and make Logger private
2021-12-17 14:43:38 -05:00
Tejal Desai 1da17b6e9b
chore: add workflows for pr tests (#1766)
* chore: add workflows for pr tests

* fix unit tests

* fix formatting

* chore: fix gobuild

* change minikube script

* chore: fix lint install script

* chore: ignore and fix tests

* fix lint and run gofmt

* lint fixes

* k8s executor image only

* fix Makefile

* fix travis env variables

* more info on k8s tests

* fix travis run

* fix

* fix

* fix

* fix log

* some more changes

* increase timeout

* delete travis.yml and fix multiple copy tests

* fix registry mirror

* fix lint

* add concurency

* last attemot to fix k8 integrations

* diff id for diff workflows
2021-10-18 23:22:44 -07:00
Kamal Nasser f21639daac
Fix snapshotter ignore list; do not attempt to delete whiteouts of ignored paths (#1652)
* avoid deleting whiteouts if they are in ignore list

* fix snapshotter ignore list

* include filesystem mounts in ignorelist of snapshotter
* clean up ignore list logic

* add unit and integration tests for #1652

* fix tests and ignore list updates
2021-06-04 10:07:24 -07: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
Yoan Blanc 8cc772ae9c
fixup! add should fail on 40x
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
2020-06-20 10:15:50 +02:00
Tejal Desai 4ac51ef515 merge 2020-06-06 20:17:17 -07:00
Tejal Desai 35d2358482 add integration tests 2020-06-06 00:53:08 -07:00
Tejal Desai 0f5387960e minimal changes 2020-06-06 00:16:14 -07:00
Tejal Desai 01c3a1bcf3 mend 2020-06-05 23:47:31 -07:00
Tejal Desai 58276274e8 better improvements 2020-06-05 23:44:17 -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 85c40c45b3 fix dockerfile 2020-06-04 15:10:01 -07:00
Tejal Desai a60a097c9b one more fix 2020-05-26 00:22:50 -07:00
Tejal Desai 48421f1126 more fixes 2020-05-26 00:16:03 -07:00
Tejal Desai 4129c17d12 more changes 2020-05-25 23:36:59 -07:00
Tejal Desai 5d013626fc benchmark project added 2020-05-25 21:30:07 -07:00
Tom Prince 484d03550c Handle `MAINTAINERS` when passing `--single-snapshot`. 2020-04-13 15:54:27 -06:00
Sam Stoelinga 882793b755 Add K8s integration tests
- Use minikube for deploying a lightweight K8s on Travis CI
- Build and push Kaniko image to local docker registry
- Build dockerfiles with context on both docker and K8s and check
  the diff between the 2.
2020-03-11 11:49:22 -07:00
Tejal Desai b538066dcb
Merge pull request #1088 from cvgw/u/cgwippern/integration-tests-with-context
add integration tests with their own context
2020-03-02 09:41:59 -08:00
cvgw 75f6bfe265 fix #1092 TestRelativePaths
Fix integraton test TestRelativePaths
2020-02-29 21:16:07 -08:00
cvgw 57c97dea3e add integration tests with their own context 2020-02-29 15:41:10 -08:00
Ben Einaudi 0c1d05520f Refactor integration imaqge built
The aim of this change is to hide the complexity of image not being rebuilt. Image builder won't also have to know the list of dockerfiles
2020-02-15 09:52:09 +01:00
Ben Einaudi 3e2221cf6f Allow contributors to launch integration tests against local registry
This change allows user to launch integration tests with a local registry

Fixes #1012
2020-02-06 13:35:51 +01:00
Ben Einaudi 2f1e54e591 Expand build argument from environment when no value specified
Fixes #713
2020-01-30 12:01:06 +01:00
Sam Stoelinga 61af994a33 Run integration tests in Travis CI
- Change integration tests to use docker hub instead of GCR due to bug
in library that requires authentication with gcr.io even for public
images. See #966 for bug tracking this.
- Make uploading to GCS bucket configurable through a flag --uploadToGCS
- Utilize a locally deployed docker registry in travis CI to remove
dependency of needing to authenticate with GCP. This requires host
networking such that we can access the registry on localhost:5000
- Use the commit that's being tested for `TestGitBuildcontext`
- Remove duplicate GitBuildContext case that's now covered by default in
travis CI.
2020-01-19 22:33:04 -08:00
Sam Stoelinga 64bfc3eabb Fix bug with docker compatibility
ArgsEscaped according to Docker docs should only be set in Windows
environments: https://docs.docker.com/engine/api/v1.30/

It was causing integration test to fail with following message:
```
FAIL: TestRun/test_Dockerfile_test_metadata (8.48s)
           "Diff": {
             "Adds": [
               "ArgsEscaped: true"
             ],
             "Dels": [
               "ArgsEscaped: false"
             ]
```

However docker 18.xx returns ArgsEscaped: true
whereas docker 19.xx returns ArgsEscaped: false
Hence this patch also adds the docker version check to the integration
to ignore ArgsEscaped being different when 18.xx is used.
2020-01-13 21:18:54 -08:00
Sam Stoelinga 8cf392e20e Allow setting serviceAccount in integration test
Previously it would mount .config/gcloud directory which is not
recommended for systems such as CI that authenticate with Google Cloud.
This commit allows you to set the path to a service account.

By default previous behaviour will be as before so this shouldn't break
existing systems that run the integration test.
2020-01-12 18:54:50 -08:00
Don McCasland 5716c44ab8
Merge branch 'master' into bug-742-2 2019-11-04 09:25:25 -08:00
Don McCasland e5da55d4cd
Adding integration test 2019-10-08 07:42:09 -07:00
Hugues Alary 4327e9ba24 Resolve relative paths to absolute paths in command line arguments
The executor accepts a few arguments dockerfile, context, cache-dir and
digest-file that all represent paths. This commits allows those paths to
be relative to the working directory of the executor.

Fixes #732 #731 #675
2019-08-27 21:06:26 +00:00
Kartik Verma fa2a2c803b
Updated PR Branch with master 2019-04-09 02:18:28 +05:30
Priya Wadhwa 8b459b57aa Test git buildcontext 2019-02-21 13:03:02 -08:00
Priya Wadhwa 3da2fdf2d0 Merge branch 'issue#269' of https://github.com/vkartik97/kaniko into vkartik97-issue#269 2019-02-21 11:55:51 -08:00
dlorenc 9f65174cb8
Generate the config.json from gcloud rather than relying on a hardcoded one. (#551)
marketplace.gcr.io now requires auth, but our credential helper doesn't know that.
2019-02-04 16:53:59 -06:00
Kartik Verma 2f8bdd99b7
Resolved Merge Conflicts 2019-02-02 11:28:40 +05:30
Kartik Verma 785691ecc2
Made changes as per review 2019-02-02 11:18:54 +05:30
dlorenc e3bf9fb062
Only log the hour of the benchmark run. (#544)
Also combine all files into one directory.
2019-01-28 15:53:13 -06:00
dlorenc 4c960709df
Actually fix the paths for benchmark uploading during integration test runs. (#543) 2019-01-28 12:52:27 -06:00
dlorenc a4b47a4992
Fix the time format we use to upload to GCS. (#538) 2019-01-22 14:23:28 -06:00
dlorenc b0e7c0e8cd
Upload benchmarks to GCS. (#523) 2019-01-17 16:10:14 -05:00
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
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
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
Kartik Verma fdac2fa94c
Resolved merge in README 2018-11-02 19:46:48 +05:30
Kartik Verma b9c678e6f8
Seperate Tests for bucketContextTests and gitRepoTests 2018-11-02 19:35:02 +05:30
Priya Wadhwa 55e6157000 Fix bugs with .dockerignore and improve integration test
I improved handling of the .dockerignore file by:

1. Using docker's parser to parse the .dockerignore and using their
helper functions to determine if a file should be deleted
2. Copying the Dockerfile we are building to /kaniko/Dockerfile so that
if the Dockerfile is specified in .dockerignore it won't be deleted, and
if it is specified in the .dockerignore it won't end up in the final
image
3. I also improved the integration test to create a temp directory with
files to ignore, and updated the .dockerignore to include exclusions (!)
2018-10-31 12:50:23 -07:00