freva_plugin_workshop_2021.04.15

Material that will be used / shown in the workshop

In our workshop's gitlab repository we have placed some projects:

  1. a plugin called wetdry: it will be used as a showcase in the hands-on. It's a functional plugin straight away. It has a docs/ folder with jupyternotebook files where each part of the plugin is commented almost line-by-line. It will be run by the users. The repository is this one.
  2. a plugin called wetdry_debug: a modified version of the previous one. Is incomplete, it has some bugs. It will be used to explore it by the users, test it and run it. The repository is this one.
  3. a plugin called wetdry_plus: a more complex version of the wetdry plugin with added capabilities, like input from databrowser and incall to other freva plugins. It will not be shown. The repository is this one.

In order to follow the hands-on you will need to download them and place them somewhere where the evaluation system (i.e. XCES) will be able to see them.

To look and execute the code we can do it via the shell terminal or via DKRZ's jupyterhub.

Steps for downloading the plugins

First thing we will go to (e.g.) our /home directory and create a folder that will contain these projects:

$ cd ~
$ mkdir plugin-workshop
$ cd plugin-workshop/

Now, we will download the repositories. To download a git repository there 3 ways:

  1. download it. You can download it in different formats (zip, tar, etc.) but it will be downloaded to your local folder (your pc's folder) and then you will need to move it to your DKRZ's /home directory anyway.
  2. clone it via https. Advantage: straightforward. Disadvantage: need to type <username> and <password> everytime.
  3. clone it via ssh. Advantage: no need to type <username> and <password> everytime. Disadvantage: you previously need an ssh key for that. This will be shown in the workshop.



Currently, we will use the most straightforward way, i.e., via https, for that we only need to copy the address (e.g. wetdry) and (in your newly created folder) follow the instructions entering your username and password:

$ pwd
/path/to/your/plugin/folder/
$ git clone https://gitlab.dkrz.de/freva/plugins4freva/plugin_workshop/wetdry.git
Cloning into 'wetdry'...
 
Username for 'https://gitlab.dkrz.de': <username>
 
Password for 'https://<username>@gitlab.dkrz.de': 
remote: Enumerating objects: 83, done.
remote: Counting objects: 100% (83/83), done.
remote: Compressing objects: 100% (65/65), done.
remote: Total 83 (delta 26), reused 51 (delta 15), pack-reused 0
Unpacking objects: 100% (83/83), 21.77 KiB | 14.00 KiB/s, done.

Now we can go to our plugin and look its contents:

$ cd wetdry
$ tree
.
|-- README.md
|-- software
|   |-- getsoftware4wetdry
|   `-- getsoftware4wetdry-TEMPLATE
|-- src
|   |-- wetdry_plotter.py
|   |-- wetdry_script.sh
|   `-- wetdry_wrapper.py
`-- test
    `-- test.sh
 
3 directories, 7 files



For the workshop we will need to do this 2 times, for wetdry and wetdry_debug so we finally have something like:

$ cd /path/to/your/plugin/folder/
$ ls
wetdry/ wetdry_debug/



We left the wetdry_plus so the users can navigate and compare it with wetdry. We also encourage you to explore it and run it.




Theory (1st Block)


PPT material for the plugin part: plugin_presentation.pptx. It has additional information on how to clone a repository via SSH and how to create a project (these will eventually also be added in the wikipage).



Hands-on (2nd Block)


PPT material of the plugin architecture: plugin_hands-on.pptx


  • freva_plugin_workshop_2021.04.15.txt
  • Last modified: 2021/11/11 14:05
  • by etorma