papa-deimos/instalacion
(→En deimos) |
(→ATRACKCS) |
||
(No se muestran 26 ediciones intermedias realizadas por un usuario) | |||
Línea 47: | Línea 47: | ||
1. Información del grupo (descripción salida de [https://askubuntu.com/questions/811513/output-of-getent-group getent], estructura <code>[NombreGrupo]:[InfPWD]:[idGrupo]:[Usuarie1],...,[UsuarieN]</code>) |
1. Información del grupo (descripción salida de [https://askubuntu.com/questions/811513/output-of-getent-group getent], estructura <code>[NombreGrupo]:[InfPWD]:[idGrupo]:[Usuarie1],...,[UsuarieN]</code>) |
||
<pre style="shell"> |
<pre style="shell"> |
||
− | # getent group datosABC |
+ | # getent group proy123 |
− | datosABC:x:1234356:usuarieX,usuarieY,usuarieZ |
+ | proy123:x:1234356:usuarieX,usuarieY,usuarieZ |
</pre> |
</pre> |
||
1. atribuyendo propiedad del directorio al grupo |
1. atribuyendo propiedad del directorio al grupo |
||
Línea 57: | Línea 57: | ||
</pre> |
</pre> |
||
Para que el usuarie de deimos tenga acceso de lectura a estos datos, hace falta que el grupo exista en Deimos (mirar en sección) con el mismo nombre y sobre todo el mismo <code>[idGROUP]</code>. |
Para que el usuarie de deimos tenga acceso de lectura a estos datos, hace falta que el grupo exista en Deimos (mirar en sección) con el mismo nombre y sobre todo el mismo <code>[idGROUP]</code>. |
||
+ | |||
+ | Está por ver si hace falta crear el usuario de 'Deimos' en 'Papa' (con el mismo id que en Deimos) |
||
+ | <pre style="shell"> |
||
+ | # adduser --no-create-home --uid [uid_Deimos] --force-badname jupyter-usuarieX |
||
+ | # usermod -aG proy123 jupyter-usuarieX |
||
+ | </pre> |
||
= En deimos = |
= En deimos = |
||
Línea 89: | Línea 95: | ||
Está por ver, si les otres usuaries verán los paquetes. O cómo hacerlo desde un entorno? |
Está por ver, si les otres usuaries verán los paquetes. O cómo hacerlo desde un entorno? |
||
== JupyterHub ([https://jupyter.org/hub https://jupyter.org/hub]) == |
== JupyterHub ([https://jupyter.org/hub https://jupyter.org/hub]) == |
||
− | |||
− | == acceso restringido a datos == |
||
− | Después de la creación de un grupo de acceso restringido de datos en Papa, para que un usuario tenga acceso a los archivos, necesita que: |
||
− | 1. El mismo grupo exista en Deimos con el mismo nombre y id de grupo |
||
− | 1. El usuario de <code>jupyter-[NombreUsuarie]</code> esté asociado al grupo |
||
− | |||
− | Agarramos el mismo grupo de ejemplo creado en Papa <code>DatosABC</code>, id grupo: 123456 |
||
− | |||
− | 1. Creación del grupo |
||
− | <pre style="shell"> |
||
− | # |
||
− | </pre> |
||
− | |||
=== Installing server ([https://jupyter.org/hub jupyter-server]) === |
=== Installing server ([https://jupyter.org/hub jupyter-server]) === |
||
Línea 128: | Línea 121: | ||
En deimos |
En deimos |
||
<pre style="shell"> |
<pre style="shell"> |
||
− | # adduser -m [NombreUsuario] |
+ | # useradd -MN [NombreUsuario] |
# sudo passwd [NombreUsuario] |
# sudo passwd [NombreUsuario] |
||
</pre> |
</pre> |
||
− | <I>El sistema papa-deimos, se pudo constituir en parte, gracias a fondos del [https://www.insu.cnrs.fr/fr INSU] - [https://programmes.insu.cnrs.fr/lefe/ LEFE]</I> |
+ | <!-- For andamos |
+ | # groupadd -g 900001 andamos |
||
+ | # useradd -MN -g andamos andex.andamos |
||
+ | # passwd [pswd] andex.andamos |
||
+ | |||
+ | # groupadd -g 90002 guests |
||
+ | # useradd -MN -g guests clementine.junquas |
||
+ | # passwd [pwd] clementine.junquas |
||
+ | --> |
||
+ | |||
+ | Desde jupyterHUB activar la cuenta del nueve usuarie |
||
+ | |||
+ | == acceso restringido a datos == |
||
+ | Después de la creación de un grupo de acceso restringido de datos en Papa, para que un usuario tenga acceso a los archivos, necesita que: |
||
+ | 1. El mismo grupo exista en Deimos con el mismo nombre y id de grupo |
||
+ | 1. El usuario de <code>jupyter-[NombreUsuarie]</code> esté asociado al grupo |
||
+ | |||
+ | Desde una ventana <code>shell</code> de jupyter, se obtieene: |
||
+ | <pre style="shell"> |
||
+ | ls DatosABC |
||
+ | ls: cannot open directory 'DatosABC': Permission denied |
||
+ | </pre> |
||
+ | |||
+ | Agarramos el mismo grupo de ejemplo creado en Papa <code>proy123</code>, id grupo: 123456 |
||
+ | |||
+ | 1. Comprobamos grupos pre-existentes |
||
+ | <pre style="shell"> |
||
+ | # getent group | grep proy123 |
||
+ | |||
+ | # getent group | grep 123456 |
||
+ | |||
+ | </pre> |
||
+ | '''NOTA:''' Si el id de grupo ya existe en 'Deimos', se tendrá que cambiar el id del grupo en 'Papa' (y actualizar todos los archivos asociados) con las instrucciones (siguiendo [https://unix.stackexchange.com/questions/33844/change-gid-of-a-specific-group Stack Overflow]) |
||
+ | <pre style="shell"> |
||
+ | # groupmod -g [nuevoIDgrupo] proy123 |
||
+ | # find / -gid [viejoIDgrupo] ! -type l -exec chgrp [nuevoIDgrupo] {} \; |
||
+ | </pre> |
||
+ | |||
+ | 1. Creación del grupo |
||
+ | <pre style="shell"> |
||
+ | # groupadd -g 123456 proy123 |
||
+ | </pre> |
||
+ | |||
+ | 1. Asignación de usuaries |
||
+ | <pre style="shell"> |
||
+ | # usermod -aG proy123 jupyter-usuarieX |
||
+ | # usermod -aG proy123 jupyter-usuarieY |
||
+ | # usermod -aG proy123 jupyter-usuarieZ |
||
+ | </pre> |
||
+ | |||
+ | 1. Verificación |
||
+ | <pre style="shell"> |
||
+ | # getent group proy123 |
||
+ | proy123:x:123456:jupyter-usuarieX,jupyter-usuarieY,jupyter-usuarieZ |
||
+ | </pre> |
||
== Nota acerca 'flavor' archivos netCDF == |
== Nota acerca 'flavor' archivos netCDF == |
||
Línea 204: | Línea 197: | ||
</PRE> |
</PRE> |
||
Ahora ya se puede abrir un notebook the python en el directorio <CODE>estudios/EstudioXY12</CODE> (aparecerá en el home del juyterHUB del usuario) y poder utilizar sin problemas las scripts de PyNCplot |
Ahora ya se puede abrir un notebook the python en el directorio <CODE>estudios/EstudioXY12</CODE> (aparecerá en el home del juyterHUB del usuario) y poder utilizar sin problemas las scripts de PyNCplot |
||
+ | |||
+ | === Digital Earths - Global Hackathon === |
||
+ | En la semana del 13 al 16 de Mayo aconteció el la [https://www.wcrp-esmo.org/activities/wcrp-global-km-scale-hackathon-2025 Digital Earths - Global Hackathon] en la cuál el CIMA/IFAECI participó con la organización de un nodo en [https://git.cima.fcen.uba.ar/gvieytes/global-hackathon/-/wikis/home CABA]. Para esa actividad fue necesaria la instalación de un entorno de python el cuál se hizo accesible para todes les usuaries de Deimos. Estos son los pasos seguidos: |
||
+ | |||
+ | First download the Hachkathon's repository as root in <CODE>/opt/onda/mamba/DE-global_hackathon<CODE> (as root) |
||
+ | <PRE style="shell"> |
||
+ | # git clone https://github.com/digital-earths-global-hackathon/tools.git |
||
+ | </PRE> |
||
+ | |||
+ | Go to directory with installation and make a copy for <CODE>deimos</CODE> and edit the prefix |
||
+ | <PRE style="shell"> |
||
+ | # cd tools/python_envs |
||
+ | # cp install_python install_python_deimos |
||
+ | diff install_python install_python_orig install_python install_python_orig |
||
+ | 4c4,5 |
||
+ | < prefix=${prefix:-$HOME/python_envs} |
||
+ | --- |
||
+ | > #prefix=${prefix:-$HOME/python_envs} |
||
+ | > prefix=/opt/conda/mamba/DE-global_hackathon |
||
+ | ./install_python_deimos |
||
+ | ``` |
||
+ | We got the right installation |
||
+ | <PRE style="shell"> |
||
+ | ls /opt/conda/mamba/DE-global_hackathon/ |
||
+ | miniconda3 tools |
||
+ | </PRE> |
||
+ | |||
+ | Registering the new kernel [https://jupyterhub.readthedocs.io/en/stable/howto/configuration/config-user-env.html jupyerhub-doc] and [https://discourse.jupyter.org/t/add-multiple-python-kernels-like-3-6-x-and-3-7-x-to-jupyterhub/5458/3 multiple-kernels] |
||
+ | <PRE style="shell"> |
||
+ | # /opt/tljh/user/bin/jupyter kernelspec list |
||
+ | Available kernels: |
||
+ | python3 /opt/tljh/user/share/jupyter/kernels/python3 |
||
+ | bash /usr/local/share/jupyter/kernels/bash |
||
+ | ir /usr/local/share/jupyter/kernels/ir |
||
+ | python_conda_su /usr/local/share/jupyter/kernels/python_conda_su |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec remove python_conda_su |
||
+ | Kernel specs to remove: |
||
+ | python_conda_su /usr/local/share/jupyter/kernels/python_conda_su |
||
+ | Remove 1 kernel specs [y/N]: y |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec list |
||
+ | Available kernels: |
||
+ | python3 /opt/tljh/user/share/jupyter/kernels/python3 |
||
+ | bash /usr/local/share/jupyter/kernels/bash |
||
+ | ir /usr/local/share/jupyter/kernels/ir |
||
+ | # /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba install ipykernel |
||
+ | # /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy/bin/python3 -m ipykernel install |
||
+ | Installed kernelspec python3 in /usr/local/share/jupyter/kernels/python3 |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec install /usr/local/share/jupyter/kernels/python3 --name=python_DigEarth-Hack |
||
+ | [InstallKernelSpec] Installed kernelspec python_digearth-hack in /usr/local/share/jupyter/kernels/python_digearth-hack |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec list |
||
+ | Available kernels: |
||
+ | python3 /opt/tljh/user/share/jupyter/kernels/python3 |
||
+ | bash /usr/local/share/jupyter/kernels/bash |
||
+ | ir /usr/local/share/jupyter/kernels/ir |
||
+ | python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack |
||
+ | </PRE> |
||
+ | |||
+ | Editing kernel name to be recognizible in jupyterHUB api and set-up environment (see [https://stackoverflow.com/questions/67914989/creating-virtual-environments-for-jupyterhub stackoverflow]) |
||
+ | <PRE style="shell"> |
||
+ | # vim /usr/local/share/jupyter/kernels/python_digearth-hack/kernel.json |
||
+ | "display_name": "Python 3 (D.E. Hachkathon)", |
||
+ | "env": { |
||
+ | "MAMBA_PREFIX":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy", |
||
+ | "MAMBA_DEFAULT_ENV":"easy", |
||
+ | "PATH":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy/bin:/opt/conda/mamba/DE-global_hackathon/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
||
+ | }, |
||
+ | </PRE> |
||
+ | |||
+ | ==== Adding new packages/libraries to an existing environment ==== |
||
+ | |||
+ | To add new libraries, using mamba (preferred way) |
||
+ | <PRE style="shell"> |
||
+ | # /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba install -n easy pyflextrkr |
||
+ | </PRE> |
||
+ | |||
+ | Via pip |
||
+ | <PRE style="shell"> |
||
+ | # cd /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy |
||
+ | # bin/pip3 install healpy |
||
+ | </PRE> |
||
+ | |||
+ | === ATRACKCS === |
||
+ | El [https://github.com/ATRACKCS/ATRACKCS ATRACKCS] Esta herramienta está diseñada para realizar seguimientos de sistemas atmosféricos. Estos son los pasos seguidos para su instalación en Deimos |
||
+ | |||
+ | Creando el enclave del paquete |
||
+ | <PRE style="sell"> |
||
+ | # cd /opt/conda/mamba/ |
||
+ | # mkdir ATRACKCS |
||
+ | # cd ATRACKCS |
||
+ | </PRE> |
||
+ | |||
+ | Agarrando el software y preparando la instalación via la creación de un nuevo entorno de python |
||
+ | <PRE style="shell"> |
||
+ | # git clone https://github.com/alramirezca/ATRACKCS |
||
+ | # cd ATRACKCS |
||
+ | # /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba env create -f env_py3.yml |
||
+ | </PRE> |
||
+ | |||
+ | Activación del entorno y terminar la instalación |
||
+ | <PRE style="shell"> |
||
+ | # eval "$(/opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba shell hook --shell bash)" |
||
+ | (base) # mamba activate atrackcs_py3 |
||
+ | (atrackcs_py3) # pip install -e . |
||
+ | </PRE> |
||
+ | |||
+ | Registrando el nuevo kernel para deimos: |
||
+ | <PRE style="shell"> |
||
+ | (atrackcs_py3) # pip3 install ipykernel |
||
+ | (atrackcs_py3) # mamba deactivate |
||
+ | (base) # mamba deactivate |
||
+ | # /opt/tljh/user/bin/jupyter kernelspec list |
||
+ | Available kernels: |
||
+ | python3 /opt/tljh/user/share/jupyter/kernels/python3 |
||
+ | bash /usr/local/share/jupyter/kernels/bash |
||
+ | ir /usr/local/share/jupyter/kernels/ir |
||
+ | python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack |
||
+ | # /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3/bin/python3 -m ipykernel install |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec install /usr/local/share/jupyter/kernels/python3 --name=python_atrackcs |
||
+ | # /opt/tljh/user/bin/jupyter-kernelspec list |
||
+ | Available kernels: |
||
+ | python3 /opt/tljh/user/share/jupyter/kernels/python3 |
||
+ | bash /usr/local/share/jupyter/kernels/bash |
||
+ | ir /usr/local/share/jupyter/kernels/ir |
||
+ | python_atrackcs /usr/local/share/jupyter/kernels/python_atrackcs |
||
+ | python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack |
||
+ | </PRE> |
||
+ | |||
+ | Editando el nombre del kernel para identificarlo desde deimos: |
||
+ | <PRE style="shell"> |
||
+ | # vim /usr/local/share/jupyter/kernels/python_atrackcs/kernel.json |
||
+ | "display_name": "Python 3 (atrackcs)", |
||
+ | "env": { |
||
+ | "MAMBA_PREFIX":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3", |
||
+ | "MAMBA_DEFAULT_ENV":"atrackcs_py3", |
||
+ | "PATH":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3/bin:/opt/conda/mamba/DE-global_hackathon/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" |
||
+ | }, |
||
+ | </PRE> |
||
=== ESMValTool === |
=== ESMValTool === |
||
Línea 209: | Línea 339: | ||
Los pasos para su instalación se detallan acá [[/ESMValToolInst]]. |
Los pasos para su instalación se detallan acá [[/ESMValToolInst]]. |
||
+ | |||
+ | <I>El sistema papa-deimos, se pudo constituir en parte, gracias a fondos del [https://www.insu.cnrs.fr/fr INSU] - [https://programmes.insu.cnrs.fr/lefe/ LEFE]</I> |
Última revisión de 17:16 20 mayo 2025
Contenido |
[editar] En papa
$ mkdir -p ~/sandbox/copy/ $ mkdir -p ~/sandbox/get/ $ sudo mkdir -p /datos/MOD/re-analysis/ECMWF/ERA5/monmean $ sudo mv ~/sandbox/copy/ERA5_monmean_* /datos/MOD/re-analysis/ECMWF/ERA5/monmean/
Instalación para descargar datos del ECMWF via la API
$ sudo apt-get install python3-pip $ sudo pip3 install ecmwf-api-client
Instalación para descagar datos de Copernicus via la cdstoolbox
$ sudo pip3 install cdstoolbox-remote
NOTA: Las cdstoolbox, utilizan un sistema de llaves (keys) para que la API funcione. En este caso, se utiliza la llave del usuario de Lluís Fita en Copernicus para descargar los datos
[editar] acceso restringido a datos
Los datos en el directorio /datos
son accesibles por todos los usuaries. No obstante, hay bases de datos con acceso restringido por distintos motivos (confidencialidad, ética, ...).
En estos casos, el directorio que contiene los datos sólo es accesible a un determinado grupo de usuaries creado a propósito
Por ejemplo tenemos los datos datosABC
de un proyecto llamado proy123
con los usuaries usuarieX,usuarieY,usarieZ
.
1. retiro permiso lectura para todes les usuaries
# ls -l d-wxr-xr-x 2 root root 4096 Jul 16 11:14 datosABC # chmod a-r datosABC # ls -l d-wxr-x--x 2 root root 4096 Jul 16 11:14 datosABC
1. creación de un grupo nuevo de usuaries
# groupadd proy123
1. Assignando usuaries al nuevo grupo
# sudo usermod -aG proy123 usuarieX # sudo usermod -aG proy123 usuarieY # sudo usermod -aG proy123 usuarieZ
1. Información del grupo (descripción salida de getent, estructura [NombreGrupo]:[InfPWD]:[idGrupo]:[Usuarie1],...,[UsuarieN]
)
# getent group proy123 proy123:x:1234356:usuarieX,usuarieY,usuarieZ
1. atribuyendo propiedad del directorio al grupo
# chgrp -R proy123 datosABC # ls -l d-wxr-x--x 2 root proy123 4096 Jul 16 11:14 datosABC
Para que el usuarie de deimos tenga acceso de lectura a estos datos, hace falta que el grupo exista en Deimos (mirar en sección) con el mismo nombre y sobre todo el mismo [idGROUP]
.
Está por ver si hace falta crear el usuario de 'Deimos' en 'Papa' (con el mismo id que en Deimos)
# adduser --no-create-home --uid [uid_Deimos] --force-badname jupyter-usuarieX # usermod -aG proy123 jupyter-usuarieX
[editar] En deimos
JupyterHub, tiene su propia instalación de python y por lo tanto de sus paquetes. Ver expliación acá
$ sudo su # apt-get install git subversion # apt-get install python3 python3-scipy python3-numpy cython3 cython3-dbg # apt-get install netcdf-bin libnetcdf-dev netcdf-doc libnetcdff-dev libnetcdff-doc libhdf5-dev libhdf5-dev ncview cdo nco # apt-get install dvipng python3-netcdf4 # apt-get install python3-matplotlib python3-matplotlib-dbg # apt-get install python3-cartopy python-cartopy-data python3-mpltoolkits.basemap # apt-get install firefox-esr firefox-esr-l10n-all # apt-get install gfortran # apt-get install imagemagick # apt-get install gcc-multilib
El python the jupyterHub del usuario (?) es este /opt/tljh/user/bin/python3
, por lo tanto, se tiene que instalar usando el pip
de ese directorio
# /opt/tljh/user/bin/pip3 install numpy # /opt/tljh/user/bin/pip3 install netcdf4 # /opt/tljh/user/bin/pip3 install matplotlib # /opt/tljh/user/bin/conda install gcc # apt-get install libgeos-dev # /opt/tljh/user/bin/pip3 install cartopy
Está por ver, si les otres usuaries verán los paquetes. O cómo hacerlo desde un entorno?
[editar] JupyterHub (https://jupyter.org/hub)
[editar] Installing server (jupyter-server)
[editar] Kernels
El sistema jupyter se basa en notebooks / kernels para distintos lenguajes de programación.
[editar] Instalando un kernel de bash
En esta sección se cuentan los pasos seguidos para instalar un kernel de bash papa-deimos/BashKernelIns.
[editar] Instalando un kernel de R
Instalando R en deimos se cuentan en esta página papa-deimos/instalacion/RKernelIns.
sudo apt-get install r-base r-base-core r-base-core-dbg r-base-dev
Creando el irkernel en JupyerHub siguiendo estas instrucciones
[editar] Añadir usuaries
Todas las personas con cuenta en los recursos computacionales del CIMA, sólo tienen que pedir la apertura de la cuenta en el jupyterHub a Lluís Todas las personas del DCAO, tienen que pedir la apertura de la cuenta en el sistema y en el jupyterHub a Lluís
En deimos
# useradd -MN [NombreUsuario] # sudo passwd [NombreUsuario]
Desde jupyterHUB activar la cuenta del nueve usuarie
[editar] acceso restringido a datos
Después de la creación de un grupo de acceso restringido de datos en Papa, para que un usuario tenga acceso a los archivos, necesita que:
1. El mismo grupo exista en Deimos con el mismo nombre y id de grupo
1. El usuario de jupyter-[NombreUsuarie]
esté asociado al grupo
Desde una ventana shell
de jupyter, se obtieene:
ls DatosABC ls: cannot open directory 'DatosABC': Permission denied
Agarramos el mismo grupo de ejemplo creado en Papa proy123
, id grupo: 123456
1. Comprobamos grupos pre-existentes
# getent group | grep proy123 # getent group | grep 123456
NOTA: Si el id de grupo ya existe en 'Deimos', se tendrá que cambiar el id del grupo en 'Papa' (y actualizar todos los archivos asociados) con las instrucciones (siguiendo Stack Overflow)
# groupmod -g [nuevoIDgrupo] proy123 # find / -gid [viejoIDgrupo] ! -type l -exec chgrp [nuevoIDgrupo] {} \;
1. Creación del grupo
# groupadd -g 123456 proy123
1. Asignación de usuaries
# usermod -aG proy123 jupyter-usuarieX # usermod -aG proy123 jupyter-usuarieY # usermod -aG proy123 jupyter-usuarieZ
1. Verificación
# getent group proy123 proy123:x:123456:jupyter-usuarieX,jupyter-usuarieY,jupyter-usuarieZ
[editar] Nota acerca 'flavor' archivos netCDF
Los archivos netCDF pueden tener distintos savores ('flavours' del Inglés), estos son: NETCDF3_CLASSIC, NETCDF3_64BIT_OFFSET, NETCDF3_64BIT_DATA, NETCDF4_CLASSIC y NETCDF4
Si bien las herramientas directas de la librería (ej.: ncdump, nccopy, nccreate, ...) no tienen problemas en abrir los archivos, sí que podemos encontrar problemas con la librería de python netCDF4
.
Al ejecutar una script desde el notebook, nos puede aparecer el siguiente mensaje de error:
(...) OSError Traceback (most recent call last) Cell In [1], line 246 244 ifile = 0 245 dtprev = 0 --> 246 oplnc = NetCDFFile(expplfiles[0], 'r') 247 oua = oplnc.variables['U_PL'] 248 ova = oplnc.variables['V_PL'] File src/netCDF4/_netCDF4.pyx:2470, in netCDF4._netCDF4.Dataset.__init__() File src/netCDF4/_netCDF4.pyx:2107, in netCDF4._netCDF4._ensure_nc_success() OSError: [Errno -101] NetCDF: HDF error: '/datos/MOD/EXPS/Inundaciones_RioGrandeSoul/sims/control/wrfpress_d01_2024-04-15_00:00:00'
Pero el archivo existe y tiene el formato:
$ file /datos/MOD/EXPS/Inundaciones_RioGrandeSoul/sims/control/wrfpress_d01_2024-04-15_00:00:00 /datos/MOD/EXPS/Inundaciones_RioGrandeSoul/sims/control/wrfpress_d01_2024-04-15_00:00:00: Hierarchical Data Format (version 5) data
Mientras que un archivo que netCDF4
no tiene problemas en abrir tiene el formato:
$ file /datos/MOD/analysis/ECMWF/ECMWF-AN_pl20240418-30.nc /datos/MOD/analysis/ECMWF/ECMWF-AN_pl20240418-30.nc: NetCDF Data Format data (64-bit offset)
Para poder cambiar el 'flavour' del archivo que da problemas, se puede utilizar la herramienta nccopy
que viene como parte de los programas binarios de las liberarías netCDF (cómo el ncdump
)
$ nccopy -k '64-bit offset' ./wrfout_d01_2024-04-15_00:00:00 ./wrfout_d01_2024-04-15_00:00:00.nc64
La extensión no es necesaria, sólo para poder crear un archivo nuevo
[editar] Añadir librerías/programario específico
En esta sección se detallan los pasos seguidos para instalar librerías y/o programario específico. Dichas librerías se tendrán que instalar para cada usuarie desde la sesión jupyter.
[editar] PyNCplot3
Librerías genéricas de Lluís Fita Borrell, CIMA PyNCplot
Des de una sesión bash
del jupyterHUB:
git clone -b numpy20 https://git.cima.fcen.uba.ar/lluis.fita/pyncplot.git PyNCplot3 cd PyNCplot3 ln -s Makefile.deimos-jupyterHub ./Makefile make all >& run_make.log ls *so module_ForDef.cpython-39-x86_64-linux-gnu.so module_ForDiag.cpython-39-x86_64-linux-gnu.so module_ForDistriCorrect.cpython-39-x86_64-linux-gnu.so module_ForGen.cpython-39-x86_64-linux-gnu.so module_ForInt.cpython-39-x86_64-linux-gnu.so module_ForSci.cpython-39-x86_64-linux-gnu.so
Después desde un directorio de trabajo del estudio concreto (e.j. EstudioXY12
) almacenado dentro del directrio estudios
del home del usuario de jupyteHUB. Desde la misma notebook de bash
cd mkdir -p estudios/EstudioXY12 cd estudios/EstudioXY12 /home/jupyter-[usuario_JupyterHUB]/PyNCplot3/link_essentials_PWD.bash
Ahora ya se puede abrir un notebook the python en el directorio estudios/EstudioXY12
(aparecerá en el home del juyterHUB del usuario) y poder utilizar sin problemas las scripts de PyNCplot
[editar] Digital Earths - Global Hackathon
En la semana del 13 al 16 de Mayo aconteció el la Digital Earths - Global Hackathon en la cuál el CIMA/IFAECI participó con la organización de un nodo en CABA. Para esa actividad fue necesaria la instalación de un entorno de python el cuál se hizo accesible para todes les usuaries de Deimos. Estos son los pasos seguidos:
First download the Hachkathon's repository as root in /opt/onda/mamba/DE-global_hackathon<CODE> (as root)
# git clone https://github.com/digital-earths-global-hackathon/tools.git
Go to directory with installation and make a copy for <CODE>deimos and edit the prefix
# cd tools/python_envs # cp install_python install_python_deimos diff install_python install_python_orig install_python install_python_orig 4c4,5 < prefix=${prefix:-$HOME/python_envs} --- > #prefix=${prefix:-$HOME/python_envs} > prefix=/opt/conda/mamba/DE-global_hackathon ./install_python_deimos ``` We got the right installation <PRE style="shell"> ls /opt/conda/mamba/DE-global_hackathon/ miniconda3 tools
Registering the new kernel jupyerhub-doc and multiple-kernels
# /opt/tljh/user/bin/jupyter kernelspec list Available kernels: python3 /opt/tljh/user/share/jupyter/kernels/python3 bash /usr/local/share/jupyter/kernels/bash ir /usr/local/share/jupyter/kernels/ir python_conda_su /usr/local/share/jupyter/kernels/python_conda_su # /opt/tljh/user/bin/jupyter-kernelspec remove python_conda_su Kernel specs to remove: python_conda_su /usr/local/share/jupyter/kernels/python_conda_su Remove 1 kernel specs [y/N]: y # /opt/tljh/user/bin/jupyter-kernelspec list Available kernels: python3 /opt/tljh/user/share/jupyter/kernels/python3 bash /usr/local/share/jupyter/kernels/bash ir /usr/local/share/jupyter/kernels/ir # /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba install ipykernel # /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy/bin/python3 -m ipykernel install Installed kernelspec python3 in /usr/local/share/jupyter/kernels/python3 # /opt/tljh/user/bin/jupyter-kernelspec install /usr/local/share/jupyter/kernels/python3 --name=python_DigEarth-Hack [InstallKernelSpec] Installed kernelspec python_digearth-hack in /usr/local/share/jupyter/kernels/python_digearth-hack # /opt/tljh/user/bin/jupyter-kernelspec list Available kernels: python3 /opt/tljh/user/share/jupyter/kernels/python3 bash /usr/local/share/jupyter/kernels/bash ir /usr/local/share/jupyter/kernels/ir python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack
Editing kernel name to be recognizible in jupyterHUB api and set-up environment (see stackoverflow)
# vim /usr/local/share/jupyter/kernels/python_digearth-hack/kernel.json "display_name": "Python 3 (D.E. Hachkathon)", "env": { "MAMBA_PREFIX":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy", "MAMBA_DEFAULT_ENV":"easy", "PATH":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy/bin:/opt/conda/mamba/DE-global_hackathon/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" },
[editar] Adding new packages/libraries to an existing environment
To add new libraries, using mamba (preferred way)
# /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba install -n easy pyflextrkr
Via pip
# cd /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/easy # bin/pip3 install healpy
[editar] ATRACKCS
El ATRACKCS Esta herramienta está diseñada para realizar seguimientos de sistemas atmosféricos. Estos son los pasos seguidos para su instalación en Deimos
Creando el enclave del paquete
# cd /opt/conda/mamba/ # mkdir ATRACKCS # cd ATRACKCS
Agarrando el software y preparando la instalación via la creación de un nuevo entorno de python
# git clone https://github.com/alramirezca/ATRACKCS # cd ATRACKCS # /opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba env create -f env_py3.yml
Activación del entorno y terminar la instalación
# eval "$(/opt/conda/mamba/DE-global_hackathon/miniconda3/bin/mamba shell hook --shell bash)" (base) # mamba activate atrackcs_py3 (atrackcs_py3) # pip install -e .
Registrando el nuevo kernel para deimos:
(atrackcs_py3) # pip3 install ipykernel (atrackcs_py3) # mamba deactivate (base) # mamba deactivate # /opt/tljh/user/bin/jupyter kernelspec list Available kernels: python3 /opt/tljh/user/share/jupyter/kernels/python3 bash /usr/local/share/jupyter/kernels/bash ir /usr/local/share/jupyter/kernels/ir python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack # /opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3/bin/python3 -m ipykernel install # /opt/tljh/user/bin/jupyter-kernelspec install /usr/local/share/jupyter/kernels/python3 --name=python_atrackcs # /opt/tljh/user/bin/jupyter-kernelspec list Available kernels: python3 /opt/tljh/user/share/jupyter/kernels/python3 bash /usr/local/share/jupyter/kernels/bash ir /usr/local/share/jupyter/kernels/ir python_atrackcs /usr/local/share/jupyter/kernels/python_atrackcs python_digearth-hack /usr/local/share/jupyter/kernels/python_digearth-hack
Editando el nombre del kernel para identificarlo desde deimos:
# vim /usr/local/share/jupyter/kernels/python_atrackcs/kernel.json "display_name": "Python 3 (atrackcs)", "env": { "MAMBA_PREFIX":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3", "MAMBA_DEFAULT_ENV":"atrackcs_py3", "PATH":"/opt/conda/mamba/DE-global_hackathon/miniconda3/envs/atrackcs_py3/bin:/opt/conda/mamba/DE-global_hackathon/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" },
[editar] ESMValTool
Herramientas para el análisis de datos CMIP. ESMValTool es una herramienta en python, abierta y desarrollada por la comunidad.
Los pasos para su instalación se detallan acá /ESMValToolInst.
El sistema papa-deimos, se pudo constituir en parte, gracias a fondos del INSU - LEFE