services:downstream_ci
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| services:downstream_ci [2026/10/14 13:22] – [Overview] akraitman | services:downstream_ci [2026/11/23 16:14] (current) – akraitman | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Downstream CI ====== | + | ====== Downstream CI (RDU3)====== |
| ===== Overview ===== | ===== Overview ===== | ||
| Line 57: | Line 57: | ||
| Once the migration to the RDU3 Jenkins instance is complete, the temporary migration branch can be retired and the normal production configuration workflow can be used. | Once the migration to the RDU3 Jenkins instance is complete, the temporary migration branch can be retired and the normal production configuration workflow can be used. | ||
| + | |||
| + | |||
| + | ===== Job Definitions ===== | ||
| + | |||
| + | Jobs are Jenkins Job Builder YAML in: | ||
| + | |||
| + | < | ||
| + | https:// | ||
| + | </ | ||
| + | |||
| + | * Definition: ''< | ||
| + | * Build script: ''< | ||
| + | |||
| + | To change a job: | ||
| + | |||
| + | - Branch from '' | ||
| + | - Merge. The '' | ||
| + | |||
| + | To test a branch before merging: | ||
| + | |||
| + | - Run '' | ||
| + | - Only that job is updated. It stays on the branch version until the next '' | ||
| + | |||
| + | Do not edit jobs in the Jenkins UI. The next '' | ||
| + | |||
| + | |||
| + | ===== Jenkins Access ===== | ||
| + | |||
| + | Login is Red Hat SSO. Permissions are roles in '' | ||
| + | |||
| + | Roles: '' | ||
| + | |||
| + | To give someone access: | ||
| + | |||
| + | - Add '' | ||
| + | - Open an MR to '' | ||
| + | - Restart the Jenkins pod to load it (repository README). | ||
| + | |||
| + | Notes: | ||
| + | |||
| + | * "< | ||
| + | * Roles assigned in the Jenkins UI are lost at the next restart. | ||
| Line 62: | Line 104: | ||
| The Jenkins build agents are RHEL 9 virtual machines running through OpenShift Virtualization. | The Jenkins build agents are RHEL 9 virtual machines running through OpenShift Virtualization. | ||
| + | |||
| + | Builders/ | ||
| Example agent types include: | Example agent types include: | ||
| Line 372: | Line 416: | ||
| - | ===== Migration | + | ===== Accessing Running Jenkins Builders (RDU3) |
| - | The RDU3 Jenkins | + | Jenkins |
| - | During the migration period, the RDU3-specific Jenkins configuration is maintained in the: | + | ==== 1. List running builders ==== |
| - | < | + | Log in to the RDU3 OpenShift cluster and select the Jenkins tenant namespace. |
| - | rdu3-migration | + | |
| + | < | ||
| + | oc project ceph-downstream-tenant--pipeline | ||
| + | oc get vmi | ||
| </ | </ | ||
| - | branch of: | + | Example output: |
| < | < | ||
| - | git@gitlab.cee.redhat.com: | + | NAME AGE |
| + | rhel8medium-rdu3-c36e1a98 | ||
| + | rhel9large-rdu3-8f20a52c | ||
| + | </ | ||
| + | |||
| + | Identify the running builder you want to access. | ||
| + | |||
| + | ==== 2. Forward the builder' | ||
| + | |||
| + | Open a terminal and run: | ||
| + | |||
| + | <code bash> | ||
| + | virtctl port-forward \ | ||
| + | vmi/rhel8medium-rdu3-c36e1a98 \ | ||
| + | 2222:22 | ||
| + | </ | ||
| + | |||
| + | This forwards local TCP port '' | ||
| + | |||
| + | **Keep this terminal running** while connected to the builder. | ||
| + | |||
| + | ==== 3. Connect to the builder via SSH ==== | ||
| + | |||
| + | Open a second terminal and run: | ||
| + | |||
| + | <code bash> | ||
| + | ssh -i jenkins-build.id \ | ||
| + | | ||
| + | -p 2222 \ | ||
| + | jenkins-build@127.0.0.1 | ||
| + | </code> | ||
| + | |||
| + | Replace '' | ||
| + | |||
| + | ==== Notes ==== | ||
| + | |||
| + | * You must be logged in to the RDU3 OpenShift cluster and have the required namespace permissions. | ||
| + | * VM names are dynamic. Always use '' | ||
| + | * Production builders may be in '' | ||
| + | * SSH access requires an authorized private key for the '' | ||
| + | * Do not modify or interrupt active Jenkins builds. | ||
| + | * Stop the port-forward process using '' | ||
| + | |||
| + | |||
| + | ===== Debugging Failed Builds and Builders ===== | ||
| + | |||
| + | ==== A build fails ==== | ||
| + | |||
| + | - Open the build console. Read the first '' | ||
| + | - Bare '' | ||
| + | - List the recent builds. Note the time the failure started or changed. | ||
| + | - Match that time against commits in '' | ||
| + | - Open ''< | ||
| + | |||
| + | Known signatures: | ||
| + | |||
| + | * '' | ||
| + | * '' | ||
| + | |||
| + | ==== A build waits for a builder ==== | ||
| + | |||
| + | - Manage Jenkins -> Nodes. Open the log of any offline agent. | ||
| + | - List the builder VMs and their disks. | ||
| + | - Read the namespace events. | ||
| + | - DataVolume in '' | ||
| + | - Read the controller log. It holds about 30 minutes. | ||
| + | |||
| + | <code bash> | ||
| + | oc -n ceph-downstream-tenant--pipeline get vm, | ||
| + | oc -n ceph-downstream-tenant--pipeline get events --sort-by=.lastTimestamp | tail -40 | ||
| + | oc -n ceph-downstream-tenant--pipeline get appliedclusterresourcequota -o yaml | ||
| + | oc -n ceph-downstream-tenant--pipeline logs deploy/ | ||
| + | </ | ||
| + | |||
| + | ===== Managing Jenkins Secrets with git-crypt ===== | ||
| + | |||
| + | Jenkins secrets are stored encrypted in the '' | ||
| + | |||
| + | ==== Updating an existing secret ==== | ||
| + | |||
| + | Create a new branch from '' | ||
| + | |||
| + | <code bash> | ||
| + | git switch main | ||
| + | git pull --ff-only | ||
| + | git switch -c update-jenkins-secret | ||
| + | </ | ||
| + | |||
| + | Verify that git-crypt is unlocked and that the secret is configured for encryption: | ||
| + | |||
| + | <code bash> | ||
| + | git-crypt status | ||
| + | git check-attr filter diff -- secrets/ | ||
| + | </ | ||
| + | |||
| + | Update the secret without putting its value in the shell history: | ||
| + | |||
| + | <code bash> | ||
| + | read -s SECRET_VALUE | ||
| + | echo | ||
| + | printf ' | ||
| + | unset SECRET_VALUE | ||
| + | </ | ||
| + | |||
| + | Verify the file is still managed by git-crypt: | ||
| + | |||
| + | <code bash> | ||
| + | git check-attr filter diff -- secrets/ | ||
| + | git-crypt status | ||
| + | </ | ||
| + | |||
| + | Stage and review the change: | ||
| + | |||
| + | <code bash> | ||
| + | git add secrets/ | ||
| + | git status | ||
| + | git diff --cached --stat | ||
| + | </ | ||
| + | |||
| + | Commit and push the feature branch: | ||
| + | |||
| + | <code bash> | ||
| + | git commit -m " | ||
| + | git push -u origin update-jenkins-secret | ||
| + | </ | ||
| + | |||
| + | Create an MR to '' | ||
| + | |||
| + | ==== Adding a new secret ==== | ||
| + | |||
| + | Create the new secret under '' | ||
| + | |||
| + | <code bash> | ||
| + | read -s SECRET_VALUE | ||
| + | echo | ||
| + | printf ' | ||
| + | unset SECRET_VALUE | ||
| + | </ | ||
| + | |||
| + | Make sure the new file is covered by the git-crypt rules in '' | ||
| + | |||
| + | Verify encryption before committing: | ||
| + | |||
| + | <code bash> | ||
| + | git check-attr filter diff -- secrets/& | ||
| + | git-crypt status | ||
| + | </ | ||
| + | |||
| + | Then stage '' | ||
| + | |||
| + | <code bash> | ||
| + | git add secrets/ | ||
| + | git status | ||
| + | git diff --cached --stat | ||
| </ | </ | ||
| - | This allows | + | Commit and push the feature branch, then create an MR to '' |
| - | Once the migration is complete and the RDU3 Jenkins instance becomes the primary production environment, | + | <note important> |
| + | Never paste secret values | ||
| + | </ | ||
| Line 400: | Line 602: | ||
| * Jenkins Sorter plugin | * Jenkins Sorter plugin | ||
| * RDU3 TenantEgress / EgressFirewall | * RDU3 TenantEgress / EgressFirewall | ||
| + | * Managing Jenkins Secrets git-crypt | ||
services/downstream_ci.1791984177.txt.gz · Last modified: by akraitman
