Skip to content

Commit ee1a860

Browse files
committed
deploy: 1aa2648
1 parent 4b6488e commit ee1a860

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+530
-5
lines changed

CONDUCT.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<li class="toctree-l3"><a class="reference internal" href="second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
169169
</ul>
170170
</li>
171+
<li class="toctree-l2"><a class="reference internal" href="second-analysis-steps/containers.html">Containers and running legacy code</a></li>
171172
</ul>
172173
</li>
173174
<li class="toctree-l1"><a class="reference internal" href="self-guided-lessons/README.html">Self guided lessons</a><ul>

CONTRIBUTING.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<li class="toctree-l3"><a class="reference internal" href="second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
169169
</ul>
170170
</li>
171+
<li class="toctree-l2"><a class="reference internal" href="second-analysis-steps/containers.html">Containers and running legacy code</a></li>
171172
</ul>
172173
</li>
173174
<li class="toctree-l1"><a class="reference internal" href="self-guided-lessons/README.html">Self guided lessons</a><ul>

LICENSE.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@
167167
<li class="toctree-l3"><a class="reference internal" href="second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
168168
</ul>
169169
</li>
170+
<li class="toctree-l2"><a class="reference internal" href="second-analysis-steps/containers.html">Containers and running legacy code</a></li>
170171
</ul>
171172
</li>
172173
<li class="toctree-l1"><a class="reference internal" href="self-guided-lessons/README.html">Self guided lessons</a><ul>

_sources/second-analysis-steps/README.md.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,5 @@ Before starting, you should be familiar with the [first analysis steps](/first-a
3535
ganga-scripting.md
3636
managing-files-with-ganga.md
3737
advanced-dirac.md
38+
containers.md
3839
```
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Containers and running legacy code
2+
3+
{% objectives "Learning Objectives" %}
4+
5+
* Understand how to use containers to run code requiring older operating systems
6+
7+
{% endobjectives %}
8+
9+
When running code at LHCb there are several scenarios where a user may have to run legacy code intended for an older OS.
10+
The most recent operating systems used is Redhat Enterprise Linux 9 (RHEL9).
11+
There are however, different alternatives to this OS which are roughly equivalent e.g. AlmaLinux 9, Rocky Linux 9.
12+
13+
There are a few situations where you may need to run legacy code e.g.
14+
15+
* Running code from an older analysis
16+
* Often times the code used by the Simulation working group requires older operating systems as well
17+
18+
The previously-used operating systems used by lxplus are listed below.
19+
If not RHEL9, the OS you need will almost certainly be one of thse two:
20+
21+
* Centos7 - Retired in 2023
22+
* Scientific Linux CERN 6 (SLC6) - Retired in 2018
23+
24+
{% callout "Running simulation" %}
25+
26+
The simulation framework is a common place where older operating systems are needed these are:
27+
28+
```
29+
| Simulation framework | Required OS |
30+
| -------------------- | ----------- |
31+
| Sim10 | Centos7 |
32+
| Sim09 | SLC6 |
33+
```
34+
35+
{% endcallout %}
36+
37+
38+
When running legacy code, it is not necessary to find a machine which runs the older OS nor is it necessary to make a virtual machine using the older OS. Instead we can use containers!
39+
Containers are [virtualisation](https://en.wikipedia.org/wiki/OS-level_virtualization) software which will allow for multiple operating systems to be run on the same machine, so in this case a machine running RHEL9 can instead use another OS for a while as if it were just another environment.
40+
41+
The software used on lxplus to jump from one OS to another is called `apptainer`. To be able to run centos7 software on a RHEL9 machine the following command can be used and adapted:
42+
43+
```bash
44+
apptainer exec --env LBENV_SOURCED= -B /afs/cern.ch/user -B /afs/cern.ch/work -B /cvmfs -e /cvmfs/lhcb.cern.ch/containers/os-base/centos7-devel/prod/amd64 bash --rcfile /cvmfs/lhcb.cern.ch/lib/LbEnv
45+
```
46+
47+
We can break down this command in the following way:
48+
49+
```
50+
| Command | Explanation |
51+
| -------------------------------------- | --------------------------------------------------------------- |
52+
| Apptainer | The command being run. |
53+
| exec -e <the centos7 environment> bash | Run a bash session with centos7. |
54+
| -B <directory> | These are 'binds', any directory (and its subdirectories) which |
55+
| | should be visible within the container need to be specified. |
56+
| --rcfile <group_login> | Specifies that LbEnv should be sourced. |
57+
| --env LBENV_SOURCED= | Resets the LBENV_SOURCED environment variable to reload LbEnv |
58+
```
59+
60+
The full list of available platforms is listed here[^1]:
61+
62+
```
63+
| Platform | Location |
64+
| -------- | --------------------------------------------------------------- |
65+
| slc5 | /cvmfs/lhcb.cern.ch/containers/os-base/slc6-devel/prod/amd64 |
66+
| slc6 | /cvmfs/lhcb.cern.ch/containers/os-base/slc6-devel/prod/amd64 |
67+
| centos7 | /cvmfs/lhcb.cern.ch/containers/os-base/centos7-devel/prod/amd64 |
68+
| el9 | /cvmfs/lhcb.cern.ch/containers/os-base/alma9-devel/prod/amd64 |
69+
```
70+
71+
{% challenge "Checking your OS" %}
72+
73+
At any point the OS you are using can be checked with the command `cat /etc/system-release`
74+
75+
* Try it now both in a RHEL9 environment and a singularity running Centos7 to see the operating system change!
76+
77+
{% endchallenge %}
78+
79+
{% callout "Warning: minimal use and stability" %}
80+
81+
One thing to bear in mind about using containers is that they will be less stable than the default OS on your machine.
82+
For this reason it is recommended to only use the containers to run code requiring that OS and do everything else (e.g. git stuff) outside of the container.
83+
This is especially true for containers of older systems such as SLC5 and SLC6.
84+
85+
{% endcallout %}
86+
87+
[^1]: It's also possible to get an el9 (i.e. RHEL9) platform. This allows a system running a different linux distro locally (e.g. Ubuntu, Fedora, Arch, ...) to run software compiled for EL9!

first-analysis-steps/README.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<li class="toctree-l3"><a class="reference internal" href="../second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
171171
</ul>
172172
</li>
173+
<li class="toctree-l2"><a class="reference internal" href="../second-analysis-steps/containers.html">Containers and running legacy code</a></li>
173174
</ul>
174175
</li>
175176
<li class="toctree-l1"><a class="reference internal" href="../self-guided-lessons/README.html">Self guided lessons</a><ul>

first-analysis-steps/add-tupletools.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<li class="toctree-l3"><a class="reference internal" href="../second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
171171
</ul>
172172
</li>
173+
<li class="toctree-l2"><a class="reference internal" href="../second-analysis-steps/containers.html">Containers and running legacy code</a></li>
173174
</ul>
174175
</li>
175176
<li class="toctree-l1"><a class="reference internal" href="../self-guided-lessons/README.html">Self guided lessons</a><ul>

first-analysis-steps/analysis-productions.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
<li class="toctree-l3"><a class="reference internal" href="../second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
171171
</ul>
172172
</li>
173+
<li class="toctree-l2"><a class="reference internal" href="../second-analysis-steps/containers.html">Containers and running legacy code</a></li>
173174
</ul>
174175
</li>
175176
<li class="toctree-l1"><a class="reference internal" href="../self-guided-lessons/README.html">Self guided lessons</a><ul>

first-analysis-steps/analysisflow.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<li class="toctree-l3"><a class="reference internal" href="../second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
169169
</ul>
170170
</li>
171+
<li class="toctree-l2"><a class="reference internal" href="../second-analysis-steps/containers.html">Containers and running legacy code</a></li>
171172
</ul>
172173
</li>
173174
<li class="toctree-l1"><a class="reference internal" href="../self-guided-lessons/README.html">Self guided lessons</a><ul>

first-analysis-steps/asking-questions.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@
168168
<li class="toctree-l3"><a class="reference internal" href="../second-analysis-steps/advanced-dirac.html#alternative-backends-condor">Alternative Backends - Condor</a></li>
169169
</ul>
170170
</li>
171+
<li class="toctree-l2"><a class="reference internal" href="../second-analysis-steps/containers.html">Containers and running legacy code</a></li>
171172
</ul>
172173
</li>
173174
<li class="toctree-l1"><a class="reference internal" href="../self-guided-lessons/README.html">Self guided lessons</a><ul>

0 commit comments

Comments
 (0)