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

docs: new article for demonstrating zot workflow with artifacts #125

Merged
merged 7 commits into from
Oct 6, 2023

Conversation

mbshields
Copy link
Contributor

documentation

Which issue does this PR fix:

none

What does this PR do / Why do we need it:

Demonstrates an end-to-end workflow for installing a zot registry, pushing and signing an image and artifact, and verifying the results.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@mbshields mbshields requested a review from rchincha September 12, 2023 23:16
@@ -0,0 +1,294 @@
# Software Provenance Workflow Using OCI Artifact
Copy link
Contributor

Choose a reason for hiding this comment

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

"Artifacts"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -0,0 +1,294 @@
# Software Provenance Workflow Using OCI Artifact

> :point_right: This article demonstrates an end-to-end workflow for installing a zot registry, pushing and signing an image and artifact, and verifying the results.
Copy link
Contributor

Choose a reason for hiding this comment

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

"pushing an image and related artifact (such as an SBOM)"

Drop the ", and verifying..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


## Workflow

### Step 1: Set up the environment and tools
Copy link
Contributor

Choose a reason for hiding this comment

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

Pattern here is maybe ...

For the full script, go here etc

But here is the script broken down with documentation/explanation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@mbshields
Copy link
Contributor Author

Questions:
What is the purpose of creating and truncating REF0?

How is REF0 used in the cosign commands in Step 6?

Should we show an example of the artifact tree?


### Step 1: Set up the environment and tools

As a first step, we define and create directories, then download binaries for zot, regctl, and cosign.
Copy link
Contributor

Choose a reason for hiding this comment

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

Download client tools

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

COSIGN_VERSION=2.1.1
curl -Lo ${COSIGN} https://github.com/sigstore/cosign/releases/download/v${COSIGN_VERSION}/cosign-linux-amd64
chmod +x ${COSIGN}

Copy link
Contributor

Choose a reason for hiding this comment

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

Setup a OCI Registry With Referrers Support (zot)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

{% endraw %}
```


Copy link
Contributor

Choose a reason for hiding this comment

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

Copy an image to the OCI Registry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

```


### Step 4: Copy an artifact to the zot registry
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy a Related Artifact to the OCI Registry

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

> :pencil2: If no subject is specified in the command, the artifact is considered independent and not associated with any existing image.


### Step 5: Display the artifact tree
Copy link
Contributor

Choose a reason for hiding this comment

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

+ $ regctl artifact tree localhost:8080/busybox:latest
Ref: localhost:8080/busybox:latest
Digest: sha256:9172c5f692f2c65e4f773448503b21dba2de6454bd159905c4bf6d83176e4ea3
Referrers:
  - sha256:9c0655368b10ca4b2ffe39e4dd261fb89df25a46ae92d6eb4e6e1792a451883e: application/yaml

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Command output added

```


### Step 7: Display the artifact tree
Copy link
Contributor

Choose a reason for hiding this comment

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

Ref: localhost:8080/busybox:latest
Digest: sha256:9172c5f692f2c65e4f773448503b21dba2de6454bd159905c4bf6d83176e4ea3
Referrers:
  - sha256:9c0655368b10ca4b2ffe39e4dd261fb89df25a46ae92d6eb4e6e1792a451883e: application/yaml
    Referrers:
      - sha256:06792b209137486442a2b804b2225c0014e3e238d363cdbea088bbd73207fb34: application/vnd.dev.cosign.artifact.sig.v1+json
  - sha256:995b6a78bf04a7a9676dac76b4598ccb645c17e30b02f294de9fdfa2f28eb7b2: application/vnd.dev.cosign.artifact.sig.v1+json

Copy link
Contributor

Choose a reason for hiding this comment

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

original image: localhost:8080/busybox:latest
Two direct refererrers:
artifact.yaml sha256:9c0655368b10ca4b2ffe39e4dd261fb89df25a46ae92d6eb4e6e1792a451883e: application/yaml
image signature sha256:995b6a78bf04a7a9676dac76b4598ccb645c17e30b02f294de9fdfa2f28eb7b2: application/vnd.dev.cosign.artifact.sig.v1+json

Second-level referrer for the artifact.yaml

  • sha256:06792b209137486442a2b804b2225c0014e3e238d363cdbea088bbd73207fb34: application/vnd.dev.cosign.artifact.sig.v1+json

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Command output and explanation added

@@ -115,6 +115,7 @@ nav:
- CI/CD Pipeline: articles/building-ci-cd-pipeline.md
- Authentication and Authorization: articles/authn-authz.md
- Verifying Image Signatures: articles/verifying-signatures.md
- Software Provenance Workflow Using OCI Artifacts: articles/workflow.md
Copy link
Contributor

Choose a reason for hiding this comment

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

Add this workflow.md article "link" in What's New (OCI artifacts support) - "See this article to do an end-to-end OCI artifacts workflow"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@rchincha
Copy link
Contributor

rchincha commented Oct 6, 2023

Questions: What is the purpose of creating and truncating REF0?

How is REF0 used in the cosign commands in Step 6?

Should we show an example of the artifact tree?

ref0 is for the artifact that was uploaded referring to the first container image.

Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

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

lgtm

@rchincha rchincha merged commit 209ec75 into project-zot:main Oct 6, 2023
@mbshields mbshields deleted the docs_mishield_workflow branch October 24, 2023 19:53
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