YouTube2Text

ARCHER2 - Containers for Reproducible Research: Introduction to Podman and Singularity - Session 3 — Transcript

by ARCHER2 HPC · 9,151 words · 1,508 segments · language en · Watch on YouTube

Full transcript

  1. 0:05Good morning everyone. So uh yeah thank
  2. 0:08you for joining
  3. 0:11today's course. Uh on Monday we learn uh
  4. 0:15about podman how to uh create uh
  5. 0:18containers how to use uh containers
  6. 0:21using a podman or well the
  7. 0:26it's a similar if we use uh docker so
  8. 0:30let's see the concepts that we have
  9. 0:31learned and the commands that we have
  10. 0:34learned are pretty similar just like a
  11. 0:36changing podman
  12. 0:39um yeah rather than typing podman and uh
  13. 0:42command docker the command that will be
  14. 0:45the same. Today we will see more about
  15. 0:48uh uh singularity
  16. 0:52uh as I yeah the lesson I share the
  17. 0:55lesson in the in the chat
  18. 0:58and I will um we'll go through it. Today
  19. 1:03we will use archer too. So uh if uh you
  20. 1:09have an account and you are able to log
  21. 1:12in you're ready if not let me know and
  22. 1:15we we can find a find a a solution.
  23. 1:20So what I will do is I will share the
  24. 1:24yeah the website.
  25. 1:29Let me see if I can possibly close the
  26. 1:33this.
  27. 1:37Yeah.
  28. 1:39And
  29. 1:42no, I want to show is this one. Yeah.
  30. 1:52Make this bigger. Yeah.
  31. 1:57This
  32. 2:03I yeah hopefully you can see the the
  33. 2:06website. So uh this is uh the course
  34. 2:09material for the second day and this is
  35. 2:12what we will cover. Uh the structure
  36. 2:16will be in the in the morning. Uh we
  37. 2:18will see about singularity and uh how to
  38. 2:24uh play with that on archer 2 and in the
  39. 2:27afternoon will be two uh will be like a
  40. 2:30well two exercises for you to uh follow
  41. 2:37and also the afternoon will be for you
  42. 2:39to ask a questions or if you have any
  43. 2:43anything that you would like to do. So
  44. 2:45will be like a more self pace. I'll be
  45. 2:49around but uh yeah will be like only
  46. 2:53well only will be exercises. The morning
  47. 2:56will be more uh well theory like how to
  48. 2:59use singularity
  49. 3:02on archer 2.
  50. 3:06So yeah, I guess that we can uh
  51. 3:10start here is explain a bit about uh
  52. 3:14uh what is singularity. Uh the idea of
  53. 3:18sing uh singularity uh is like a similar
  54. 3:23to u
  55. 3:25uh uh docker or podman but is more uh is
  56. 3:30like a more target to uh HPC systems.
  57. 3:35uh more target because it's more uh they
  58. 3:39have like some uh security uh features
  59. 3:44that uh are not in
  60. 3:47podman and docker. I don't mean that
  61. 3:51using a I mean in your in your laptop is
  62. 3:55safe to use podman or docker but on a
  63. 4:00share res resorts on a HPC system like a
  64. 4:03archer 2 series or any other
  65. 4:06supercomputers that you may have access
  66. 4:09that are some characteristics that uh
  67. 4:12yeah are not like suitable. We will see
  68. 4:16later today why uh one of the reasons
  69. 4:19for instance if you remember the first
  70. 4:21day when we check uh when we are in the
  71. 4:26container and we use who am I h I get
  72. 4:30that I'm root rather than the user so
  73. 4:33that could be a bit uh
  74. 4:37complicated for when we use an HPC
  75. 4:40system. So singularity has like some
  76. 4:43features that make it usable for a sh in
  77. 4:48on a shared resource.
  78. 4:51Here is also explain a little bit of
  79. 4:53history of uh about the singularity or
  80. 4:57maybe you you hear about obtainer. Some
  81. 5:00people said why
  82. 5:03or you can you may find why is not use
  83. 5:06obtainer and is use singularity.
  84. 5:09Uh, Singularity started as an
  85. 5:11open-source uh uh
  86. 5:15uh project.
  87. 5:18the not a problem but a while ago
  88. 5:22uh was um in Singularity started with
  89. 5:26the two versions the open an open
  90. 5:30version that is a singularity C
  91. 5:34community edition and a commercial uh
  92. 5:37edition.
  93. 5:39So uh that was a bit uh yeah not let's
  94. 5:43say were not tricky was not like maybe
  95. 5:47not following the
  96. 5:50um
  97. 5:52yeah was like yeah creating like two
  98. 5:55versions one commercial one that was not
  99. 5:58commercial. So there were some concerns
  100. 6:00because this yeah the this was an open
  101. 6:04source project and but it's not let's
  102. 6:06say it's not the first time that this uh
  103. 6:09happens and uh what uh but um the
  104. 6:15solution was to uh what solution like
  105. 6:19obtainer was a let's say a fork of that
  106. 6:23project. So obtainer is a open open
  107. 6:27source and follow the same uh the same
  108. 6:30but in the for instance on archer 2 we
  109. 6:33have install singularity the community
  110. 6:36edition if you use sirus sirus is
  111. 6:40obtainer but uh
  112. 6:43doesn't change anything the features
  113. 6:45will be the same like yes like yeah well
  114. 6:49not yesterday two days ago again that we
  115. 6:52saw a OD man uh uh docker so will be
  116. 6:57kind of uh similar
  117. 7:02uh okay so now we will start with to
  118. 7:05check how singularity singularity works
  119. 7:09so we will log to uh archer 2 uh I will
  120. 7:14make yeah give me a moment Find
  121. 7:16something.
  122. 7:40I will look into. So, okay. I I need to
  123. 7:44stop sharing. Um share my screen.
  124. 7:54No, I don't want to share that.
  125. 7:58I want to share this
  126. 8:03to make the font bigger.
  127. 8:08So uh
  128. 8:11yeah there are as like the first day
  129. 8:13there are like the option of following
  130. 8:15the
  131. 8:17the exercises uh well following the
  132. 8:21replicating the what I'm typing on the
  133. 8:25on the window or you just can follow the
  134. 8:29as I said also first day that this uh
  135. 8:32this will be recorded so you can go on
  136. 8:34your own page in case that uh
  137. 8:38you want to uh yeah
  138. 8:41replicate what we are doing uh uh today.
  139. 8:46So I'm uh here I well I created a folder
  140. 8:50called singularity and I'm in that uh
  141. 8:53folder
  142. 8:56actually I can be
  143. 9:03yeah we can use that because uh uh this
  144. 9:06folder if I oops if we type here where
  145. 9:09we are we are in the work uh directory
  146. 9:12but it's not uh actually we switch to
  147. 9:14home directory Sorry,
  148. 9:19I will create a folder called here
  149. 9:21singularity or actually you can call it
  150. 9:23a container. So,
  151. 9:30and now I'm here in a home. I'm not sure
  152. 9:34if you are familiar with Archer 2 that
  153. 9:37in Archer 2 we have a two partitions. We
  154. 9:39have a SLHOM and SLwork. If we want to
  155. 9:44submit something to the compute node, we
  156. 9:47will need to move to slash work. We will
  157. 9:50do that later
  158. 9:52um
  159. 9:54in the afternoon. Also a heads up that
  160. 9:57uh because of what you may be aware that
  161. 10:00uh in the UK there is
  162. 10:04heat wave. So uh part of Archer 2 is not
  163. 10:08uh Archer 2 is running at a reduced uh
  164. 10:12capabilities not uh I think it's now 25%
  165. 10:16of the machine. So my recommendation is
  166. 10:19to use the short Q. If you use the
  167. 10:22standard Q you may see for a while on
  168. 10:25the the the queue.
  169. 10:28You see that this is because I'm using
  170. 10:30the my staff account se. But if you type
  171. 10:35a PWD, you must get a TA
  172. 10:3923
  173. 10:42six maybe or yeah the the number of your
  174. 10:46of the the train the training project.
  175. 10:50Any questions so far? Everyone is uh
  176. 10:54ready to keep going. Uh
  177. 10:57any issues or logging in or
  178. 11:04Hopefully not. If uh if so, just let me
  179. 11:08know. I'm happy to. Yeah.
  180. 11:13Okay. So, uh let's continue. Uh so yeah,
  181. 11:18we log into uh Archer 2 and uh
  182. 11:22if uh
  183. 11:25not in but in other supercomputers you
  184. 11:28may need to do a module load singularity
  185. 11:32but in our on Archer 2 is already loaded
  186. 11:35by by default. Singularity is already
  187. 11:39available by default. So to check if a
  188. 11:41singularity is installed
  189. 11:44you can uh do singularity minus minus
  190. 11:48version
  191. 11:50and see the the version of that we are
  192. 11:53using that is uh 373
  193. 11:561.
  194. 12:02Okay. So uh oops this is what uh we have
  195. 12:06uh
  196. 12:08now uh well here in the documentation
  197. 12:12there is like a reminder about
  198. 12:14singularity image and sorry singularity
  199. 12:18and the difference between image a
  200. 12:19container uh I think must be worth
  201. 12:23repeating it again the image is the
  202. 12:28u
  203. 12:30how to say the is kind of the template
  204. 12:33that you use every time that you run a
  205. 12:36or you create a container is like the
  206. 12:38base that you use the that image and
  207. 12:42when you run the image you get a
  208. 12:45container.
  209. 12:47So let's say the image will be kind of a
  210. 12:50let's say a template or the the the
  211. 12:54starting point and uh
  212. 12:58yeah when you run the image you will get
  213. 13:00a a container.
  214. 13:02Uh we can see that with an example.
  215. 13:07Uh one
  216. 13:09what we will do is we will uh uh use uh
  217. 13:14we will uh download uh
  218. 13:18uh
  219. 13:20image that is called well yeah the name
  220. 13:23is a bit lo cow
  221. 13:27to download that image is a singularity
  222. 13:32pool uh the name of image that will be
  223. 13:36code si s i
  224. 13:41and then the address will be library
  225. 13:45uh
  226. 13:47column sl
  227. 13:54one thing that I haven't done
  228. 13:57a moment
  229. 14:10I haven't run this command before.
  230. 14:16Well, if I will run that.
  231. 14:23Oh, well, okay. Actually,
  232. 14:25lo.
  233. 14:27Yeah, fine. Okay. So, yeah. Uh,
  234. 14:33so we get that the image. Okay. Since
  235. 14:36that is the biggest 90 mgabytes. So, if
  236. 14:39we do S, we have there the image. If we
  237. 14:42do L minus L H,
  238. 14:45we will get that. Yeah. 91 megabytes.
  239. 14:51So this is to download the the image and
  240. 14:56to uh to run it. Uh that are like that
  241. 15:00are let me see if I
  242. 15:10uh to run it there are like three ways.
  243. 15:13We will start with the first uh one that
  244. 15:17will be singularity run. So if we type a
  245. 15:20singularity
  246. 15:22run uh l cow sif
  247. 15:29you will get
  248. 15:32uh
  249. 15:34yeah it's a cow. Yeah, sometimes when I
  250. 15:36look it looks like a donkey but what
  251. 15:40cow that that tells you the
  252. 15:43yeah the time that I we are now
  253. 15:48um yeah tell you that with the funny
  254. 15:53colors.
  255. 15:56So so again uh what what happens when we
  256. 16:00do that uh we run the
  257. 16:05we start the the container, we run it
  258. 16:09and we close it. So this is like the the
  259. 16:13workflow that we learned uh on Monday
  260. 16:16that this is what happens when we uh
  261. 16:21when we uh run a
  262. 16:25a container.
  263. 16:29Okay. What was uh next? Uh when we run
  264. 16:34the
  265. 16:35the container by default use the
  266. 16:41use the the command that is like
  267. 16:44if you remember from Monday we have a
  268. 16:47cmd
  269. 16:49that this is the command that you run by
  270. 16:51default. And for these images you can
  271. 16:54check that with singularity. You can do
  272. 16:57singularity inspect
  273. 17:00inspect
  274. 17:02uh r uh l cow.
  275. 17:08And you see that the script that uh runs
  276. 17:11is a date
  277. 17:14cow say
  278. 17:16this.
  279. 17:19If we run that on our uh
  280. 17:25but if we we run that
  281. 17:35you see that these commands are not on
  282. 17:38archer 2. Why? Because these commands
  283. 17:40are on the container and this is what is
  284. 17:43run internally every time that I
  285. 17:46uh run this uh image. Any
  286. 17:54questions uh so far
  287. 17:59or uh clear?
  288. 18:10If so, we can keep uh going.
  289. 18:19Okay.
  290. 18:25So uh we we we have learned like a one
  291. 18:29way to uh
  292. 18:35uh one way to uh
  293. 18:40uh to run the uh container that this is
  294. 18:43only well using run with the run you uh
  295. 18:46run the default operation of the
  296. 18:48container and that's it. There is
  297. 18:51another way uh that is uh
  298. 18:57uh
  299. 19:00use uh exact. So uh you uh rather than
  300. 19:03running the default command rather than
  301. 19:05running this uh you can say
  302. 19:09uh
  303. 19:12you can specify what the container will
  304. 19:15do. So if I do singularity
  305. 19:21a moment but I yeah singularity act like
  306. 19:30you can do uh slashb echo.
  307. 19:45So here rather than using run we use
  308. 19:47exec. So I need to specify the name of
  309. 19:51the container and this is the operation
  310. 19:54that I'm uh running.
  311. 19:57Also here you can see
  312. 20:00for instance uh you can run this
  313. 20:02partially and see what uh uh caus.
  314. 20:10So uh
  315. 20:14for instance uh if I do
  316. 20:18day
  317. 20:25oops
  318. 20:32since That's it.
  319. 20:44Okay, that's interesting. I wanted to uh
  320. 20:49execute that, but it seems that is not
  321. 20:51uh
  322. 20:56okay. I
  323. 20:58I don't know what is uh
  324. 21:02probably you need to
  325. 21:05let's see if that works.
  326. 21:18Okay, maybe we can do this the with the
  327. 21:21third option.
  328. 21:23uh third option will be
  329. 21:27singularity shell uh l cow. So in that
  330. 21:31case you see that the prompt change and
  331. 21:35rather than having the outer to prompt
  332. 21:37let's say we have the singularity
  333. 21:40prompt.
  334. 21:42So here if we type a data
  335. 21:46uh code say
  336. 21:50we see yeah okay here it uh it works not
  337. 21:53sure why it's not working when I do x
  338. 22:00uh
  339. 22:02yeah I print the code saying that
  340. 22:05actually I can do a
  341. 22:08let's see if that works
  342. 22:19Yeah. So uh what to uh so calc what uh
  343. 22:22you give is the yeah the message that uh
  344. 22:28and I think low cut gives uh yeah the
  345. 22:33colors of the
  346. 22:37uh
  347. 22:39you can see which shape
  348. 22:45I'll find the word.
  349. 22:48Yeah, maybe we need to use like the full
  350. 22:51product. What is
  351. 22:55So, this is the
  352. 22:57Let's see the three ways that we can uh
  353. 23:01uh use
  354. 23:04when we um
  355. 23:08when we uh use um
  356. 23:13when we use a a image on on our two Any
  357. 23:25any questions so far?
  358. 23:51If not, yeah, we can continue.
  359. 24:04Oh, yeah.
  360. 24:09uh
  361. 24:13so uh this is the this is the image this
  362. 24:17is the let's see the container here uh
  363. 24:21for uh
  364. 24:25entry to the first day was pman we have
  365. 24:29a
  366. 24:32yeah this file is the the image The
  367. 24:35container image
  368. 24:38that is for singularity the is sif
  369. 24:44is the extension.
  370. 24:48So yeah, it's like the Yeah, singularity
  371. 24:51file maybe is the right.
  372. 24:56Let me check it.
  373. 25:06A singularity image format is the
  374. 25:14so uh to uh
  375. 25:17yeah to uh yeah there's a question in
  376. 25:19the chat to visualize the container uh
  377. 25:22we can do that with the we have three
  378. 25:25ways uh just to recap three ways to run
  379. 25:28the container uh we can do a sing
  380. 25:32singularity
  381. 25:35run
  382. 25:37um the name of the container that is
  383. 25:40this one. So if we do that
  384. 25:44we run the container and we print this
  385. 25:47uh value.
  386. 25:49What is the other way? Rather than using
  387. 25:52run we will use as that uh that means
  388. 25:56that uh rather than using the standard
  389. 26:00uh command that is in
  390. 26:04if
  391. 26:05the standard command is uh rather than
  392. 26:09running this
  393. 26:11we will run something else. So we do
  394. 26:13singularity except
  395. 26:17uh we can print uh
  396. 26:44Not sure what's happening here.
  397. 26:51This is not the output that master.
  398. 27:06Okay, let's just start taking I think
  399. 27:07something.
  400. 27:09So singularity run
  401. 27:12cow.
  402. 27:14So we got this. If I we do singularity
  403. 27:17exact
  404. 27:20uh cow and say
  405. 27:24in echo
  406. 28:11Okay. It seems that for some reason this
  407. 28:13is like not working the
  408. 28:16uh okay the yeah for uh for the
  409. 28:19container we have an ls but here the
  410. 28:23container will be save as a file in
  411. 28:25order that okay that that's a good
  412. 28:27question the way of working is that if
  413. 28:30we do ls we will have the the image here
  414. 28:34so when we download it on on podman or
  415. 28:37docker will be uh save somewhere
  416. 28:41So we'll be like in a internal
  417. 28:44directory.
  418. 28:46So we don't have a an ls on uh
  419. 28:50on for singularity singularity what it
  420. 28:52change that yeah the image will be in
  421. 28:54your folder
  422. 28:56for instance we will yeah just with ls
  423. 29:01we have this one and
  424. 29:04yeah that's it there.
  425. 29:08Yeah, for some reason when I use like
  426. 29:10this uh exclamation
  427. 29:13is not running it's running a bit funny
  428. 29:16but I think maybe
  429. 29:24Oh yeah okay if I use single quotation
  430. 29:26marks
  431. 29:28yeah it will work.
  432. 29:32Okay, so this is the second and the
  433. 29:34third way is like using singularity cell
  434. 29:37and the name of the image
  435. 29:40and then I will have a prompt and here I
  436. 29:43can check
  437. 29:45ls and dwd
  438. 29:49etc.
  439. 29:53Well later we will see yeah now well we
  440. 29:56see that the
  441. 29:58the difference here if you remember with
  442. 30:01the podman or docker when we do ls we
  443. 30:04were in the root
  444. 30:06in the root directory here I'm in a home
  445. 30:11directory
  446. 30:15because this is a this is something that
  447. 30:18is
  448. 30:22um
  449. 30:25Yeah, that by default uh singularity uh
  450. 30:29mount home directory we will learn that
  451. 30:34later
  452. 30:36later I'll see what later we will see
  453. 30:39the differences
  454. 30:42any questions
  455. 30:45so far
  456. 30:51if not The next step is we will uh
  457. 30:57we download this uh image but uh we will
  458. 31:00see how we can use docker to download an
  459. 31:04image.
  460. 31:07So uh you may remember that for uh
  461. 31:14for doc uh for singularity to get an
  462. 31:17image we use a singularity pool
  463. 31:22and specify the name of the image that
  464. 31:25well now we will uh use python so
  465. 31:31let's use this one for instance and I
  466. 31:34need to specify the address that will be
  467. 31:36docker per column SL
  468. 31:41Python and the tag that will be 3.14
  469. 31:473
  470. 31:50I will get like a reduced version of it
  471. 31:59interesting yeah command of found
  472. 32:00because I you see that yeah I'm inside
  473. 32:03the
  474. 32:04still inside the container so I will
  475. 32:06need to exit
  476. 32:09and be repeat the same. I will copy and
  477. 32:11paste.
  478. 32:24Now here you will see that uh you will
  479. 32:27get something because I'm uh using cash
  480. 32:31saf image. This is because uh yesterday
  481. 32:35was playing with that and this uh image
  482. 32:37is already on the cache. Uh
  483. 32:42if we want to we can do singularity
  484. 32:47cache clean
  485. 32:58and this will delete all the cash. So
  486. 33:00now if we pull the image
  487. 33:05in our
  488. 33:13you will get all of this input well
  489. 33:16output of
  490. 33:21so it's downloading the image and
  491. 33:23converting that to a singularity image
  492. 33:26file. So if we do a l now I have a two
  493. 33:30images. I don't need to uh uh we don't
  494. 33:33need to run the command uh uh pman or
  495. 33:38docker container ls or image ls. Uh well
  496. 33:43that will be image ls. Uh the cont the
  497. 33:46images will be on our folder.
  498. 33:52Now let's see if what happens if I do
  499. 33:54singularity
  500. 33:57run
  501. 33:59um this image
  502. 34:03I will get uh automatically I will get
  503. 34:06uh
  504. 34:08uh the prompt will change and will be a
  505. 34:10Python. So I can run
  506. 34:21this Python command.
  507. 34:24Oh, I don't know if it was.
  508. 34:35Yeah, I can do some operations with the
  509. 34:42I'm not sure if this this I don't think
  510. 34:46that this will work, but
  511. 34:49yeah, the version is not defined. So, uh
  512. 34:53yeah. So this is like I got a
  513. 34:56Python. So this is useful for instance
  514. 34:59if uh because on archer 2 there are uh
  515. 35:02several versions of python.
  516. 35:06I don't know if there is a
  517. 35:10well for instance we don't have python I
  518. 35:12think we need to do module
  519. 35:15load create python.
  520. 35:21So if we will do that
  521. 35:25we get on archer 2 is install Python
  522. 35:28here using this module and we get Python
  523. 35:32the version 3.10.
  524. 35:34So uh if we want to use another version
  525. 35:37of Python, we can either download
  526. 35:40the and install in our Python with the
  527. 35:46mini cond
  528. 35:48or we can use a a container.
  529. 35:54Okay. Yeah. Sorry I I haven't explained
  530. 35:56that on uh Archer 2. when you log to
  531. 35:59archer 2 uh there is some there are some
  532. 36:04software that is already available that
  533. 36:07uh if you do modular
  534. 36:11a
  535. 36:13you will see the software that is
  536. 36:14available
  537. 36:17so to you have
  538. 36:20uh all of these uh modules
  539. 36:25so uh well these
  540. 36:29Let me check.
  541. 36:32Yeah, this is like related to Python.
  542. 36:35These are libraries and this is
  543. 36:38software.
  544. 36:40We have caster co c2k grow max quantum
  545. 36:44tracer. This is already installed on
  546. 36:46archer 2 but it's not uh
  547. 36:50loaded.
  548. 36:52So if we want to use any of this
  549. 36:55software, we will need it to load that
  550. 36:58to the well we have like a more so this
  551. 37:01is like the full list of software that
  552. 37:03we have.
  553. 37:06Uh if I do module uh list
  554. 37:10this is the modules let's see the
  555. 37:13software that is already that are
  556. 37:15already load by default you will have
  557. 37:1814. So you will have this ones already
  558. 37:22loaded. I work this towards that. What I
  559. 37:25did was to load this uh module here. If
  560. 37:30I don't want to use it anymore, I can do
  561. 37:33module rm and create python.
  562. 37:39So now if I do module list, you see that
  563. 37:43this module is no longer here. So
  564. 37:46modules are like a way for when we use
  565. 37:51a a remote system to load the software
  566. 37:54that we want to use or not. That's why
  567. 37:57at the beginning I said that we can do
  568. 38:00module in some uh
  569. 38:04remote systems we can do module load uh
  570. 38:07singularity because uh by default is not
  571. 38:10loaded.
  572. 38:12Actually I don't know if that will work.
  573. 38:17Oh well, if I type something that is not
  574. 38:19uh doesn't exist. Yeah, we will
  575. 38:23complain. There is not a module called
  576. 38:26singularity because singularity is
  577. 38:28already. So yeah, this is the so yeah I
  578. 38:31sorry I haven't introduced let's see the
  579. 38:33module terminology.
  580. 38:51Okay. Any questions uh
  581. 38:58so far?
  582. 39:10If not uh well I already have a clean
  583. 39:14that but uh is uh
  584. 39:24yeah let's see about like the cache that
  585. 39:28uh when if I uh we have here two
  586. 39:32containers uh this l cow and python If I
  587. 39:35delete the Python container with the RM,
  588. 39:39also be careful with when you use that
  589. 39:41on a terminal on an arro too because RM
  590. 39:46will delete and will not be a
  591. 39:50recycle bin or will not be like a way of
  592. 39:53to recover the file that this is deleted
  593. 39:56is gone.
  594. 39:58So if you do python
  595. 40:01rm python actually also when you use rm
  596. 40:06if you want to be sure it's not
  597. 40:08recommended to use it on a script but if
  598. 40:11uh you want to include it you can uh to
  599. 40:16be sure use the option minus i. That
  600. 40:19option will ask you uh do you really
  601. 40:22want to remove regular file and
  602. 40:26depending of the answer if you answer no
  603. 40:29it's fine
  604. 40:31you will still have the file
  605. 40:33but if you answer yes or why you will
  606. 40:37delete the file
  607. 40:40now if I do
  608. 40:43oops uh
  609. 40:47so what commands that might be use for
  610. 40:50you to clear will clean the terminal and
  611. 40:54also if what I use a lot is a control R
  612. 40:58that this is a reverse search. So if you
  613. 41:01type now pool
  614. 41:04will show you the last uh entry of uh on
  615. 41:09on archer 2 that that has a pool in the
  616. 41:14because I want to do singularity pool
  617. 41:16python. I just press enter and I don't
  618. 41:21I don't need to uh type the whole
  619. 41:24command. We'll use uh uh the latest
  620. 41:29command that uh pull is in uh on the
  621. 41:33command line
  622. 41:36and here I have get info using using
  623. 41:39cash uh as I have image.
  624. 41:44Uh
  625. 41:48this is because uh the this is is on the
  626. 41:52cash. If we do singularity cash
  627. 41:56list
  628. 41:59minus B,
  629. 42:01you see that they get um
  630. 42:12uh
  631. 42:15I got a container file and I use a 40
  632. 42:19mgaby and six OC blob files. These are
  633. 42:22the docker files that these first we
  634. 42:25download this uh these are the layers
  635. 42:28that we saw like the first day we
  636. 42:30download them and then we created the
  637. 42:32container.
  638. 42:35So you see that the layers will work
  639. 42:37well. They said that this 40 megabytes
  640. 42:40and the containers itself is 40 megaby
  641. 42:44as well. While total space use is uh 81
  642. 42:50megaby or well will be close to 82
  643. 42:53megabytes.
  644. 42:57I think we have also this option that we
  645. 43:00can check
  646. 43:03similar to docker or uh podman. If we
  647. 43:08type a minus minus help
  648. 43:11uh gives you like a list your local
  649. 43:13singularity cash
  650. 43:17and get minus v the verbos
  651. 43:24list of cash. Well, you can specify here
  652. 43:27the
  653. 43:30the types that by default is all.
  654. 43:35Oh, yeah. These are the options that we
  655. 43:37can use.
  656. 43:50Also that by default, let me check if
  657. 43:53this is a
  658. 43:58because I think it's not uh
  659. 44:05yes notify
  660. 44:07uh by default all of this uh cash is
  661. 44:11saved in uh
  662. 44:13uh home that if you want to see home is
  663. 44:18this my directory my personal directory
  664. 44:20here so it says save in uh
  665. 44:25home/
  666. 44:28singularity
  667. 44:33cache.
  668. 44:35So if I do ls
  669. 44:38you will see that I have here several
  670. 44:40directories and if I go to uh
  671. 44:45C
  672. 44:47this will
  673. 44:49tmp
  674. 44:51here you see that I have what like uh
  675. 44:54this will be the image that I have or I
  676. 44:57can think it was low
  677. 45:01yeah have Uh
  678. 45:06yeah,
  679. 45:07this is the the cache that uh
  680. 45:13yeah, here we have the the layers that
  681. 45:16uh I was talking before.
  682. 45:20So if we set this uh singularity cast to
  683. 45:25uh we can change the location.
  684. 45:30Uh the cars will be saved uh somewhere
  685. 45:34else and the way to clean the cash is
  686. 45:37what is
  687. 45:39playing the documentation is
  688. 45:41singularity.
  689. 45:42Actually we can check with this command
  690. 45:46d minus sh
  691. 45:48/
  692. 45:50do singularity
  693. 45:54uh cach
  694. 45:59you see that directory is 73 mgabytes.
  695. 46:02If we do singularity cash
  696. 46:07clean
  697. 46:11uh want to continue
  698. 46:16so yeah has been removed this this this
  699. 46:20we don't need to remove anything library
  700. 46:24we remove this entry and nothing to
  701. 46:26refine so now if I repeat again using
  702. 46:31the
  703. 46:32up arrow I can check previous commands.
  704. 46:36So if I repeat that
  705. 46:39you see that now the size rather than 83
  706. 46:42mgabytes is a 32 kilob.
  707. 46:53Any
  708. 46:56questions or
  709. 47:01with that
  710. 47:37Okay. So, if not, we'll uh
  711. 47:41continue. I guess we can Yeah, maybe
  712. 47:45we can start uh
  713. 47:48yeah, we can have a maybe a small break
  714. 47:51uh at 11. But yeah, I can start the next
  715. 47:57lesson.
  716. 48:04Yeah, let's do that. Uh
  717. 48:08so we have seen okay we do a and we see
  718. 48:11that we have these two containers. We
  719. 48:14will work u
  720. 48:16actually yeah we can work with this
  721. 48:18container with the Python one just to
  722. 48:21for a change u we can do singularity
  723. 48:27shell
  724. 48:28and python
  725. 48:32and now I'm in the
  726. 48:35in the container using this uh python
  727. 48:37image
  728. 48:39uh before we have a grow of who am Hi.
  729. 48:44And I'm uh you will get your username.
  730. 48:47My username in this case is J.R. Rodri.
  731. 48:52And you may get TA
  732. 48:55on your yeah some character characters
  733. 48:59from your name.
  734. 49:02You also might uh have uh if you do uh
  735. 49:08pwd
  736. 49:10that I'm in this uh directory
  737. 49:14I'm not in the in the
  738. 49:18on root but what I can change to root
  739. 49:22and dos
  740. 49:23actually I think
  741. 49:26s minus l to show the
  742. 49:34This is one thing that is done in the
  743. 49:39uh so uh singularity
  744. 49:42is used on HPC systems rather than
  745. 49:45docker or podman uh because of this uh
  746. 49:48that is like a more adapted to remote
  747. 49:50systems. I when I uh by default rather
  748. 49:54than using the root username use my
  749. 49:58username
  750. 50:00also by default mounts the
  751. 50:06for instance these folders being are
  752. 50:08mount to this uh u us
  753. 50:15this is mount to the the folders that
  754. 50:18are in the in the host most uh OS if I
  755. 50:23move to home
  756. 50:28and it will
  757. 50:38it's not showing the that on the
  758. 50:45and also mount the uh there are some
  759. 50:49directories that are mount
  760. 50:51mounts the
  761. 50:55takes my username because mount the
  762. 50:57slftc
  763. 50:59password is the like the file where all
  764. 51:02the
  765. 51:03users on the machine are.
  766. 51:07So if I do I will do well exit and
  767. 51:10actually will share my
  768. 51:13the yeah
  769. 51:18the documentation.
  770. 51:22No I don't want to mute or to stop
  771. 51:24sharing.
  772. 51:35I will make this small.
  773. 51:43So we have a singularity container here
  774. 51:45that is on our uh uh on the right of the
  775. 51:49screen and the host that is on the left
  776. 51:51of the screen. So uh home
  777. 51:57by default is uh available my home
  778. 52:00directory is available on the container.
  779. 52:03We don't need to mount if you remember
  780. 52:05that with the docker of podman we need
  781. 52:08to mount our directory but here is a
  782. 52:11mount by default
  783. 52:13and the
  784. 52:15use my right username. So if I create a
  785. 52:19file with a container on my home
  786. 52:21directory, it will create it with the
  787. 52:24right user with the right permissions
  788. 52:27and uh
  789. 52:30will be like will be I mean easier will
  790. 52:33save us to mount on mount
  791. 52:37uh directories.
  792. 52:42Not sure if that uh
  793. 52:44makes sense. What we will do now is we
  794. 52:48have a this uh exercise. I will copy
  795. 52:51that in the chat in case that uh you
  796. 52:53want to have a look.
  797. 52:59So uh
  798. 53:02what we will do is we will uh well you
  799. 53:05can have a look at the exercise and I I
  800. 53:07will give now a uh 15 minute break. So
  801. 53:12we'll be back at uh uh quarter past 11
  802. 53:18and we will keep uh working with
  803. 53:23with this and also we will learn learn
  804. 53:26the other
  805. 53:28uses that we can do with the with the
  806. 53:30containers as I said in the afternoon
  807. 53:33will be all exercises like we will use
  808. 53:37also the
  809. 53:39the submission Q that we want to submit
  810. 53:42jobs to uh to the queue to archer 2 to
  811. 53:46run them on yeah the compute nodes
  812. 53:50and uh yeah that's it also I'll be
  813. 53:53around if you have any questions but
  814. 53:55yeah now will be
  815. 53:57uh break time I will
  816. 54:00okay hope you had a nice uh break you
  817. 54:03have any questions please uh feel free
  818. 54:05to post them in the chat if not I will
  819. 54:08uh continue with the
  820. 54:15with the le
  821. 54:29I okay
  822. 54:45So if I
  823. 54:49if I open a
  824. 54:52a if I create a container with the
  825. 54:55singularity share,
  826. 54:59you see again that my prompt change if
  827. 55:02you do LS minus no ls sound
  828. 55:07or ls minus l h
  829. 55:12you will see that uh
  830. 55:15files will get the right so the files in
  831. 55:18the on the
  832. 55:20slash will have a will be root
  833. 55:25and for instance home will be my
  834. 55:27username and the group that that I
  835. 55:33So if I want to like create a file uh
  836. 55:37you can create with the touch slash uh
  837. 55:41princess my file txt
  838. 55:46it will fail because this is a read only
  839. 55:50file system I don't have a permissions
  840. 55:52to create that file on the
  841. 55:57but if I want to create the file on uh
  842. 56:00if I So if I do CD,
  843. 56:04I'll be at home. So I can go to CD
  844. 56:07containers
  845. 56:09and I can here I can create a file.
  846. 56:13Um
  847. 56:19and I have my file there. And if I exit
  848. 56:23and I do ls, my file will be there. And
  849. 56:27if I do ls minus l you see that the
  850. 56:31permissions are okay. I have uh the file
  851. 56:35belongs to my username and the file
  852. 56:37belongs to my group that is uh J Rodri
  853. 56:42set 19.
  854. 56:47Is this uh
  855. 56:51clear?
  856. 56:58So as I said by default I have like the
  857. 57:01home uh directory mount but what if I
  858. 57:04want to mount another directory for
  859. 57:07instance I said that we have a uh home
  860. 57:11that this is like a /home
  861. 57:15twice the group and then my username.
  862. 57:19Uh
  863. 57:20for instance, we can try to mount work.
  864. 57:23W work work will be SL work 719
  865. 57:28718 and my username.
  866. 57:35So I can try to do that. So to do that
  867. 57:38will be uh singularity
  868. 57:42cell and uh you can specify minus uh
  869. 57:47capital B and the
  870. 57:52the directory that you want to mount. So
  871. 57:55will be /work 79
  872. 57:5979
  873. 58:01and my username
  874. 58:04in your case. I don't need to in your
  875. 58:07case will be like a /work t I think it's
  876. 58:11a 236
  877. 58:14twice and then your username
  878. 58:17and now I can yeah I can specify the
  879. 58:22name of the image.
  880. 58:25So if I do that and I do ls
  881. 58:29minus lh
  882. 58:37you see that I have here
  883. 58:39uh the work directory so I can do uh cd
  884. 58:43/ work
  885. 58:48and I will have my directory uh here
  886. 58:53if I do s I get this directories I I can
  887. 58:58I can use it
  888. 59:00on my on my container to build the
  889. 59:03software to run something
  890. 59:06uh
  891. 59:11if I do exit
  892. 59:14if I don't specify anything else this
  893. 59:17will mount the same uh but uh if I want
  894. 59:20to change for instance I will I want to
  895. 59:23mount it and uh
  896. 59:26just uh like using a slash work rather
  897. 59:28than using the whole uh thing I will use
  898. 59:32a semicolon
  899. 59:33and the name of the the name of the
  900. 59:36directory in the in the image.
  901. 59:40So if I do this and I do cd / work
  902. 59:46ds
  903. 59:48I get uh
  904. 59:51this directory
  905. 59:56map here in the in the on the container
  906. 1:00:01I can do the same I can add other
  907. 1:00:05directories as well. For instance, if I
  908. 1:00:08we will see later in the with the with
  909. 1:00:10the exercise that if you want to use the
  910. 1:00:14Cray compiler. So the CR uh you can
  911. 1:00:18mount for instance uh
  912. 1:00:24if you add a comma you can mount another
  913. 1:00:27directory. So you can mount for instance
  914. 1:00:31/ts/cra.
  915. 1:00:35So if you do that, you can go
  916. 1:00:38and you have here
  917. 1:00:43the directory that is on on archer 2 on
  918. 1:00:47your container.
  919. 1:00:52Any questions so far?
  920. 1:00:56Let me see if I'm forgetting something.
  921. 1:01:18If not, okay, let me check the
  922. 1:01:29Okay, let's have a look at this.
  923. 1:01:39These are other topics that I would like
  924. 1:01:41to uh share with you uh and are in
  925. 1:01:46uh so for instance with the I'm not sure
  926. 1:01:49if you are familiar with the environment
  927. 1:01:52variables that when we use on
  928. 1:01:56uh if we do export here on uh on the on
  929. 1:02:03archer 2
  930. 1:02:07we got a lot of variables here one
  931. 1:02:10variable for instance is uh home
  932. 1:02:16if I'm scrolling
  933. 1:02:18so this variable
  934. 1:02:23here oh I get uh also the this variable
  935. 1:02:27for instance host host name host type.
  936. 1:02:31So by default these variables are copied
  937. 1:02:36on the on singularity.
  938. 1:02:39Another way is to use M but with M.
  939. 1:02:44Yeah, you get also all of these
  940. 1:02:46variables.
  941. 1:02:48Actually let me check.
  942. 1:02:51So if I do singularity
  943. 1:02:55uh will be
  944. 1:02:58if you're wrong in set x
  945. 1:03:01uh python
  946. 1:03:03I don't know if export will work
  947. 1:03:07no m
  948. 1:03:13you see that all of these sorry if it is
  949. 1:03:16like a quite a long list all of the
  950. 1:03:18variables that are on archer two are
  951. 1:03:22copied to the to the to the
  952. 1:03:25will be using the container.
  953. 1:03:29But there is a way in if for some reason
  954. 1:03:32we don't want that to that to be
  955. 1:03:36that to be copied on the
  956. 1:03:40on the container I can do singularity x
  957. 1:03:45uh clean
  958. 1:03:49environment
  959. 1:03:50on this uh so if I do that
  960. 1:03:54if I add this you see that now the
  961. 1:03:57output is uh smaller because these
  962. 1:04:03these are the the environment variables
  963. 1:04:05for the machine are not the environment
  964. 1:04:07variables on on archer too.
  965. 1:04:10Uh I see that there's a question on the
  966. 1:04:12chat.
  967. 1:04:19That's Yeah. Okay. That's an interest.
  968. 1:04:22So the the option that uh we we have
  969. 1:04:25used minus B before
  970. 1:04:28this will be for bind console from a
  971. 1:04:31bind.
  972. 1:04:34So this is used when we want to bind a
  973. 1:04:37directory of the uh the machine or the
  974. 1:04:42host machine or archer 2 to the to the
  975. 1:04:46container. Minus v comes from uh verb
  976. 1:04:49boost that this is normally to uh print
  977. 1:04:53more
  978. 1:04:56uh
  979. 1:04:58to like a yeah print more output. So
  980. 1:05:01this is normally when you are debugging
  981. 1:05:03and you are doing something to see what
  982. 1:05:06is uh what's what is uh going on
  983. 1:05:11is that uh does it solve uh
  984. 1:05:17your question?
  985. 1:05:22Yeah, you said maybe I Yeah, maybe there
  986. 1:05:25there is software that use normal. Yeah,
  987. 1:05:28minus comes from verbose. But yeah, it
  988. 1:05:31could be the case that maybe but by
  989. 1:05:34default is yeah minus uh is like
  990. 1:05:40yeah that are like some uh it's like a
  991. 1:05:43minus h normally say use for help minus
  992. 1:05:47i is for input minus o for output. There
  993. 1:05:51are like some flags that uh are kind of
  994. 1:05:54I would not say standard but are used
  995. 1:05:59normally for uh
  996. 1:06:03uh for uh yeah for certain uh
  997. 1:06:07operations.
  998. 1:06:21So actually yeah that
  999. 1:06:28I mean essentially I mean maybe it's not
  1000. 1:06:30but what we for this course are is the
  1001. 1:06:35same is like a minus bind is like a is
  1002. 1:06:39the mount there are like a several types
  1003. 1:06:43but the one that we see here is the bind
  1004. 1:06:46So will be
  1005. 1:06:49I mean the
  1006. 1:06:52will be the same is there is no I would
  1007. 1:06:54say I use like a mount or bind like the
  1008. 1:06:58I use two different words but the
  1009. 1:07:01essentially are are the same
  1010. 1:07:05but what we use I think there are other
  1011. 1:07:08ways to
  1012. 1:07:11mount. Yeah, exactly. There are uh but
  1013. 1:07:14the types that we see in this lesson are
  1014. 1:07:17the actually the types that I normally
  1015. 1:07:19use is a bind is the but essentially is
  1016. 1:07:24the kind of the same the thing with
  1017. 1:07:26mount is
  1018. 1:07:29mount if you use u but it's not for
  1019. 1:07:32containers for operating system you can
  1020. 1:07:35mount
  1021. 1:07:37a disk or mount
  1022. 1:07:40another file system but this Not let's
  1023. 1:07:43see the purpose of so let's see what for
  1024. 1:07:47what we are learning is the I would say
  1025. 1:07:50is the same we do mount and the type
  1026. 1:07:54that we use is let's see the bind
  1027. 1:07:58but yeah essentially
  1028. 1:08:01and yeah on singularity is minus uh if
  1029. 1:08:06we do singularity
  1030. 1:08:10uh
  1031. 1:08:15I guess we here we have a
  1032. 1:08:19yeah this is the full documentation of
  1033. 1:08:22oh I forgot to mention that we can also
  1034. 1:08:25mount uh the when we mount yeah or bind
  1035. 1:08:31that uh we can specify if is a ro read
  1036. 1:08:36only or rw that this is a with the right
  1037. 1:08:43here. I was using clean environment but
  1038. 1:08:45there is a shorter option that is minus
  1039. 1:08:48uh e
  1040. 1:08:51actually yeah you can use minus capital
  1041. 1:08:53b or minus minus by in case that you
  1042. 1:08:55want to uh
  1043. 1:08:58uh make it uh
  1044. 1:09:01say longer or
  1045. 1:09:09also here we have a if you remember that
  1046. 1:09:12we were using docker library. We were
  1047. 1:09:14using Docker because this is a normally
  1048. 1:09:17the the image if the image is host on
  1049. 1:09:21Docker Hub, we will use Docker but if
  1050. 1:09:25the images because also we have this uh
  1051. 1:09:28repository
  1052. 1:09:30from uh Silab that is the company that
  1053. 1:09:33now runs Singularity. We can use a
  1054. 1:09:38library
  1055. 1:09:41or also we can use the directory. We
  1056. 1:09:43will see now what is a sandbox
  1057. 1:09:47and the singularity hub. Yeah, there are
  1058. 1:09:50like a different uh it's always good to
  1059. 1:09:53have a look at the documentation and see
  1060. 1:09:54the different options because sometimes
  1061. 1:09:56we can find the options that we can uh
  1062. 1:10:00uh use.
  1063. 1:10:09Uh
  1064. 1:10:15okay. So I first bring uh the
  1065. 1:10:27taking
  1066. 1:10:35we don't have here the option
  1067. 1:10:41before I was explaining about the the
  1068. 1:10:42the environment
  1069. 1:10:45cleaning environment before running
  1070. 1:10:47container and also we have this option
  1071. 1:10:49as environment variable to container
  1072. 1:10:52processor.
  1073. 1:10:53We can either use this
  1074. 1:10:56minus I minus m and define the
  1075. 1:10:59environment
  1076. 1:11:01uh variable here
  1077. 1:11:06or we can create a file with the
  1078. 1:11:09environment variables and pass the the
  1079. 1:11:12file.
  1080. 1:11:18Uh how we can do that? Uh so for
  1081. 1:11:20instance if I do a
  1082. 1:11:25singularity
  1083. 1:11:27cell
  1084. 1:11:30Python
  1085. 1:11:35and I echo
  1086. 1:11:42for instance my name
  1087. 1:11:45it will be empty.
  1088. 1:11:51But they can do singularity
  1089. 1:11:53cell - m
  1090. 1:12:05for instance
  1091. 1:12:08and if I do echo
  1092. 1:12:10my name
  1093. 1:12:13will print my my name. So this is a way
  1094. 1:12:16in case that for some reason I want to
  1095. 1:12:20uh set up an environment variable and
  1096. 1:12:22send it to the container I can do this
  1097. 1:12:24in that way
  1098. 1:12:27also I can use a file. So a file uh
  1099. 1:12:34I will copy this. A file could be
  1100. 1:12:38uh you can use uh well to create a file
  1101. 1:12:42on archer to you can use either vi or
  1102. 1:12:44nano probably.
  1103. 1:12:51Well nano in theory is easier.
  1104. 1:12:54my bars.
  1105. 1:12:58Let's see.
  1106. 1:13:01So here I can copy
  1107. 1:13:03the variables that I want to uh
  1108. 1:13:07I can say my surname for instance.
  1109. 1:13:12Yeah, this a bit silly example but it's
  1110. 1:13:14to just to
  1111. 1:13:16show you. So to save this, Ctrl O
  1112. 1:13:20and enter and then Ctrl X. So now you
  1113. 1:13:24can do a singularity
  1114. 1:13:26cell
  1115. 1:13:30I think was MV file.
  1116. 1:13:33I go into the documentation. Yeah. M5
  1117. 1:13:50bars txt
  1118. 1:13:55uh and the
  1119. 1:13:59and here I can do a call
  1120. 1:14:03measure name
  1121. 1:14:06and my name.
  1122. 1:14:08So I have this uh list of environment
  1123. 1:14:11variables.
  1124. 1:14:14Maybe is the case that you will never
  1125. 1:14:16use it or is not needed but well you
  1126. 1:14:19know that this exist.
  1127. 1:14:23There are different ways to also to send
  1128. 1:14:26the variables but what this like we say
  1129. 1:14:27the one that
  1130. 1:14:30we can think also you can use uh
  1131. 1:14:34um
  1132. 1:14:40yeah but I would say this is like the
  1133. 1:14:42more the most simple way to
  1134. 1:14:45to do that.
  1135. 1:14:51Okay. So this is about environment
  1136. 1:14:55variables. I'm not sure if you were
  1137. 1:14:57familiar with them or not.
  1138. 1:15:01Uh
  1139. 1:15:04another thing that will be useful to
  1140. 1:15:08Okay, you see that here in my directory
  1141. 1:15:10I have a two uh
  1142. 1:15:15I have two uh
  1143. 1:15:17images and what two files but I can
  1144. 1:15:21let's say this is like this Python file
  1145. 1:15:24is built on a
  1146. 1:15:31it's uh built uh on a rece. So I can
  1147. 1:15:35create uh what is called as a sandbox
  1148. 1:15:39and uh you will see all of the files
  1149. 1:15:41that are on the
  1150. 1:15:44there. This is in case that for some
  1151. 1:15:47reason you remember yesterday that for
  1152. 1:15:50the container we were able to uh copy a
  1153. 1:15:54file uh to the container and uh keep it
  1154. 1:15:58there.
  1155. 1:16:00uh we will try to do the same using the
  1156. 1:16:03what is called a sandbox.
  1157. 1:16:06So the way to do that
  1158. 1:16:09I can use the Python. Yeah, let's use
  1159. 1:16:11this Python image will be singularity
  1160. 1:16:17build
  1161. 1:16:19minus minus uh actually I can check I
  1162. 1:16:22will check the help here.
  1163. 1:16:29What is quite a lot of P
  1164. 1:16:41So you can build like a sandbox that is
  1165. 1:16:44a readr container with the like a
  1166. 1:16:46directory uh a structure
  1167. 1:16:50here is explaining the
  1168. 1:16:53image you have all of these uh options.
  1169. 1:17:02So singularity build
  1170. 1:17:06minus minus sandbox
  1171. 1:17:10I will need to specify the directory. So
  1172. 1:17:13directory will be python and rather than
  1173. 1:17:16use s if I will use uh emgd but you can
  1174. 1:17:22use uh or even don't even use like a
  1175. 1:17:26different name. This is like a just for
  1176. 1:17:30to know that this folder belongs to that
  1177. 1:17:34image.
  1178. 1:17:36And now I specify the name of the image.
  1179. 1:17:42Well, you get here like some warning
  1180. 1:17:44info etc.
  1181. 1:17:47And this is what what is doing is a
  1182. 1:17:51compressing
  1183. 1:17:53the
  1184. 1:17:56the
  1185. 1:17:59folder there in the so if we do now you
  1186. 1:18:03will see that you have here the
  1187. 1:18:09the image but also you have the image
  1188. 1:18:12that will be in a listing in a folder in
  1189. 1:18:15folder format. So if you go CD Python
  1190. 1:18:18and you do ls, you will see that there
  1191. 1:18:20you have all of the files that are on
  1192. 1:18:22the
  1193. 1:18:28like are on the on the image
  1194. 1:18:36and you can uh
  1195. 1:18:39draw the same as we have doing. If uh
  1196. 1:18:42you remember we have done singularity
  1197. 1:18:44run
  1198. 1:18:45well let's go back to one directory
  1199. 1:18:49we have done singularity
  1200. 1:18:52run python
  1201. 1:18:55sif
  1202. 1:18:57and here I have python I can print
  1203. 1:19:06you can do the same with the image Here
  1204. 1:19:15you can do uh
  1205. 1:19:25yeah print Okay.
  1206. 1:19:42This is uh this is uh interesting in
  1207. 1:19:45case that for some reason we want to
  1208. 1:19:48like add
  1209. 1:19:51a file to the
  1210. 1:19:55in case that we want to add a file to
  1211. 1:19:58the
  1212. 1:20:00uh to the image.
  1213. 1:20:09Uh for instance, we can do uh
  1214. 1:20:13we can do an example and you see how uh
  1215. 1:20:17um
  1216. 1:20:22how to do that. This is a bit more
  1217. 1:20:24complex but what the documentation I
  1218. 1:20:26will tell you where where it is in
  1219. 1:20:28there. So uh that is also a way that for
  1220. 1:20:33yeah we don't build the okay let's try
  1221. 1:20:36this and see if that so we have a
  1222. 1:20:38singularity
  1223. 1:20:40run
  1224. 1:20:43uh I will need minus minus uh
  1225. 1:20:48actually let's do
  1226. 1:20:52I will need this option minus w
  1227. 1:20:56I said by default all singularity
  1228. 1:20:58containers are available as a read only.
  1229. 1:21:00This option makes the file system
  1230. 1:21:02accessible as a read write.
  1231. 1:21:09So if we do that breakable
  1232. 1:21:15and
  1233. 1:21:22use the Python image here
  1234. 1:21:34I don't want to use
  1235. 1:21:38I want to is uh
  1236. 1:21:41shor
  1237. 1:21:49this.
  1238. 1:21:51So I can create mk
  1239. 1:22:09I can create here a file for instance
  1240. 1:22:12saying uh
  1241. 1:22:23hello. Let's see if uh I don't know if
  1242. 1:22:26this will have a
  1243. 1:22:32I don't know if this is here. No, it's
  1244. 1:22:35not here either. Okay. Well, but the way
  1245. 1:22:38to do that, I can do.
  1246. 1:22:51So, I can create a file here that will
  1247. 1:22:53be hello
  1248. 1:22:55py.
  1249. 1:23:00Yeah, since that doesn't look
  1250. 1:23:11Okay, I will use a quotation single
  1251. 1:23:14quotation marks
  1252. 1:23:17unknown.
  1253. 1:23:24Okay, so that works. If we do s we have
  1254. 1:23:27this file here
  1255. 1:23:29and if we use python hello
  1256. 1:23:34it will print hello.
  1257. 1:23:38I can yeah so uh for instance now if I
  1258. 1:23:43exit
  1259. 1:23:45the
  1260. 1:23:47the container
  1261. 1:23:49and uh this file must be uh there. So if
  1262. 1:23:53we do if I we go Python
  1263. 1:23:56we do /
  1264. 1:23:59you see that the file is here
  1265. 1:24:02and we have a this is because uh this is
  1266. 1:24:05like a kind of a how to say yeah this is
  1267. 1:24:07why it's called a sandbox when you uh
  1268. 1:24:10when you exit the container the fi uh if
  1269. 1:24:14you create some files there it will
  1270. 1:24:17remain there it's not like a as you
  1271. 1:24:20remember with the botman or docker
  1272. 1:24:23When we finish the container, if we have
  1273. 1:24:26created a file inside the container is
  1274. 1:24:29gone, but it's not in this case. Also
  1275. 1:24:31here we can edit the file and we can say
  1276. 1:24:36hello.
  1277. 1:24:37Oops.
  1278. 1:24:50Incredible.
  1279. 1:24:55Uh well also I didn't explain if you use
  1280. 1:24:58a vi if you want to edit you need to
  1281. 1:25:01type I and you see that the bottom
  1282. 1:25:03changes to insert.
  1283. 1:25:07So you can change let's use high. Now if
  1284. 1:25:11when you press escape you see that this
  1285. 1:25:13insert is a column and the way to save
  1286. 1:25:16is a column w is a bright and q is a
  1287. 1:25:21exit
  1288. 1:25:23uh quit
  1289. 1:25:26and this is a it's a vi could be a
  1290. 1:25:28little bit tricky but uh is the one of
  1291. 1:25:31the editors that are available in most
  1292. 1:25:35systems. So if you feel uh when you
  1293. 1:25:39learn a little bit about the vi this
  1294. 1:25:41will be available everywhere. Actually
  1295. 1:25:45the I think it's is not a VI it's a VI m
  1296. 1:25:49the version that is available but it's a
  1297. 1:25:52VI improve
  1298. 1:25:54because the original version that is a
  1299. 1:25:56VI is even more uh
  1300. 1:26:00is even I would say more tricky to to
  1301. 1:26:05use
  1302. 1:26:07design when the like even when the
  1303. 1:26:10keyboards they don't they didn't have
  1304. 1:26:11the arrows so you would needed to move
  1305. 1:26:14with the with some letters. Yeah, was a
  1306. 1:26:17bit tricky.
  1307. 1:26:20Okay.
  1308. 1:26:21uh what I wanted to uh show. So if we do
  1309. 1:26:28okay we are containers again have this
  1310. 1:26:30uh so what I will do now is I will run
  1311. 1:26:33the container doing singularity
  1312. 1:26:38uh exact uh my container will be python
  1313. 1:26:45no sh
  1314. 1:26:51and uh I want to uh do python
  1315. 1:26:56So opt
  1316. 1:27:05and you see that it works. So we have
  1317. 1:27:08singularity except this is the the image
  1318. 1:27:12where the sandbox and I'm running
  1319. 1:27:14python/op/hello.
  1320. 1:27:17py. So the file that I have created in
  1321. 1:27:20the sandbox remains. If I do the same
  1322. 1:27:23with the original image, I will get an
  1323. 1:27:27error.
  1324. 1:27:29They said that
  1325. 1:27:32cannot open file. No such file or
  1326. 1:27:34directory
  1327. 1:27:43and uh
  1328. 1:27:48I'm trying to
  1329. 1:27:57So this is a way I think the work
  1330. 1:28:12I'm trying to check if something else
  1331. 1:28:15Awesome.
  1332. 1:28:34Yeah. Also, I'm not sure if because I
  1333. 1:28:38haven't tried I think that when you have
  1334. 1:28:40this sandbox, you can convert. Let me
  1335. 1:28:43try and see if that uh
  1336. 1:28:46if that works. Uh
  1337. 1:28:51um
  1338. 1:28:54okay. Singularity
  1339. 1:28:56build.
  1340. 1:28:58So what I can do is I can use now my uh
  1341. 1:29:04I will say Python hello. This will be my
  1342. 1:29:07image
  1343. 1:29:09and uh I will use the sandbox. Uh the
  1344. 1:29:13sandbox is a Python.
  1345. 1:29:34So in theory now if I do singularity
  1346. 1:29:36access
  1347. 1:29:39using Python hello
  1348. 1:29:56you will it will uh
  1349. 1:29:59so a way also a way of building or what
  1350. 1:30:03like Uh adding files to a image on a
  1351. 1:30:07using singularity is like a you you
  1352. 1:30:10uncompress the original image with
  1353. 1:30:13sandbox
  1354. 1:30:16you edit the files as you wish and then
  1355. 1:30:20you do the you rebuild the no it's not
  1356. 1:30:24access is here.
  1357. 1:30:28So you do singularity build python
  1358. 1:30:32hello. This is the new the name of the
  1359. 1:30:34new image and the
  1360. 1:30:38and the name of the directory that uh
  1361. 1:30:41where the sandbox is and create the new
  1362. 1:30:45image. Now if we do singularity
  1363. 1:30:49cell
  1364. 1:30:50python hello
  1365. 1:30:53if we go to /
  1366. 1:30:57we see that we have a hello
  1367. 1:31:08any questions? This is a bit more
  1368. 1:31:11complex but well this is like explaining
  1369. 1:31:13if in case that you want to uh for some
  1370. 1:31:16reason add some files or some scripts to
  1371. 1:31:19your
  1372. 1:31:21uh image. A way or if also if you want
  1373. 1:31:25to have more control a way is to use a
  1374. 1:31:29sandbox.
  1375. 1:31:30And with the sandbox you can create a
  1376. 1:31:33new image once that you're happy with
  1377. 1:31:36the files that are in that sand sound
  1378. 1:31:38sandbox.
  1379. 1:31:56Okay. So, just to uh finish this this
  1380. 1:32:00part
  1381. 1:32:02actually let me
  1382. 1:32:16Um
  1383. 1:32:23there are some links here on the
  1384. 1:32:24documentation. I will share them in the
  1385. 1:32:26the chat. I will stop saying this and
  1386. 1:32:30share.
  1387. 1:32:46So one of the first they were they were
  1388. 1:32:48ask question about the containers versus
  1389. 1:32:50uh virtual machines. So you go here you
  1390. 1:32:54have here
  1391. 1:32:56uh some information about uh it is a
  1392. 1:33:01smaller
  1393. 1:33:03well it's a big enough the for the
  1394. 1:33:05container architecture the virtual
  1395. 1:33:07machine and also a comparison of
  1396. 1:33:11uh virtual machine versus a container
  1397. 1:33:16because operating system
  1398. 1:33:20one main characteristic is that the
  1399. 1:33:22operating system and the virtual machine
  1400. 1:33:25runs a complete operating system
  1401. 1:33:27including the kerner and it needs more
  1402. 1:33:30resources
  1403. 1:33:33and in a container runs a portion of
  1404. 1:33:36that operating system.
  1405. 1:33:46So this is one also here the container
  1406. 1:33:48technologies docker pod m well maybe the
  1407. 1:33:53state-ofthe-art is a bit uh not because
  1408. 1:33:56this is like a YouTube video from
  1409. 1:33:59so yeah probably not
  1410. 1:34:04in case that for some you want you are
  1411. 1:34:07like from what you are involved in
  1412. 1:34:10bioinformatics research I hear also like
  1413. 1:34:13some uh recommendations
  1414. 1:34:16I will make this
  1415. 1:34:20or how to uh
  1416. 1:34:24well here for instance they advocated
  1417. 1:34:26for one tool one containers
  1418. 1:34:29Monday we saw that we can have a big
  1419. 1:34:32container with several tools or like a
  1420. 1:34:35smaller containers. Yeah, for instance,
  1421. 1:34:38they define that is a one tool, one
  1422. 1:34:41container
  1423. 1:34:43because we have we haven't covered here
  1424. 1:34:45in the that is like a what is called
  1425. 1:34:51uh container container orchestration
  1426. 1:34:54that is a workflow. So having several
  1427. 1:34:57containers
  1428. 1:34:58uh you can uh have a workflow. So
  1429. 1:35:01imagine that you have a
  1430. 1:35:04uh protein that you want to uh follow do
  1431. 1:35:08some operations. So uh you use one
  1432. 1:35:12container to do one operation then the
  1433. 1:35:14output will be the input of the next
  1434. 1:35:16container and so on. So we will create a
  1435. 1:35:19pipeline of that
  1436. 1:35:23and here there are more documentation
  1437. 1:35:25about singularity obtainer and uh yeah
  1438. 1:35:29this is the
  1439. 1:35:32uh
  1440. 1:35:34so what we will see this afternoon is we
  1441. 1:35:37have a
  1442. 1:35:40well two exercises. The first one will
  1443. 1:35:42be singularity
  1444. 1:35:44to run blast. that this is an example of
  1445. 1:35:47uh of what we have seen to u
  1446. 1:35:52uh we will see that without the having
  1447. 1:35:54the software on archer 2 uh you can run
  1448. 1:35:58uh
  1449. 1:36:00this uh example
  1450. 1:36:04and uh here we have a also but maybe you
  1451. 1:36:07are not you are not familiar with NPI
  1452. 1:36:11not the how to uh for instance how to
  1453. 1:36:14build software or how to build an MPI uh
  1454. 1:36:19uh code on a container and run it on
  1455. 1:36:23Archer 2. This uh could do not be uh
  1456. 1:36:27maybe it's not uh up to date. So my
  1457. 1:36:29recommendation is to go to the to the to
  1458. 1:36:32the docs the
  1459. 1:36:35I will copy that on the that this is a
  1460. 1:36:38update.
  1461. 1:36:41So here if you go to uh use some best
  1462. 1:36:44practice
  1463. 1:36:46containers
  1464. 1:36:48and then
  1465. 1:36:53here using singularity with my pi on our
  1466. 1:36:562 uh if you follow this uh tutorial you
  1467. 1:37:01will uh so they yeah it's explain like a
  1468. 1:37:04step by step uh here what you do is in
  1469. 1:37:07your laptop you copy this docker file
  1470. 1:37:10Okay.
  1471. 1:37:12And you build the the image.
  1472. 1:37:16Also, you need to specify here platform.
  1473. 1:37:20And once that you build the image, you
  1474. 1:37:22docker push. And when once that you are
  1475. 1:37:26on archer 2, you use this uh running a
  1476. 1:37:30script.
  1477. 1:37:31Oops,
  1478. 1:37:34sorry. That's something that
  1479. 1:37:38use this running script.
  1480. 1:37:40and uh you run out and if uh it runs
  1481. 1:37:43okay you will see this uh output uh
  1482. 1:37:49here.
  1483. 1:37:50So this is what uh we will do after
  1484. 1:37:55after uh lunch. Lunch will be like now
  1485. 1:37:58the lunch break from uh from noon until
  1486. 1:38:011:00 p.m. And uh after lunch will be
  1487. 1:38:05like a yeah exercises and uh you playing
  1488. 1:38:08with Podma or uh or Singularity
  1489. 1:38:12containers on on Archer 2. So uh yeah
  1490. 1:38:19please uh feel free to uh come and do
  1491. 1:38:21the exercises but it's will be like kind
  1492. 1:38:23of open. So uh if you want to uh yeah
  1493. 1:38:28follow the exercises and have any
  1494. 1:38:31questions uh feel free. If not uh or if
  1495. 1:38:35you want to do them on your own uh you
  1496. 1:38:39will have the account for I think for
  1497. 1:38:41two more weeks.
  1498. 1:38:44So uh you can do them uh in another time
  1499. 1:38:48in case that this afternoon is not
  1500. 1:38:50working well for you. Uh you can always
  1501. 1:38:54get in touch by mail and we can see the
  1502. 1:38:57my mail address is if you want
  1503. 1:39:05so you can always get in touch. Anyway,
  1504. 1:39:08yeah, let's have a lunch break and uh
  1505. 1:39:12yeah, see you at 1 pm. So, any questions
  1506. 1:39:15or anything that you may have, I'll be
  1507. 1:39:17uh I'll be there. Uh yeah, bye for now
  1508. 1:39:21and yeah, see you uh later today.

About this transcript

This page contains the full transcript of ARCHER2 - Containers for Reproducible Research: Introduction to Podman and Singularity - Session 3 by ARCHER2 HPC, generated from the public captions YouTube serves with the video. The transcript has 9,151 words across 1,508 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.

What you can do with it

Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.

Free YouTube transcript tool

YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.