Skip to content

Commit 6bb8307

Browse files
anithapriyanatarajanvdemeester
authored andcommitted
fix: release pipeline feedback
1 parent bc1e05b commit 6bb8307

File tree

2 files changed

+24
-71
lines changed

2 files changed

+24
-71
lines changed

tekton/README.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -146,56 +146,7 @@ Command to create a kubeconfig in your local could be obtained from console navi
146146

147147
1. [Setup a context to connect to the dogfooding cluster](./release-cheat-sheet.md#setup-dogfooding-context)
148148

149-
1. When executing release pipelines, some tasks require `oci cli` commands. The CLI requires credentials which should be created as a Kubernetes secret and mounted to the respective task's workspace. For example refer the precheck definition.
150-
```
151-
- name: precheck
152-
runAfter: [git-clone]
153-
taskRef:
154-
resolver: git
155-
params:
156-
- name: url
157-
value: https://github.com/tektoncd/plumbing
158-
- name: revision
159-
value: 8d3152d3d39982ce1768325b373d321efaa83031
160-
- name: pathInRepo
161-
value: tekton/resources/release/base/prerelease_checks_oci.yaml
162-
params:
163-
- name: package
164-
value: $(params.package)
165-
- name: versionTag
166-
value: $(params.versionTag)
167-
- name: releaseBucket
168-
value: $(params.releaseBucket)/$(params.repoName)
169-
workspaces:
170-
- name: source-to-release
171-
workspace: workarea
172-
subPath: git
173-
- name: oci-credentials
174-
workspace: release-secret
175-
```
176-
Sample secret template for reference:
177-
```
178-
apiVersion: v1
179-
kind: Secret
180-
metadata:
181-
name: oci-credentials
182-
type: Opaque
183-
stringData:
184-
# REQUIRED: OCI API Private Key (PEM format)
185-
oci_api_key.pem: |
186-
-----BEGIN RSA PRIVATE KEY-----
187-
YOUR_ACTUAL_PRIVATE_KEY_CONTENT_HERE
188-
-----END RSA PRIVATE KEY-----
189-
190-
# REQUIRED: API Key Fingerprint
191-
fingerprint: "YOUR_API_KEY_FINGERPRINT_HERE"
192-
193-
# OPTIONAL: These can be provided as task parameters instead
194-
tenancy_ocid: "ocid1.tenancy.oc1..example_tenancy_id"
195-
user_ocid: "ocid1.user.oc1..example_user_id"
196-
region: "us-ashburn-1"
197-
namespace: "your-namespace-here" # Will be auto-detected if not provided
198-
```
149+
1. NOTE: When executing release pipelines, some tasks require OCI CLI commands which need credentials. The OCI credentials secret is already deployed to the dogfooding cluster via terraform and is mounted as a workspace to tasks that require it (such as the precheck task). Release managers do not need to create this secret manually. This is stated here for troubleshooting purposes.
199150

200151
### Setup post processing
201152

tekton/release-cheat-sheet.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ the pipelines repo, a terminal window and a text editor.
7272
1. Create a workspace template file:
7373
7474
```bash
75-
cat <<EOF > workspace-template.yaml
76-
spec:
77-
accessModes:
78-
- ReadWriteOnce
79-
resources:
80-
requests:
81-
storage: 1Gi
82-
EOF
75+
WORKSPACE_TEMPLATE=$(mktemp /tmp/workspace-template.XXXXXX.yaml)
76+
cat <<'EOF' > $WORKSPACE_TEMPLATE
77+
spec:
78+
accessModes:
79+
- ReadWriteOnce
80+
resources:
81+
requests:
82+
storage: 1Gi
83+
EOF
8384
```
8485

8586
1. Execute the release pipeline (takes ~45 mins).
@@ -101,9 +102,9 @@ the pipelines repo, a terminal window and a text editor.
101102
--param versionTag="${TEKTON_VERSION}" \
102103
--param releaseBucket=tekton-releases \
103104
--param koExtraArgs="" \
104-
--workspace name=release-secret,secret=release-secret \
105+
--workspace name=release-secret,secret=oci-release-secret \
105106
--workspace name=release-images-secret,secret=ghcr-creds \
106-
--workspace name=workarea,volumeClaimTemplateFile=workspace-template.yaml \
107+
--workspace name=workarea,volumeClaimTemplateFile="${WORKSPACE_TEMPLATE}" \
107108
--tasks-timeout 2h \
108109
--pipeline-timeout 3h
109110
```
@@ -136,7 +137,7 @@ the pipelines repo, a terminal window and a text editor.
136137
1. Find the Rekor UUID for the release
137138

138139
```bash
139-
RELEASE_FILE=https://infra.tekton.dev/tekton-releases/triggers/previous/${VERSION_TAG}/release.yaml
140+
RELEASE_FILE=https://infra.tekton.dev/tekton-releases/pipeline/previous/${TEKTON_VERSION}/release.yaml
140141
CONTROLLER_IMAGE_SHA=$(curl -L $RELEASE_FILE | sed -n 's/"//g;s/.*ghcr\.io.*controller.*@//p;')
141142
REKOR_UUID=$(rekor-cli search --sha $CONTROLLER_IMAGE_SHA | grep -v Found | head -1)
142143
echo -e "CONTROLLER_IMAGE_SHA: ${CONTROLLER_IMAGE_SHA}\nREKOR_UUID: ${REKOR_UUID}"
@@ -147,19 +148,20 @@ the pipelines repo, a terminal window and a text editor.
147148
Create a pod template file:
148149

149150
```shell
150-
cat <<EOF > tekton/pod-template.yaml
151-
securityContext:
152-
fsGroup: 65532
153-
runAsUser: 65532
154-
runAsNonRoot: true
155-
EOF
151+
POD_TEMPLATE=$(mktemp /tmp/pod-template.XXXXXX.yaml)
152+
cat <<'EOF' > $POD_TEMPLATE
153+
securityContext:
154+
fsGroup: 65532
155+
runAsUser: 65532
156+
runAsNonRoot: true
157+
EOF
156158
```
157-
```shell
158159

160+
```shell
159161
tkn pipeline start \
160-
--workspace name=shared,volumeClaimTemplateFile=workspace-template.yaml \
162+
--workspace name=shared,volumeClaimTemplateFile="${WORKSPACE_TEMPLATE}" \
161163
--workspace name=credentials,secret=oci-release-secret \
162-
--pod-template pod-template.yaml \
164+
--pod-template "${POD_TEMPLATE}" \
163165
-p package="${TEKTON_PACKAGE}" \
164166
-p git-revision="$TEKTON_RELEASE_GIT_SHA" \
165167
-p release-tag="${TEKTON_VERSION}" \
@@ -220,7 +222,7 @@ the pipelines repo, a terminal window and a text editor.
220222
Optional: Add a photo of this release's "purr programmer" (someone's cat).
221223
222224
1. Update [the catalog repo](https://github.com/tektoncd/catalog) test infrastructure
223-
to use the new release by updating the `RELEASE_YAML` link in [e2e-tests.sh](https://github.com/tektoncd/catalog/blob/main/test/e2e-tests.sh).
225+
to use the new release by updating the test matrix in the `[ci.yaml](https://github.com/tektoncd/catalog/blob/main/.github/workflows/ci.yaml)`.
224226
225227
1. Update [the plumbing repo](https://github.com/tektoncd/plumbing/blob/d244554a42d7b6a5f1180c58c513eeecc9febcde/tekton/cd/pipeline/overlays/oci-ci-cd/kustomization.yaml#L4) to deploy the latest version to the dogfooging cluster on OCI.
226228

0 commit comments

Comments
 (0)