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

add option to use local test image tarball instead of building the image #494

Closed
wants to merge 3 commits into from

Conversation

nouseforaname
Copy link

Long story short, we'd like to run kiln test in a shared concourse.

We are prevented from doing so because we cannot pull the images that https://github.com/pivotal-cf/kiln/blob/main/internal/test/Dockerfile requires for the FROM steps.

We are using authenticated pulls but we still get rate limited.

We'd like to be able to prebuild the required image via the build-oci task and then be able to consume the prebuild image in out kiln test task

../kiln/kiln test --manifest --image-path image.tar.gz
kiln test: 2024/06/06 10:43:20 connecting to ssh socket "/run/user/1000/keyring/ssh"
kiln test: 2024/06/06 10:43:20 ensuring ssh agent keys are configured
kiln test: 2024/06/06 10:43:20 pinging docker daemon
kiln test: 2024/06/06 10:43:20 completed session setup
kiln test: 2024/06/06 10:43:20 loading test image
kiln test: 2024/06/06 10:43:21 loaded image image.tar.gz:
{"stream":"Loaded image: kiln_test_dependencies:vmware\n"}

kiln test: 2024/06/06 10:43:21 creating test container
kiln test: 2024/06/06 10:43:21 created test container with id bc702b3be2c69ee63c9ff035c97e1123c1781ffcc64e819bea09583d5e279e6c
go: downloading github.com/onsi/gomega v1.33.1
go: downloading github.com/pivotal-cf/kiln v0.94.0
go: downloading github.com/onsi/ginkgo/v2 v2.17.2
go: downloading github.com/google/go-cmp v0.6.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading golang.org/x/net v0.24.0

some teams would like to use `kiln test` from concourse. That concourse
could be shared, like runway // tpe concourse instances. These, even
using authentication, are getting rate limited against dockerhub.

Effectively to run kiln test, we'd first need to preload the images
required to build the test image ( every FROM arg used in the Dockerfile)
avoid the pull ibeing executed implicitly when docker build is run by `kiln test`

To avoid having to actually build an image ( which would either require
to preload the images for the Dockerfile or being able to pull from dockerhub)
we could use this flag to run `docker load -i $IMAGE_PATH` instead of building.

this way, the test image can be `acquired` via docker proxy registries..
@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

why?:

because some CI systems cannot get past the dockerhub rate limitation.
We want to use kiln test for the csb tiles. But we use the tpe / runway
concourse. These instances make it impossible to communicate with dockerhub
because of rate limits ( even with authenticated pulls )

We can make the `kiln test` execution work by pre loading the images that
are used as FROM stages in `internal/test/Dockerfile` into the docker host
we start in the concourse task. Essentially we end up pulling the images from
an accessible repository, then we retag them to match the expected FROM args
and that makes the implicit image build work.

Instead it would be nice to avoid having to run the build stage and make kiln
test consume a provided image instead so it can be run offline.
Copy link
Member

@crhntr crhntr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@notrepo05 if the tests run well on your machine, I'm happy to approve these changes once the small changes I suggested are either incorporated or rejected by @nouseforaname.

internal/commands/test_tile.go Outdated Show resolved Hide resolved
internal/test/container.go Show resolved Hide resolved
internal/test/container_test.go Show resolved Hide resolved
- replace `"` with `\`` quoted strings
- use closer helper function and move defer up
@nouseforaname
Copy link
Author

@crhntr I added a commit with the requested changes.

@notrepo05
Copy link
Contributor

I haven't had the bandwidth to debug the pipeline, but the integration and unit tests for internal/test pass on my end. Likewise for all non acceptance tests (I don't have tokens etc setup properly to exercise these locally).

It appears the tests are failing due to CI misconfiguration:

Run actions/checkout@v4
  with:
    fetch-depth: 0
    repository: pivotal-cf/kiln
    ssh-strict: true
    ssh-user: git
    persist-credentials: true
    clean: true
    sparse-checkout-cone-mode: true
    fetch-tags: false
    show-progress: true
    lfs: false
    submodules: false
    set-safe-directory: true
Error: Input required and not supplied: token

@nouseforaname
Copy link
Author

recreated in #495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants