You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Revised the Contributor Code of Conduct for clarity and inclusivity.
- Added new episodes (06-catservices.md, 07-final-run.md) to the curriculum, detailing CAT services and final run integration.
- Updated existing episodes (03-gitlabci-setenv.md, 04-gitlabci-run-analysis.md, 05-gitlabci-vomsproxy.md) with improved instructions and examples.
- Removed the outdated episode (07-building-image.md) related to container image building.
- Enhanced links.md with additional references for CMS analysis and GitLab CI/CD.
- Adjusted config.yaml to include new episodes in the lesson structure.
Copy file name to clipboardExpand all lines: CODE_OF_CONDUCT.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ We follow the [CERN Code of Conduct](https://hr-dep.web.cern.ch/content/code-of-
10
10
11
11
We commit to helping our community adhere to this code of conduct and speak up when we see possible violations of it. We strive to treat those outside of CMS as we would members of our own community. In the event that the letter or the spirit of this code has been violated, appropriate action will be taken, up to and including procedures specified in Annex A3.2 of the CMS Constitution.
12
12
13
-
If you want to know more about the *CMS Diversity & Inclusion Office* follow the [link](https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSDiversityOffice) and check out the [booklet](https://heyzine.com/flip-book/00f6546b1c.html).
13
+
You can also learn more about the [CMS Diversity & Inclusion Office](https://twiki.cern.ch/twiki/bin/view/CMSPublic/CMSDiversityOffice) and its activities. Dont forget to [check out the booklet](https://heyzine.com/flip-book/00f6546b1c.html).
Copy file name to clipboardExpand all lines: episodes/04-gitlabci-run-analysis.md
+80-4Lines changed: 80 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ exercises: 10
15
15
:::::::: objectives
16
16
17
17
- Run a CMSSW analysis job in GitLab CI using a CVMFS-enabled runner.
18
-
- Configure `.gitlab-ci.yml` to reuse a built CMSSW release via artifacts instead of rebuilding each time.
18
+
- Configure `.gitlab-ci.yml` to reuse a built CMSSW release via artifacts instead of rebuilding each time, and handle write-protection in downstream jobs.
19
19
- Validate the analysis output (ROOT file and event counts) within the CI pipeline.
20
20
21
21
::::::::
@@ -135,8 +135,13 @@ cmssw_run:
135
135
script:
136
136
- set +u && source ${CMS_PATH}/cmsset_default.sh; set -u
If you are satisfied with your pipeline, commit and push the changes. Check the pipeline logs for errors and verify that output files are produced as expected.
181
+
For the compiled code to be available in subsequent steps, the artifacts must be explicitly defined. In the `cmssw_compile` job, we specify:
182
+
183
+
```yaml
184
+
artifacts:
185
+
untracked: true
186
+
expire_in: 1 hour
187
+
paths:
188
+
- ${CMSSW_RELEASE}
189
+
```
190
+
191
+
**Key options:**
192
+
193
+
- **`untracked: true`:** Includes files not tracked by git (ignores `.gitignore`), ensuring the full CMSSW build area is captured.
194
+
- **`expire_in`:** Specifies how long artifacts are kept before automatic deletion. Use `1 hour` for testing or `1 week` for longer workflows.
195
+
- **`paths`:** Lists directories/files to preserve. Here, `${CMSSW_RELEASE}` captures the entire CMSSW work area.
196
+
197
+
:::::::: callout
198
+
199
+
### Artifacts Are Write-Protected
200
+
201
+
Artifacts are write-protected by default. You cannot modify files directly in the artifact directory in downstream jobs.
202
+
203
+
::::::::
204
+
205
+
To work around this, copy the artifact to a new directory and add write permissions:
206
+
207
+
```yaml
208
+
script:
209
+
- set +u && source ${CMS_PATH}/cmsset_default.sh; set -u
This ensures `cmssw_run` and `check_events` can reuse the built CMSSW area without rebuilding, while still being able to write output files.
223
+
224
+
### Using `needs` vs `dependencies`
225
+
226
+
In the pipeline above, we use the `needs` keyword to define job dependencies:
227
+
228
+
```yaml
229
+
cmssw_run:
230
+
needs:
231
+
- cmssw_compile
232
+
stage: run
233
+
# ...
234
+
```
235
+
236
+
**Differences between `needs` and `dependencies`:**
237
+
238
+
| Keyword | Behavior |
239
+
|---------|----------|
240
+
| [`needs`][gitlab-need] | Job starts **immediately** when the needed job completes, regardless of stage. Enables parallelism. |
241
+
| [`dependencies`][gitlab-dependencies] | Job starts only when **all jobs in the prior stage** complete. Strictly follows stage order. |
242
+
243
+
**Best practice:** Use `needs` for faster pipelines—it allows jobs to start as soon as their dependencies are met, rather than waiting for an entire stage to finish.
172
244
173
245
::::::: discussion
174
246
#### How does this updated pipeline improve efficiency?
@@ -210,7 +282,11 @@ If yes, you dont need the rest of the lessons. If they are failing, continue wit
210
282
:::::: keypoints
211
283
212
284
- GitLab CI runs on remote runners; every dependency and setup step must be in `.gitlab-ci.yml`.
285
+
- Use CVMFS-enabled Kubernetes runners (`k8s-cvmfs`); the `image:` keyword is honored only there.
213
286
- Split the pipeline into stages and pass the built CMSSW area via artifacts to avoid rebuilding in each job.
214
287
- Validate outputs in CI (e.g., `myZPeak.root`, event counts) to catch issues early; inspect job logs for failures.
288
+
- Artifacts are write-protected by default; downstream jobs must copy them to a writable directory using `mkdir`, `cp -r`, and `chmod -R +w`.
289
+
- Define artifacts with `untracked: true` to capture build outputs, and set `expire_in` to control automatic cleanup (e.g., `1 hour` for testing, `1 week` for production).
290
+
- Use the `needs` keyword for faster pipelines—jobs start immediately when dependencies complete, rather than waiting for entire stages to finish. `dependencies` is an alternative that strictly respects stage order.
Copy file name to clipboardExpand all lines: episodes/05-gitlabci-vomsproxy.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -198,13 +198,13 @@ For each variable:
198
198
199
199
The **Settings > CI/CD > Variables** section should look like this:
200
200
201
-

201
+
{alt='CI/CD Variables section with grid secrets added'}
202
202
203
203
### Protect Your Main Branch
204
204
205
205
To reduce the risk of leaking passwords and certificates to others, go to **Settings > Repository > Protected Branches** and protect your `master` or `main` branch. This prevents collaborators from pushing directly and accidentally exposing secrets in job logs.
206
206
207
-

207
+
{alt='Protecting branches to prevent password leaks'}
208
208
209
209
With the **Protected** option enabled for variables, they are only available to those protected branches (though Maintainers can still push to them).
0 commit comments