-
Notifications
You must be signed in to change notification settings - Fork 143
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
[ART-1618] [ART-2800] New signing mechanism #3817
Conversation
e595bce
to
b8904c2
Compare
@@ -3,7 +3,7 @@ | |||
from pathlib import Path | |||
from typing import Any, Dict, Optional | |||
|
|||
import toml | |||
import tomli |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is not related but let me explain why it is here.
When I attempted to store UMB brokers configuration in artcd.toml, I met some bugs in
toml
library. It can't correctly parse configs with nested dicts and arrays.
Considering toml
is not actively maintained and tomli
has been adopted as a standard library in Python 3.11, I think we should move to tomli
.
At the end, I decided to write a URI parser to configure UMB brokers using syntax like stomp+ssl://example.com:12345
, so this became an irrelevant change.
pyartcd/pyartcd/pipelines/promote.py
Outdated
self._logger.info("Signing message digest file %s...", input_path.absolute()) | ||
sig_path.parent.mkdir(parents=True, exist_ok=True) | ||
with open(input_path, "rb") as in_file, open(sig_path, "wb") as sig_file: | ||
if self.runtime.dry_run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, I would rather move the dry_run
check right at the beginning of the function
946af17
to
9e5a955
Compare
Committed some minor fixes and tested with 4.11.46 promotion: https://saml.buildvm.hosts.prod.psi.bos.redhat.com:8888/job/hack/job/yuxzhu/job/aos-cd-builds/job/build%252Fpromote-assembly/106/consoleFull |
LGTM |
This PR adds a new signing mechanism to let promote-assembly job directly send signing requests through UMB. This eliminates the intermediate step that pulling artifacts from the internet.
Thanks for the review. |
When signing a heterogeneous (multi) payload, manifests inside the manifest list should also be signed. This is missed in openshift-eng#3817.
When signing a heterogeneous (multi) payload, manifests inside the manifest list should also be signed. This is missed in openshift-eng#3817.
When signing a heterogeneous (multi) payload, manifests inside the manifest list should also be signed. This is missed in openshift-eng/aos-cd-jobs#3817.
This PR adds a new signing mechanism to let promote-assembly job directly send signing requests through UMB.
This eliminates the intermediate step that pulling artifacts from the internet.
Basically this PR gives pyartcd the ability to sign things with pure Python implementation. So that we will not need a dedicated sign-artifiacts job and also eliminate the need to hand over artifacts between jobs. Concretely, it
comes with a class AsyncUMBClient aiming to simplify send and receive UMB messages using request/response model. (Existing python library is hard to use).
class AsyncSignatory
sits on top ofclass AsyncUMBClient
, which can be called from a python script to sign artifacts:promote-assembly is updated to use
AsyncSignatory
.sign-artifacts
job is not used but I haven't removed it.