|
| 1 | +--- |
| 2 | +apiVersion: tekton.dev/v1 |
| 3 | +kind: Task |
| 4 | +metadata: |
| 5 | + name: direct-sign-index-image |
| 6 | + annotations: |
| 7 | + tekton.dev/pipelines.minVersion: "0.12.1" |
| 8 | + tekton.dev/tags: release |
| 9 | +spec: |
| 10 | + description: |- |
| 11 | + Creates InternalRequests to sign FBC index images via the container-signing pipeline |
| 12 | + params: |
| 13 | + - name: dataPath |
| 14 | + description: Path to the JSON string of the merged data to use in the data workspace |
| 15 | + type: string |
| 16 | + - name: requester |
| 17 | + type: string |
| 18 | + description: Name of the user that requested the signing, for auditing purposes |
| 19 | + - name: requestTimeout |
| 20 | + type: string |
| 21 | + default: "1800" |
| 22 | + description: InternalRequest timeout |
| 23 | + - name: pipelineRunUid |
| 24 | + type: string |
| 25 | + description: The uid of the current pipelineRun. Used as a label value when creating internal requests |
| 26 | + - name: fbcResultsPath |
| 27 | + type: string |
| 28 | + description: Path to the JSON file in the data workspace containing fbc results |
| 29 | + - name: concurrentLimit |
| 30 | + type: string |
| 31 | + description: The maximum number of concurrent signing requests |
| 32 | + default: 8 |
| 33 | + - name: ociStorage |
| 34 | + description: The OCI repository where the Trusted Artifacts are stored |
| 35 | + type: string |
| 36 | + default: "empty" |
| 37 | + - name: ociArtifactExpiresAfter |
| 38 | + description: Expiration date for the trusted artifacts created in the |
| 39 | + OCI repository. An empty string means the artifacts do not expire |
| 40 | + type: string |
| 41 | + default: "1d" |
| 42 | + - name: trustedArtifactsDebug |
| 43 | + description: Flag to enable debug logging in trusted artifacts. Set to a non-empty string to enable |
| 44 | + type: string |
| 45 | + default: "" |
| 46 | + - name: orasOptions |
| 47 | + description: oras options to pass to Trusted Artifacts calls |
| 48 | + type: string |
| 49 | + default: "" |
| 50 | + - name: sourceDataArtifact |
| 51 | + type: string |
| 52 | + description: Location of trusted artifacts to be used to populate data directory |
| 53 | + default: "" |
| 54 | + - name: dataDir |
| 55 | + description: The location where data will be stored |
| 56 | + type: string |
| 57 | + default: /var/workdir/release |
| 58 | + - name: taskGitUrl |
| 59 | + type: string |
| 60 | + description: The url to the git repo where the release-service-catalog tasks and stepactions to be used are stored |
| 61 | + - name: taskGitRevision |
| 62 | + type: string |
| 63 | + description: The revision in the taskGitUrl repo to be used |
| 64 | + - name: pyxisServer |
| 65 | + type: string |
| 66 | + description: >- |
| 67 | + The server type to use. Options are 'production','production-internal','stage-internal' and 'stage' |
| 68 | + default: production |
| 69 | + - name: pyxisSecret |
| 70 | + type: string |
| 71 | + description: | |
| 72 | + The kubernetes secret to use to authenticate to Pyxis. It needs to contain two keys: key and cert |
| 73 | + - name: batchLimit |
| 74 | + type: string |
| 75 | + description: | |
| 76 | + Maximum size in bytes of each base64-encoded signing_requests batch sent via InternalRequest |
| 77 | + default: 15000 |
| 78 | + - name: caTrustConfigMapName |
| 79 | + type: string |
| 80 | + description: The name of the ConfigMap to read CA bundle data from |
| 81 | + default: trusted-ca |
| 82 | + - name: caTrustConfigMapKey |
| 83 | + type: string |
| 84 | + description: The name of the key in the ConfigMap that contains the CA bundle data |
| 85 | + default: ca-bundle.crt |
| 86 | + - name: failOnSignatureLookupError |
| 87 | + type: string |
| 88 | + default: "true" |
| 89 | + description: | |
| 90 | + Fail the task when any Pyxis find_signatures lookup fails; when set to "false", log a warning |
| 91 | + and submit every planned image row for signing without skipping already-signed references |
| 92 | + - name: signingRepo |
| 93 | + type: string |
| 94 | + description: Git repository URL containing the signing tasks |
| 95 | + default: "https://gitlab.cee.redhat.com/signing/signing.git" |
| 96 | + - name: signingRevision |
| 97 | + type: string |
| 98 | + description: Git revision (branch, tag, or commit) in the signing repository |
| 99 | + default: "main" |
| 100 | + - name: signPipeline |
| 101 | + type: string |
| 102 | + description: Name of the internal pipeline to use for container signing |
| 103 | + default: "container-signing" |
| 104 | + - name: signPipelineServiceAccount |
| 105 | + type: string |
| 106 | + description: Service account to use for the signing pipeline |
| 107 | + default: "signing-pipeline-sa" |
| 108 | + - name: pipelineImage |
| 109 | + type: string |
| 110 | + description: The image to use for the signing pipeline |
| 111 | + default: quay.io/konflux-ci/signing:latest |
| 112 | + results: |
| 113 | + - name: sourceDataArtifact |
| 114 | + type: string |
| 115 | + description: Produced trusted data artifact |
| 116 | + volumes: |
| 117 | + - name: workdir |
| 118 | + emptyDir: {} |
| 119 | + - name: pyxis-secret-vol |
| 120 | + secret: |
| 121 | + secretName: $(params.pyxisSecret) |
| 122 | + defaultMode: 0444 |
| 123 | + - name: trusted-ca |
| 124 | + configMap: |
| 125 | + name: $(params.caTrustConfigMapName) |
| 126 | + items: |
| 127 | + - key: $(params.caTrustConfigMapKey) |
| 128 | + path: ca-bundle.crt |
| 129 | + optional: true |
| 130 | + |
| 131 | + stepTemplate: |
| 132 | + volumeMounts: |
| 133 | + - mountPath: /var/workdir |
| 134 | + name: workdir |
| 135 | + - name: trusted-ca |
| 136 | + mountPath: /mnt/trusted-ca |
| 137 | + readOnly: true |
| 138 | + securityContext: |
| 139 | + runAsUser: 1001 |
| 140 | + env: |
| 141 | + - name: IMAGE_EXPIRES_AFTER |
| 142 | + value: $(params.ociArtifactExpiresAfter) |
| 143 | + - name: "ORAS_OPTIONS" |
| 144 | + value: "$(params.orasOptions)" |
| 145 | + - name: "DEBUG" |
| 146 | + value: "$(params.trustedArtifactsDebug)" |
| 147 | + steps: |
| 148 | + - name: use-trusted-artifact |
| 149 | + computeResources: |
| 150 | + limits: |
| 151 | + memory: 64Mi |
| 152 | + requests: |
| 153 | + memory: 64Mi |
| 154 | + cpu: 30m |
| 155 | + ref: |
| 156 | + resolver: "git" |
| 157 | + params: |
| 158 | + - name: url |
| 159 | + value: $(params.taskGitUrl) |
| 160 | + - name: revision |
| 161 | + value: $(params.taskGitRevision) |
| 162 | + - name: pathInRepo |
| 163 | + value: stepactions/use-trusted-artifact/use-trusted-artifact.yaml |
| 164 | + params: |
| 165 | + - name: workDir |
| 166 | + value: $(params.dataDir) |
| 167 | + - name: sourceDataArtifact |
| 168 | + value: $(params.sourceDataArtifact) |
| 169 | + - name: direct-sign-index-image |
| 170 | + # TODO: Change the image once the CLI is available in quay.io/konflux-ci/release-service-utils |
| 171 | + image: quay.io/konflux-ci/release-service-utils@sha256:3cb03b14ac9d90ff27070036ce2b50712e65aa285daeb28852254a745bb25dfc |
| 172 | + computeResources: |
| 173 | + limits: |
| 174 | + memory: 1Gi |
| 175 | + requests: |
| 176 | + memory: 1Gi |
| 177 | + cpu: 250m |
| 178 | + volumeMounts: |
| 179 | + - name: pyxis-secret-vol |
| 180 | + mountPath: "/etc/secrets" |
| 181 | + env: |
| 182 | + - name: PYXIS_CERT_PATH |
| 183 | + value: /etc/secrets/cert |
| 184 | + - name: PYXIS_KEY_PATH |
| 185 | + value: /etc/secrets/key |
| 186 | + command: |
| 187 | + - direct_sign_index_image.py |
| 188 | + args: |
| 189 | + - "--pyxis-server" |
| 190 | + - "$(params.pyxisServer)" |
| 191 | + - "--fbc-results" |
| 192 | + - "$(params.dataDir)/$(params.fbcResultsPath)" |
| 193 | + - "--data-file" |
| 194 | + - "$(params.dataDir)/$(params.dataPath)" |
| 195 | + - "--batch-max-size" |
| 196 | + - "$(params.batchLimit)" |
| 197 | + - "--fail-on-lookup-error" |
| 198 | + - "$(params.failOnSignatureLookupError)" |
| 199 | + - "--requester" |
| 200 | + - "$(params.requester)" |
| 201 | + - "--pipeline" |
| 202 | + - "$(params.signPipeline)" |
| 203 | + - "--pipeline-image" |
| 204 | + - "$(params.pipelineImage)" |
| 205 | + - "--service-account" |
| 206 | + - "$(params.signPipelineServiceAccount)" |
| 207 | + - "--request-timeout" |
| 208 | + - "$(params.requestTimeout)" |
| 209 | + - "--task-id" |
| 210 | + - "$(context.taskRun.uid)" |
| 211 | + - "--pipelinerun-uid" |
| 212 | + - "$(params.pipelineRunUid)" |
| 213 | + - "--signing-repo" |
| 214 | + - "$(params.signingRepo)" |
| 215 | + - "--signing-revision" |
| 216 | + - "$(params.signingRevision)" |
| 217 | + - "--concurrent-limit" |
| 218 | + - "$(params.concurrentLimit)" |
| 219 | + |
| 220 | + - name: create-trusted-artifact |
| 221 | + computeResources: |
| 222 | + limits: |
| 223 | + memory: 128Mi |
| 224 | + requests: |
| 225 | + memory: 128Mi |
| 226 | + cpu: 250m |
| 227 | + ref: |
| 228 | + resolver: "git" |
| 229 | + params: |
| 230 | + - name: url |
| 231 | + value: $(params.taskGitUrl) |
| 232 | + - name: revision |
| 233 | + value: $(params.taskGitRevision) |
| 234 | + - name: pathInRepo |
| 235 | + value: stepactions/create-trusted-artifact/create-trusted-artifact.yaml |
| 236 | + params: |
| 237 | + - name: ociStorage |
| 238 | + value: $(params.ociStorage) |
| 239 | + - name: workDir |
| 240 | + value: $(params.dataDir) |
| 241 | + - name: sourceDataArtifact |
| 242 | + value: $(results.sourceDataArtifact.path) |
0 commit comments