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

sigstore test env #1630

Closed
wants to merge 2 commits into from
Closed

sigstore test env #1630

wants to merge 2 commits into from

Conversation

sallyom
Copy link

@sallyom sallyom commented Apr 26, 2022

This PR introduces 2 make targets:

make sigstore-testenv-up
make sigstore-testenv-down

This will enable testing for addition of sigstore image signing/verification

/cc @lukehinds @mtrmac @vrothberg :)

@sallyom sallyom force-pushed the ci-sigstore branch 6 times, most recently from f4582ca to 5bce179 Compare April 27, 2022 16:52
@sallyom
Copy link
Author

sallyom commented Apr 28, 2022

@vrothberg @mtrmac I've tested this setup by running subset of sigstore integration tests locally like so:

$ cd path/to/containers/skopeo 
$ make sigstore-testenv-up
$ cd  path/to/sigstore
$ curl -o e2e-test.sh https://gist.githubusercontent.com/sallyom/9f828f46a6ade7a98eaefecd56190fa2/raw/6501803c4c3170aa5d41c8acfc0ad643d4a5a912/e2e-test.sh
$ chmod +x e2e-test.sh && ./e2e-test.sh
$ cd back/to/containers/skopeo
$ make sigstore-testenv-down

output:

$ ./e2e-test.sh 
+ echo 'running tests'
running tests
+ export VAULT_TOKEN=testtoken
---env-vars-set
+ go test -tags e2e -count=1 ./...
ok  	github.com/sigstore/sigstore/pkg/cryptoutils	6.619s
?   	github.com/sigstore/sigstore/pkg/oauth	[no test files]
ok  	github.com/sigstore/sigstore/pkg/oauth/internal	0.007s
ok  	github.com/sigstore/sigstore/pkg/oauth/oidc	1.160s
ok  	github.com/sigstore/sigstore/pkg/oauthflow	1.581s
ok  	github.com/sigstore/sigstore/pkg/signature	0.356s
ok  	github.com/sigstore/sigstore/pkg/signature/dsse	0.013s
ok  	github.com/sigstore/sigstore/pkg/signature/kms	0.016s
ok  	github.com/sigstore/sigstore/pkg/signature/kms/aws	0.851s
ok  	github.com/sigstore/sigstore/pkg/signature/kms/azure	0.030s
ok  	github.com/sigstore/sigstore/pkg/signature/kms/fake	0.007s
ok  	github.com/sigstore/sigstore/pkg/signature/kms/gcp	0.009s
ok  	github.com/sigstore/sigstore/pkg/signature/kms/hashivault	0.064s
?   	github.com/sigstore/sigstore/pkg/signature/options	[no test files]
ok  	github.com/sigstore/sigstore/pkg/signature/payload	0.004s
ok  	github.com/sigstore/sigstore/pkg/signature/ssh	0.059s

@sallyom sallyom changed the title WIP: Sigstore test env sigstore test env Apr 28, 2022
@sallyom
Copy link
Author

sallyom commented Apr 28, 2022

To avoid using docker.io images (rate limits) EDIT: I've pushed necessary images the following images should be pushed somewhere like quay.io/libpod/..

docker.io/library/vault:1.9.6
docker.io/library/localstack/localstack:0.12.16
docker.io/dexidp/dex:v2.31.1

latest localstack 0.14.2 but 0.12.6 in use by sigstore atm

The above docker.io images are referenced in this PR

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Thanks!

Before merging, we should probably push the images to quay.io/libpod/sigstore-testing-*.

@@ -119,7 +119,12 @@ _run_integration() {
# Ensure we start with a clean-slate
podman system reset --force

# uncomment when sigstore integration tests merge
# make sigstore-testenv-up
Copy link
Member

Choose a reason for hiding this comment

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

I think this should be uncommented already to make sure that it's working and that it will continue to work in the future.

Copy link
Author

Choose a reason for hiding this comment

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

uncommented, thanks

version: "3.8"
services:
vault:
image: quay.io/sallyom/vault:latest
Copy link
Member

Choose a reason for hiding this comment

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

Let's avoid using the latest tag. The image may be updated in the future and we need to make sure that old/stable branches continue to work.

Copy link
Member

Choose a reason for hiding this comment

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

can we move these images to a common quay.io directory/repo? I know we have one for libpod, do we have one for skopeo?

Copy link
Member

Choose a reason for hiding this comment

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

Using the libpod one should be OK given we need these tests in Podman CI as well.

Copy link
Author

Choose a reason for hiding this comment

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

updated from localstack:latest to localstack:0.12.16 (currently used in sigstore)

ports:
- "5556:5556"
volumes:
- ./dex-config.yml:/etc/dex/dex-config.yml:z
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this dex-config.yml?

Copy link
Author

@sallyom sallyom May 6, 2022

Choose a reason for hiding this comment

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

EDIT: keeping the dex-config.yml & the dex volume in docker-compose.yml nope, I've removed this and also updated the gist test script (not included in this PR but to prove this setup works until skopeo adds sigstore e2es)

export AWS_REGION=us-east-1
export AWS_ENDPOINT=localhost:4566
export AWS_TLS_INSECURE_SKIP_VERIFY=1
export OIDC_ISSUER=http://127.0.0.1:5556/auth
Copy link
Member

Choose a reason for hiding this comment

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

Should we export the IPs in the Makefile to make them accessible to all tests?

Copy link
Author

@sallyom sallyom May 6, 2022

Choose a reason for hiding this comment

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

right, yup - updated/added to Makefile

@sallyom
Copy link
Author

sallyom commented May 6, 2022

@TomSweeneyRedHat @vrothberg thanks for the reviews! I've updated this PR, ptal

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

Tests are failing at the moment as integration/copy_test.go wants to use port 5556 which is now blocked by dex.

@sallyom sallyom force-pushed the ci-sigstore branch 3 times, most recently from 8330f02 to 8a60f9b Compare May 13, 2022 00:08
@sallyom
Copy link
Author

sallyom commented May 13, 2022

Tests are failing at the moment as integration/copy_test.go wants to use port 5556 which is now blocked by dex.

fixed, updated

@TomSweeneyRedHat
Copy link
Member

@sallyom another rebase is needed here

@sallyom
Copy link
Author

sallyom commented May 17, 2022

@sallyom another rebase is needed here

rebased!

@sallyom
Copy link
Author

sallyom commented May 19, 2022

@TomSweeneyRedHat @vrothberg anything else needed? thanks!

@vrothberg
Copy link
Member

@sallyom, it would be helpful to document how this can be used integration tests. For instance, which env variables should be used for the local fulcio and recor instance?

@mtrmac WDYT?

@sallyom
Copy link
Author

sallyom commented May 23, 2022

@vrothberg @mtrmac I documented above (and in the Makefile) the env vars required. There's an example for how to use this setup against sigstore/sigstore e2e tests in this gist, too

export VAULT_TOKEN=testtoken
export VAULT_ADDR=http://localhost:8200/

export AWS_ACCESS_KEY_ID=test
export AWS_SECRET_ACCESS_KEY=test
export AWS_REGION=us-east-1
export AWS_ENDPOINT=localhost:4566
export AWS_TLS_INSECURE_SKIP_VERIFY=1
export OIDC_ISSUER=http://127.0.0.1:5556/auth
export OIDC_ID=sigstore

@rhatdan
Copy link
Member

rhatdan commented Jul 12, 2022

@sallyom @mtrmac @vrothberg Where are we with this one? Now most of the sigstore stuff is merged?

@sallyom
Copy link
Author

sallyom commented Jul 13, 2022

@sallyom @mtrmac @vrothberg Where are we with this one? Now most of the sigstore stuff is merged?

what will help is if there is a WIP/PoC bringing in whatever is necessary from sigstore/cosign - then it will become clear what should be included in/ported to sigstore/sigstore

relevant upstream:
sigstore/signature library: https://github.com/sigstore/sigstore/tree/main/pkg/signature
ongoing work with sigstore/gitsign to move code to sigstore/sigstore
sigstore/gitsign#62
and work to move providers into separate repos:
sigstore/cosign#1867

Signed-off-by: Sally O'Malley <somalley@redhat.com>
Signed-off-by: Sally O'Malley <somalley@redhat.com>
@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Sep 13, 2022

@sallyom @vrothberg @mtrmac do we care about this PR at this point? Should it be fixed or closed?

@sallyom
Copy link
Author

sallyom commented Oct 21, 2022

closing this for now and will reopen if necessary after examining current sigstore implementation

@sallyom sallyom closed this Oct 21, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants