A cotinuación se detalla cómo proceder de forma general a al hora de incorporar cambios o realizar correcciones en los repositorios de AIC
Para proceder seguimos los siguientes pasos.
Accedemos a la url indicada anteriormente y vemos lo siguiente.
Tal como se ve, a día de hoy hay disponibles 3 repositorios, cada uno con un objetivo distinto, y habrá en breve algunos más.
Indicar que a día de hoy el servicio de https://git.csic.es está siendo realizado por parte del Área Tecnológica de la SGAI.
Para loguearse en https://git.csic.es debemos hacer uso de usuario de Intranet del CSIC.
En primer lugar vamos a proceder a clonar el repositorio, para ello vamos a la web y copiamos el enlace al repositorio en cuestión.
Si no tenemos llave RSA subida a la cuenta nuestra del git.csic.es procedemos a copiar la url basada en HTTPS.
Ahora nos vamos a nuestra línea de comandos y procedemos de la siguiente forma:
[usuario@drago31010015 ~]$ git clone https://git.csic.es/area-de-informatica-cientifica/drago-hpc-containers.git
Cloning into 'drago-hpc-containers'...
Username for 'https://git.csic.es': usuario
Password for 'https://usuario@git.csic.es':
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 24 (delta 5), reused 2 (delta 0), pack-reused 0
Receiving objects: 100% (24/24), 8.59 KiB | 2.15 MiB/s, done.
Resolving deltas: 100% (5/5), done.
[usuario@drago31010015 ~]$
Y vemos el directorio resultado.
[usuario@drago31010015 ~]$ ls -lh
total 20K
drwxr-sr-x 6 usuario aula1 4.0K Sep 22 19:29 drago-hpc-containers
En primer lugar revisamos el branch en el que estamos y vemos si necesitamos cambiar de branch, ya que debemos situarnos en el branch a partir del cual vamos a basar nuestro cambio o corrección.
Y a continuación se procede a crear el nuevo branch.
[usuario@drago31010015 drago-hpc-containers]$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
[usuario@drago31010015 drago-hpc-containers]$ git checkout -b add_rocky_dockerfile
Switched to a new branch 'add_rocky_dockerfile'
[usuario@drago31010015 drago-hpc-containers]$ git add .
[usuario@drago31010015 drago-hpc-containers]$ git commit -m "adding rocky dockerfile"
On branch add_rocky_dockerfile
nothing to commit, working tree clean
[usuario@drago31010015 drago-hpc-containers]$ git push origin main
Username for 'https://git.csic.es': usuario
Password for 'https://usuario@git.csic.es':
Everything up-to-date
Revisamos los branch creados y subidos tanto por línea de comandos como por web.
[usuario@drago31010015 drago-hpc-containers]$ git branch -r
origin/06256413E-main-patch-77529
origin/HEAD -> origin/main
origin/examples_scripts
origin/initial_base_dockerfiles
origin/main
o desde la web del repositorio.
En este caso, vamos a proceder a generar un nuevo Dockerfile basado en el existente de almalinux8.
[usuario@drago31010015 drago-hpc-containers]$ git status
On branch add_rocky_dockerfile
nothing to commit, working tree clean
[usuario@drago31010015 drago-hpc-containers]$ cp -aR almalinux8/ rockylinux8
[usuario@drago31010015 drago-hpc-containers]$ ls -lh rockylinux8/
total 4.0K
-rw-r--r-- 1 usuario aula1 1.7K Sep 22 19:29 Dockerfile
[usuario@drago31010015 drago-hpc-containers]$
Finalmente modificamos el Dockerfile para que coja de base del HUB de Docker el rockylinux:8
[usuario@drago31010015 drago-hpc-containers]$ cat rockylinux8/Dockerfile
# ch-test-scope: standard
FROM rockylinux:8
# This image has two purposes: (1) demonstrate we can build a AlmaLinux 8 image
# and (2) provide a build environment for Charliecloud EPEL 8 RPMs.
#
# Quirks:
#
# 1. Install the dnf ovl plugin to work around RPMDB corruption when
# building images with Docker and the OverlayFS storage driver.
#
# 2. Enable PowerTools repo, because some packages in EPEL depend on it.
#
# 3. Install packages needed to build el8 rpms.
#
# 4. Issue #1103: Install libarchive to resolve cmake bug
#
RUN dnf install -y --setopt=install_weak_deps=false \
epel-release \
'dnf-command(config-manager)' \
&& dnf config-manager --enable powertools \
&& dnf install -y --setopt=install_weak_deps=false \
dnf-plugin-ovl \
autoconf \
automake \
Procedemos de la siguiente forma
[usuario@drago31010015 drago-hpc-containers]$ git status
On branch add_rocky_dockerfile
Untracked files:
(use "git add <file>..." to include in what will be committed)
rockylinux8/
nothing added to commit but untracked files present (use "git add" to track)
[usuario@drago31010015 drago-hpc-containers]$ git add rockylinux8/
[usuario@drago31010015 drago-hpc-containers]$ git commit -m "adding rockylinux8 Dockerfile"
[add_rocky_dockerfile efe221d] adding rockylinux8 Dockerfile
Committer: usuario <usuario@drago31010015.mgmt.cc.csic.es>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly. Run the
following command and follow the instructions in your editor to edit
your configuration file:
git config --global --edit
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 51 insertions(+)
create mode 100644 rockylinux8/Dockerfile
[usuario@drago31010015 drago-hpc-containers]$ git status
On branch add_rocky_dockerfile
nothing to commit, working tree clean
[usuario@drago31010015 drago-hpc-containers]$ git push origin add_rocky_dockerfile
Username for 'https://git.csic.es': usuario
Password for 'https://usuario@git.csic.es':
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 48 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 1.04 KiB | 356.00 KiB/s, done.
Total 4 (delta 1), reused 0 (delta 0), pack-reused 0
remote:
remote: To create a merge request for add_rocky_dockerfile, visit:
remote: https://git.csic.es/area-de-informatica-cientifica/drago-hpc-containers/-/merge_requests/new?merge_request%5Bsource_branch%5D=add_rocky_dockerfile
remote:
To https://git.csic.es/area-de-informatica-cientifica/drago-hpc-containers.git
* [new branch] add_rocky_dockerfile -> add_rocky_dockerfile
[usuario@drago31010015 drago-hpc-containers]$
Procedemos a subir cambios al branch ahora mismo principal que es main.
Si vamos a la consola web podemos hacerlo visual.
Como hemos realizado un commit nos aparece la posibilidad directamente de generar el merge tal como se ve a continuación.
Rellenamos campos incluyendo a quién se lo asignamos, generalmente algún owner del repo.
Y cogemos, al usuario propietario le llegará la petición y verá algo tal como sigue
y si los cambios o añadidos están ok, le dará vía al Merge pulsando al botón.
Y finalmente en repo main ya veremos los nuevos cambios.