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

Adds a package signing task #189

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

Conversation

barabo
Copy link

@barabo barabo commented Feb 27, 2023

Adds a task to create package signatures for all built artifacts.

TODO

  • create a repodata.json to mimic prefect's feedstock build flow
  • create and insert an ed25519 signing key on all concourse builders
  • create a single script that will sign the files to be uploaded

@barabo barabo requested a review from dbast February 27, 2023 06:13
@barabo barabo self-assigned this Feb 27, 2023
Comment on lines +493 to +494
'find . -name "signed-artifacts" -prune -o -path "*/{subdir}/*.tar.bz2" -print0 | xargs -0 -I file mv file signed-artifacts/{subdir}\n' # NOQA
'find . -name "signed-artifacts" -prune -o -path "*/noarch/*.tar.bz2" -print0 | xargs -0 -I file mv file signed-artifacts/noarch\n' # NOQA
Copy link
Contributor

Choose a reason for hiding this comment

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

Do the .conda files need to be moved into the signed-artifacts directory 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.

I added lines for any .sig files, as well. I'm still a bit lost on why the add_consolidate_task is written the way it is. It seems like it is searching the build directory for files that shouldn't exist, but I'm wondering if it's supposed to be that way to 'consolidate' any artifacts from pre-req build operations.

@@ -19,6 +19,7 @@ requirements:
- conda
- contextlib2
- networkx >=2.0
- pynacl
Copy link
Contributor

Choose a reason for hiding this comment

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

Is pynacl needed to run c3i or is it a requirement for the .signing task? If it is the later this is not needed.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks! I was wondering if this was the right place to insert the dependency. I do believe we'll need to add it somewhere, though.

Copy link
Author

Choose a reason for hiding this comment

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

If I understand it correctly, the docker image is where the signing will occur. So, either we need to build a new docker image with pynacl baked in, or we pip install pynacl (or conda install pynacl) right before using it each time.

It's a lightweight library, so I don't feel too bad about installing it each time we use it, but it's admittedly not ideal.

The alternative of building a new docker image doesn't seem great, either.

'find . -name "signed-artifacts" -prune -o -path "*/noarch/*.conda" -print0 | xargs -0 -I file mv file signed-artifacts/noarch\n' # NOQA
'find . -name "signed-artifacts" -prune -o -path "*/{subdir}/*.sig" -print0 | xargs -0 -I file mv file signed-artifacts/{subdir}\n' # NOQA
'find . -name "signed-artifacts" -prune -o -path "*/noarch/*.sig" -print0 | xargs -0 -I file mv file signed-artifacts/noarch\n' # NOQA
'pushd signed-artifacts/{subdir} && TODO_SIGN_ARTIFACTS && popd\n' # NOQA
Copy link
Author

Choose a reason for hiding this comment

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

Any suggestions on how to implement the TODO_SIGN_ARTIFACTS piece?

I'm planning to pass in the ED25519 signing key secret as hex. It's pretty simple (~10 lines of python) to use the nacl module to create a signing key with ascii hex secrets and write out a signature file - but I feel gross inlining python in shell this way.

Copy link
Author

Choose a reason for hiding this comment

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

I also don't want to leak the signing secret in builder output, and I'm not sure if doing it this way would do that.

Copy link
Author

Choose a reason for hiding this comment

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

This is how I'm creating sig files in Prefect.

So, you can see I need the json module and nacl. That should be it.

conda_concourse_ci/execute.py Outdated Show resolved Hide resolved
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