Openstack CLI access
Due to the use of EGI Check-in in the login process, access to the Openstack CLI is somewhat difficult. In a standard configuration, you would need a special RC file to set the environment variables (username and password among others).
In this case we will use the fedcloudclient package for Python. It allows you to invoke Openstack commands using a special access token obtained from EGI. You need only this token to access the resources.
This section explains how to obtain such a token and how to use Openstack with fedcloudclient.
1. Go to https://aai.egi.eu/fedcloud/ and log into your EGI account. Press the "Authorise" button.
2. Next, you need to authorize the application on the EGI account side.
3. After successful login, a window will appear with the curl command to copy.
4. Use it in your terminal to obtain an access token, which has a lifetime of 1 hour. It is worth noting the end of the command. We are calling python, so if necessary, we should change it to python3.
5. Copy the "access_token" value without the quotes. We will use this value to set the only needed environment variable OIDC_ACCESS_TOKEN, which is required by fedcloudclient.
6. Simply use the following pip3 command (should be done without root privileges).
$ pip3 install fedcloudclient
7. Verify that Fedcloud installation was successful.
8. You can also use a shell in a Docker container with fedcloudclient preinstalled
$ docker run -it --rm tdviet/fedcloudclient bash
root@d39d0fe05ee9:/# export OIDC_ACCESS_TOKEN=eyJ...KyQ
root@d39d0fe05ee9:/# fedcloud token check
Token is valid until 2022-03-30 11:37:30 UTC
Token expires in 3114 seconds