User Tools

Site Tools


services:downstream_ci

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
services:downstream_ci [2026/10/26 14:24] – [Migration] akraitmanservices:downstream_ci [2026/11/23 16:14] (current) – akraitman
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:
 +
 +<code>
 +https://gitlab.cee.redhat.com/ceph/rhcs-jenkins-jobs
 +</code>
 +
 +  * Definition: ''<job>/config/definitions/<job>.yaml''
 +  * Build script: ''<job>/build/build''
 +
 +To change a job:
 +
 +  - Branch from ''master'', edit, open an MR.
 +  - Merge. The ''jenkins-job-builder'' job runs on every push to ''master'' and updates all jobs.
 +
 +To test a branch before merging:
 +
 +  - Run ''jenkins-job-builder'' with ''GITLAB_BRANCH=<branch>'' and ''JOB_NAME=<job>''.
 +  - Only that job is updated. It stays on the branch version until the next ''master'' run.
 +
 +Do not edit jobs in the Jenkins UI. The next ''master'' run overwrites them.
 +
 +
 +===== Jenkins Access =====
 +
 +Login is Red Hat SSO. Permissions are roles in ''casc.yaml'' in the [[https://gitlab.cee.redhat.com/ccit/jenkins-csb-customers/storage-casc-ceph-downstream/-/blob/main/casc.yaml#L675|configuration repository]], under ''jenkins.authorizationStrategy''.
 +
 +Roles: ''admin'', ''admin_read'', ''ceph-dev-qe-config'', ''schedule_build'', ''readonly''.
 +
 +To give someone access:
 +
 +  - Add ''%%- user: "<kerberos id>"%%'' under the role's ''entries''. Use ''%%- group: "<name>"%%'' for an SSO group.
 +  - Open an MR to ''main''. Merge.
 +  - Restart the Jenkins pod to load it (repository README).
 +
 +Notes:
 +
 +  * "<user> is missing the Overall/Read permission" means the user is in no role.
 +  * 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/OCP VM's subnet is 10.5.225.0/24
  
 Example agent types include: Example agent types include:
Line 371: Line 415:
 Changes should first be validated in ''ceph-downstream-tenant--runtime-int'' before being applied to ''ceph-downstream-tenant--pipeline''. Changes should first be validated in ''ceph-downstream-tenant--runtime-int'' before being applied to ''ceph-downstream-tenant--pipeline''.
  
 +
 +===== Accessing Running Jenkins Builders (RDU3) =====
 +
 +Jenkins builders run as KubeVirt Virtual Machines (VMs) in the RDU3 OpenShift cluster. Developers can access running builders via SSH using ''virtctl port-forward''.
 +
 +==== 1. List running builders ====
 +
 +Log in to the RDU3 OpenShift cluster and select the Jenkins tenant namespace.
 +
 +<code bash>
 +oc project ceph-downstream-tenant--pipeline
 +oc get vmi
 +</code>
 +
 +Example output:
 +
 +<code>
 +NAME                        AGE     PHASE     IP             NODENAME                                    READY
 +rhel8medium-rdu3-c36e1a98   8h      Running   172.17.44.37   worker07.itup-003.prod.rdu3.dc.redhat.com   True
 +rhel9large-rdu3-8f20a52c    5h38m   Running   172.19.12.11   worker26.itup-003.prod.rdu3.dc.redhat.com   True
 +</code>
 +
 +Identify the running builder you want to access.
 +
 +==== 2. Forward the builder's SSH port ====
 +
 +Open a terminal and run:
 +
 +<code bash>
 +virtctl port-forward \
 +  vmi/rhel8medium-rdu3-c36e1a98 \
 +  2222:22
 +</code>
 +
 +This forwards local TCP port ''2222'' to SSH port ''22'' on the selected VM.
 +
 +**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 \
 +  -o IdentitiesOnly=yes \
 +  -p 2222 \
 +  jenkins-build@127.0.0.1
 +</code>
 +
 +Replace ''jenkins-build.id'' with the path to your authorized SSH private key.
 +
 +==== Notes ====
 +
 +  * You must be logged in to the RDU3 OpenShift cluster and have the required namespace permissions.
 +  * VM names are dynamic. Always use ''oc get vmi'' to find the current running builder.
 +  * Production builders may be in ''ceph-downstream-tenant--pipeline''. Select the namespace containing your target VM.
 +  * SSH access requires an authorized private key for the ''jenkins-build'' user.
 +  * Do not modify or interrupt active Jenkins builds.
 +  * Stop the port-forward process using ''Ctrl+C'' when finished.
 +
 +
 +===== Debugging Failed Builds and Builders =====
 +
 +==== A build fails ====
 +
 +  - Open the build console. Read the first ''ERROR''.
 +  - Bare ''java.lang.NullPointerException'' with no stack trace: open the first failed build after the last green one. It has the trace.
 +  - List the recent builds. Note the time the failure started or changed.
 +  - Match that time against commits in ''rhcs-jenkins-jobs'' and ''storage-casc-ceph-downstream''.
 +  - Open ''<jenkins url>/job/<job>/config.xml'' and compare it with ''master''. The job may be running a test branch (see Job Definitions).
 +
 +Known signatures:
 +
 +  * ''NullPointerException'' in ''SecretBuildWrapper.buildEnvVars'': a credential binding in the job has no ''variable''.
 +  * ''Permission denied (publickey)'' from GitHub: the credential is named in the ''[ssh-agent] Using credentials'' line. Check the key is still on the GitHub account at ''https://github.com/<account>.keys''.
 +
 +==== 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 ''ErrExceededQuota'': the storage quota is full. No new builder starts until a running one finishes. Check the quota.
 +  - Read the controller log. It holds about 30 minutes.
 +
 +<code bash>
 +oc -n ceph-downstream-tenant--pipeline get vm,vmi,dv,pvc
 +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/ceph-downstream-jenkins | grep -iE 'kubevirt|Timed out waiting'
 +</code>
  
 ===== Managing Jenkins Secrets with git-crypt ===== ===== Managing Jenkins Secrets with git-crypt =====
Line 468: Line 602:
   * Jenkins Sorter plugin   * Jenkins Sorter plugin
   * RDU3 TenantEgress / EgressFirewall   * RDU3 TenantEgress / EgressFirewall
 +  * Managing Jenkins Secrets git-crypt
services/downstream_ci.1793024658.txt.gz · Last modified: by akraitman