Skip to content

Parallel sign with fixed tests#1485

Merged
woodruffw merged 5 commits intosigstore:mainfrom
jku:parallel-sign-with-fixed-tests
Jul 29, 2025
Merged

Parallel sign with fixed tests#1485
woodruffw merged 5 commits intosigstore:mainfrom
jku:parallel-sign-with-fixed-tests

Conversation

@jku
Copy link
Member

@jku jku commented Jul 29, 2025

This is attempt number 2 for #1468 (that was reverted because windows tests started failing), now with fixed tests.

The second commit contains the new changes -- only write to test specific temp directory in tests.

jku and others added 2 commits July 29, 2025 11:21
* Sign multiple artifacts in threads

This is (especially) useful with rekor 2 where the service only
responds after log inclusion: We would prefer to get all signatures
in the same inclusion batch.

The change still affects both rekor v1 and rekor v2.

This commit is a rebase of a bunch of Ramons commits.

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* rekor: Make create_entry() conservative WRT session use

* Session thread safety is ambiguous: it may now be safe but situation
  is unclear
* Use a single Session per create_entry() call: This may have a little
  more overhead but seems like the safest option
* Note that RekorLog (v1) other methods may not be thread safe: I only
  reviewed the create_entry() flow

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* timestamp: Dont reuse session

It's a little unclear if Session is now thread safe or not: avoid reuse
just in case

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* CLI: Refactor terminal output

* Separate the thread method so it's easier to see potential safety issues
* Using print() with the same file object is generally not thread safe: Avoid
  it from the threaded method

The output remains effectively the same except:
* The b64 encoded signature is no longer printed to terminal
* Some print()s are now logger.info(): e.g.
    Transparency log entry created at index: 5562
* Other print()s happen in a batch now, after he signing has finished

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* tests: Test signing multiple artifacts

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* Add test that signs multiple artifacts with rekor2

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* tests: lint fixes

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* rekor: Refactor Session handling in RekorClient

Make every RekorLog have a Session of their own by default.
This means RekorClient no longer needs to manage that.

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

* cli: Let Python pick number of signing threads

This number does affect the number of concurrent rekor POST requests
we have in flight, but we are unlikely to hit rate limits as
they are defined in "requests from same host per minute".

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>

---------

Signed-off-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
Co-authored-by: Ramon Petgrave <ramon.petgrave64@gmail.com>
This is just good hygiene but it should also stop the windows
tests outright failing.

Fixes sigstore#1477

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku
Copy link
Member Author

jku commented Jul 29, 2025

There's a few annoying details in testing this:

I suggest we merge #1484 first, then I run the tests on my fork to ensure the fix is correct

@woodruffw
Copy link
Member

Yeah, this testing setup is continuing to show signs of unnecessary stress. I think we're at the point now where we should consider dropping our first-party OIDC usage entirely, and switch just to the public OIDC beacon for tests -- that would eliminate all of the PR test limitations and would also make local runs much easier.

@jku
Copy link
Member Author

jku commented Jul 29, 2025

still seeing one more failure, will look into it

* set output path to temp dir
* don't unlink anything

Signed-off-by: Jussi Kukkonen <jkukkonen@google.com>
@jku
Copy link
Member Author

jku commented Jul 29, 2025

@woodruffw woodruffw enabled auto-merge (squash) July 29, 2025 16:13
@woodruffw woodruffw merged commit dbceaeb into sigstore:main Jul 29, 2025
23 checks passed
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.

2 participants