Access Morpheus portal

Login to the Morpheus portal according to the provided informations.

Reference:  Logging in to Morpheus

User Settings

As first step after login it is needed to finalize the setup of the user settings.

ssh keys settings

It is required to setup the Linux ssh public key by following the instructions in the page: Add your SSH key pair

the key will be uploaded to the provisioned Linux Virtual Machines and the user can connect to it via ssh.

In order to add your public key go under Menu→ Infrastructure → Trust and then press the +ADD button and alternatively:

  • select "Existing Key Pair" if you you have already your keys pairs (private and public keys) and you want just to upload your public key (only public key is needed)

or

  • Select "Generate Key Pair" if you want to let Morpheus to generate a key pair (private and public keys) for you. In this case save the generated private key.

In order to distinguish the keys from other users of the tenancy, assign the following name :  <your username>_key


Example for "Existing Key Pair" uploading:


Linux user settings

After setting up the key it is needed to finalize the setup of the Linux user settings by following the instructions in: Setting up your User Settings

Access the User Settings tab by clicking on the User in the top-right corner and then select "User Settings" :

Within the User Settings then configure the "Linux Settings" tab that is required for creating the user on the created virtual machines, set the defined password and set the public key (note that only ssh key authentication is allowed).

Pay attention to select and set the previously configured "ssh key" for your user (<your username>_key)

Provision a new instance (Linux Virtual Machine)

You can provision a new instance in accordance to the instructions on the page: Provision a new instance - web

Within this tutorial it is provisioned a Rocky Linux 9.2 virtual machine with the "rocky-9.2-data" layout that includes a set of preinstalled software.

Access the Menu→ Provisioning → Instances tab and click the +Add button

Select the Rocky Linux instance type

Configure the instance

Assign a name, environment and label:

Suggestions:

  • Name :  <your username>-vm
  • Environment: Test
  • Label: training

and then click NEXT.


Configure the VM version, layout, plan, network, security group :

  • Version : 9.2
  • Layout: rocky-9.2-data
  • Plan: 4cpu-4gbmem-30gbdisk
  • Networks: external-internet
  • Security Group: ssh-https 
  • Others: leave defaults

( A description of these fields can be find in the documentation page: Provision a new instance - web )

and then click NEXT.


Leave default setting for Automation, Backups and Lifecycle

and then click NEXT.


Review settings and complete

Review the settings and if everything is as expected then press Complete button to start the instance creation.


Monitor the deployment

From the Instances page it is possible to monitor the status of the VM creation.

and by clicking on the Instance it is possible to check more details about the progress. 


Deployment completed - Instance running

Once the deployment is finalized (typically after few minutes), the instance appears as Running (green icon)on the Morpheus interface:

and it is possible to check more details on the instance page:


Access to the created instance

According to the applied configuration, it was selected the "external-internet" network, which gives the VM a public IP to which is possible to connect directly via ssh.

The assigned public IP can be reviewed from the Morpheus interface:

once taken note of the public IP then it is possible to connect via ssh.

Note that only ssh key authentication is allowed (i.e. no password authentication for remote access)


Assuming you have an ssh-agent with your stored key then it would be enough:

ssh <your username>@<public IP>

otherwise you can specify your private key in the connection :

ssh -i ./path/to/private_key <your username>@<public IP>

S3 Object Storage

The European Weather Cloud offers the possibility to use a S3 Object Storage : Object storage: How to use s3cmd and s3fs

A common way to manage the S3 object storage is via the "s3cmd" command line tool that is pre-installed within the instance.

Configure s3cmd client

You will need to configure s3cmd before you can use it. The tool will read the configuration on ~/.s3cfg

Create the configuration file if it does not exist:

touch ~/.s3cfg

Edit the file and set up at least the following parameters (replace the fields with the provided endpoint and access/secret keys).

host_base = <endpoint>
host_bucket = 
access_key = <youraccesskey>
secret_key = <yoursecretkey> 
use_https = True


Retrieve a file from S3 Object Storage

The following instructions explain how to list the files within the bucket and retrieve the file locally using the "s3cmd" tool. 

1) List files in the existing bucket:

s3cmd ls s3://mybucket/

2)  Retrieve file from the S3 bucket locally:

s3cmd get s3://mybucket/file.grb

3) Verify the file has been copied locally:

ls -l file.grb

Explore the created ECMWF "data layout" instance 

The ECMWF data layout instance comes with a basic set of pre-installed tool that allows users to start retrieving and working with the ECMWF data on the cloud.

Specifically the ECMWF data layouts include:

  • a MARS client with an optimized data access, similarly of what present on the ECMWF HPCF
  • a pre-installed conda environment with main ECMWF packages (e.g. ecCodes) 

General overview

Verify your user has sudo rights

In order to get sudo rights you'll need to insert the password configured under the "Linux Settings" section of the "User Settings".

[traininguser@traininguser-vm ~]$ sudo -i

We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

[sudo] password for traininguser: 
[root@traininguser-vm ~]# 


Verify your VM cpu and ram resources

You can verify that your VM has 4 processors according to the selected plan.

[root@traininguser-vm ~]# cat /proc/cpuinfo | grep -E '^processor' 
processor	: 0
processor	: 1
processor	: 2
processor	: 3

You can verify that the VM has 4GB RAM according to the selected plan.

[root@traininguser-vm ~]# cat /proc/meminfo | grep -E '^MemTotal'
MemTotal:        4011760 kB


Verify your VM disk space

Verify the Disk space is 30GB according to the selected plan.

[root@traininguser-vm ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        4.0M     0  4.0M   0% /dev
tmpfs           2.0G     0  2.0G   0% /dev/shm
tmpfs           784M  8.6M  776M   2% /run
/dev/vda1        29G  5.1G   22G  19% /
tmpfs           392M     0  392M   0% /run/user/1000

Test a new system package installation

[root@traininguser-vm ~]# dnf install htop
Last metadata expiration check: 4:08:03 ago on Mon Oct 30 12:29:56 2023.
Dependencies resolved.
=====================================================================================================================================
 Package                      Architecture                   Version                              Repository                    Size
=====================================================================================================================================
Installing:
 htop                         x86_64                         3.2.2-1.el9                          epel                         183 k

Transaction Summary
=====================================================================================================================================
Install  1 Package

Total download size: 183 k
Installed size: 440 k
Is this ok [y/N]: y
Downloading Packages:
htop-3.2.2-1.el9.x86_64.rpm                                                                          1.6 MB/s | 183 kB     00:00    
-------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                1.5 MB/s | 183 kB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                             1/1 
  Installing       : htop-3.2.2-1.el9.x86_64                                                                                     1/1 
  Running scriptlet: htop-3.2.2-1.el9.x86_64                                                                                     1/1 
  Verifying        : htop-3.2.2-1.el9.x86_64                                                                                     1/1 

Installed:
  htop-3.2.2-1.el9.x86_64                                                                                                            

Complete!


Run the "htop" command provided by the just installed package:

[root@traininguser-vm ~]# htop


Exit from "htop" view (ctrl+c or F10).

If still impersonating "root", return to the normal user:

[root@trainingadmin-vm ~]# exit
logout
[tenantadmin@trainingadmin-vm ~]$


Configure your MARS client

The "data" layout includes the MARS client that just needs to be configured to start retrieving data from the archive.

The configuration steps are described in the Knowledge Base dedicated page .

Configure the email and token

  1. In your web browser...
    1. Go to https://apps.ecmwf.int/v1/key
    2. Log in with your ECMWF user and password if you are not logged int already
    3. Copy the contents of .ecmwfapirc, containing your email address and key.
  2.  In your VM, create a file in your home directory called ~/.ecmwfapirc and paste the contents previously copied from the web.


Run a sample MARS retrieval

Create a text file "mars_request.req" containing your request:

[traininguser@traininguser-vm ~]$ cat <<EOF >mars_request.req
retrieve,
   class    = od,
   stream   = oper,
   type     = an, 
   expver   = 1,
   date     = 20231015,
   time     = 12,
   param    = 130.128, 
   levtype  = pressure level,
   levelist = 1000/850/700/500,
   target   = "output.grb"
EOF


then submit the request as follows :

$ mars mars_request.req
[traininguser@traininguser-vm ~]$ mars mars_request.req 
mars - INFO   - 20231030.165705 - Welcome to MARS
mars - INFO   - 20231030.165705 - MARS_HOME=/home/traininguser/.marsrc/home
mars - INFO   - 20231030.165705 - MARS Client build stamp: FEATURE
mars - INFO   - 20231030.165705 - MARS Client bundle version: 6.33.15.6
mars - INFO   - 20231030.165705 - MARS Client version: 0
mars - INFO   - 20231030.165705 - package mars-client version: 6.33.15
mars - INFO   - 20231030.165705 - package mir version: 1.16.5
mars - INFO   - 20231030.165705 - package odc version: 1.4.6
mars - INFO   - 20231030.165705 - package fdb version: 5.11.11
mars - INFO   - 20231030.165705 - package metkit version: 1.10.8
mars - INFO   - 20231030.165705 - package eckit version: 1.23.0
mars - INFO   - 20231030.165705 - package eccodes version: 2.30.1
retrieve,
    class    = od,
    stream   = oper,
    type     = an,
    expver   = 1,
    date     = 20231015,
    time     = 12,
    param    = 130.128, 
    levtype  = pressure level,
    levelist = 1000/850/700/500,
    target   = "output.grb"

mars - INFO   - 20231030.165705 - Processing request 1

RETRIEVE,
    CLASS      = OD,
    TYPE       = AN,
    STREAM     = OPER,
    EXPVER     = 0001,
    REPRES     = SH,
    LEVTYPE    = PL,
    LEVELIST   = 1000/850/700/500,
    PARAM      = 130.128,
    DATE       = 20231015,
    TIME       = 1200,
    STEP       = 00,
    DOMAIN     = G,
    TARGET     = "output.grb"

mars - INFO   - 20231030.165705 - Requesting 4 fields
mars - INFO   - 20231030.165705 - Calling mars on 'fdbprod.ecmwf.int', local port is 46569
mars - INFO   - 20231030.165705 - Callback at address 136.156.138.60, port 46569
mars - INFO   - 20231030.165705 - Mars client is on traininguser-vm.novalocal (136.156.138.60) 46569
mars - INFO   - 20231030.165705 - Mars server is on aa6-210.ecmwf.int (10.100.64.210) 55519
mars - INFO   - 20231030.165705 - Server task is 303 [ATOS FDB]
mars - INFO   - 20231030.165705 - Retrieving from FDB [ATOS FDB]
mars - INFO   - 20231030.165705 - Looking up FDB indexes: 0.002971 second elapsed, 0.00248 second cpu [ATOS FDB]
mars - INFO   - 20231030.165705 - Calling mars on 'fdbbc.ecmwf.int', local port is 51019
mars - INFO   - 20231030.165705 - Callback at address 136.156.138.60, port 51019
mars - INFO   - 20231030.165705 - Mars client is on traininguser-vm.novalocal (136.156.138.60) 51019
mars - INFO   - 20231030.165705 - Mars server is on aa6-211.ecmwf.int (10.100.64.211) 51077
mars - INFO   - 20231030.165705 - Server task is 930 [ATOS FDB BC]
mars - INFO   - 20231030.165705 - Retrieving from FDB [ATOS FDB BC]
mars - INFO   - 20231030.165705 - Looking up FDB indexes: 0.000602 second elapsed, 0.000596 second cpu [ATOS FDB BC]
mars - INFO   - 20231030.165705 - Calling mars on 'marsod.ecmwf.int', local port is 38507
mars - INFO   - 20231030.165705 - Callback at address 136.156.138.60, port 38507
mars - INFO   - 20231030.165706 - Mars client is on traininguser-vm.novalocal (136.156.138.60) 38507
mars - INFO   - 20231030.165706 - Mars server is on bods2-ab1404.ecmwf.int (10.112.5.10) 42348
mars - INFO   - 20231030.165706 - Server task is 609 [marsod]
mars - INFO   - 20231030.165706 - Request cost: 4 fields, 12.5137 Mbytes online, nodes: mvr005 [marsod]
mars - INFO   - 20231030.165706 - The efficiency of your requests in the last 12 hours is 100% [marsod]
mars - INFO   - 20231030.165706 - Transfering 13121592 bytes
mars - INFO   - 20231030.165707 - 4 fields retrieved from 'marsod'
mars - INFO   - 20231030.165707 - Request time:  wall: 1 sec 
mars - INFO   - 20231030.165707 -   Visiting marsod: wall: 1 sec 
mars - INFO   - 20231030.165707 -   Read from network: 12.51 Mbyte(s) in < 1 sec [34.34 Mbyte/sec] 
mars - INFO   - 20231030.165707 -   Writing to target file: 12.51 Mbyte(s) in < 1 sec [1.44 Gbyte/sec] 
mars - INFO   - 20231030.165707 - Memory used: 45.12 Mbyte(s)
mars - INFO   - 20231030.165707 - No errors reported

Test conda environment and pre-installed packages

Activate base conda environment

[traininguser@traininguser-vm ~]$ conda activate
(base) [traininguser@traininguser-vm ~]$

List available packages within the conda environment

[traininguser@traininguser-vm ~]$ conda list
# packages in environment at /opt/conda:
#
# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                 conda_forge    conda-forge
_openmp_mutex             4.5                       2_gnu    conda-forge
alsa-lib                  1.2.10               hd590300_0    conda-forge
attr                      2.5.1                h166bdaf_1    conda-forge
bison                     3.8.2                h59595ed_0    conda-forge
blosc                     1.21.5               h0f2a231_0    conda-forge
boltons                   23.0.0             pyhd8ed1ab_0    conda-forge
boto3                     1.28.73                  pypi_0    pypi
botocore                  1.31.73                  pypi_0    pypi
brotli-python             1.1.0           py310hc6cd4ac_0    conda-forge
bzip2                     1.0.8                h7f98852_4    conda-forge
c-ares                    1.19.1               hd590300_0    conda-forge
ca-certificates           2023.7.22            hbcca054_0    conda-forge

.....


Test ecCodes available in the pre-installed conda 

Test ecCodes is installed by checking the number of messages contained in the grib file downloaded in the previous MARS exercise.

First activate base conda environment:

[traininguser@traininguser-vm ~]$ conda activate
(base) [traininguser@traininguser-vm ~]$

then use the "grib_ls" command provided by ecCodes:

(base) [traininguser@traininguser-vm ~]$ grib_ls output.grb 
output.grb
edition      centre       typeOfLevel  level        dataDate     stepRange    dataType     shortName    packingType  gridType     
1            ecmf         isobaricInhPa  1000         20231015     0            an           t            spectral_complex  sh          
1            ecmf         isobaricInhPa  850          20231015     0            an           t            spectral_complex  sh          
1            ecmf         isobaricInhPa  700          20231015     0            an           t            spectral_complex  sh          
1            ecmf         isobaricInhPa  500          20231015     0            an           t            spectral_complex  sh          
4 of 4 messages in output.grb

4 of 4 total messages in 1 files

Delete the provisioned instance

Once reached the end of the tutorial you can delete the provisioned instance.

You can access the instance page and then press the button "DELETE".


You will be asked to confirm the operation. After confirming, it will start the deletion process.