Skip to main content

EGI FedCloud client

Project description

FedCloud client: Command-line client and library for EGI Federated Cloud

DOI

fedcloudclient is a command-line client and high-level Python package for interaction with EGI Federated Cloud. The aim here was to create a simple client which would allow users to perform the various OpenStack operations in EGI Federated Cloud. Performing any OpenStack command on any site requires only three options: site, VO and the command. For example:

  • Listing images in fedcloud.egi.eu VO on CYFRONET-CLOUD site:

    fedcloud openstack image list --vo fedcloud.egi.eu --site CYFRONET-CLOUD
    
  • Listing all VMs in eosc-synergy.eu VO on all sites in EGI Federated Cloud

    fedcloud openstack server list --vo eosc-synergy.eu --site ALL_SITES
    

Five modules are included: fedcloudclient.checkin for operation with EGI Check-in like getting tokens, ** fedcloudclient.endpoint** for searching endpoints via GOCDB, getting unscoped/scoped token from OpenStack keystone, ** fedcloudclient.sites** manages site configuration, fedcloudclient.openstack for performing OpenStack operations, and finally fedcloudclient.ec3 for deploying elastic computing clusters in Cloud.

A short tutorial of the fedcloudclient is available in this presentation.

The full documentation, including installation, usage and API description is available at https://fedcloudclient.fedcloud.eu/.

Quick start

  • Install FedCloud client via pip:

    pip3 install fedcloudclient
    

    or use Docker container:

    docker run -it  tdviet/fedcloudclient bash
    
  • Get a new access token from EGI Check-in according to instructions from FedCloud Check-in client, or from oidc-agent and set environment variable.

    export OIDC_ACCESS_TOKEN=<ACCESS_TOKEN>
    
  • Check the expiration time of the access token using fedcloud command:

    fedcloud token check
    
  • List the VO memberships of the access token:

    fedcloud token list-vos
    
  • List the OpenStack sites available in EGI Federated Cloud. That may take few seconds because all site configurations are retrieved from GitHub repository

    fedcloud site list
    
  • Save the site configuration to local machine at ~/.config/fedcloud/site-config/ to speed up the client's start in the next time:

    fedcloud site save-config
    
  • Execute an OpenStack command, e.g. list images in fedcloud.egi.eu VO on CYFRONET-CLOUD site (or other combination of site and VO you have access):

    fedcloud openstack image list --site CYFRONET-CLOUD --vo fedcloud.egi.eu
    
  • Execute an OpenStack command on all sites, e.g. list VMs in eosc-synergy.eu VO on all OpenStack sites in EGI Federated Cloud

    fedcloud openstack server list --site ALL_SITES --vo eosc-synergy.eu
    
  • Learn more commands of fedcloud client and experiment with them:

    fedcloud --help
    fedcloud site --help
    
  • Read the Quick start for more information about customizations and advanced usages.

Using fedcloudclient as development library

All functionalities offered by the fedcloud client can be used as a library for development of other tools and services for EGI Federated Cloud. For example, performing openstack command as a function in Python:

from fedcloudclient.openstack import fedcloud_openstack

....
error_code, result = fedcloud_openstack(oidc_access_token,
                                        site,
                                        vo,
                                        openstack_command)

See a working example "demo.py". The documentation of fedcloudclient API is available at https://fedcloudclient.fedcloud.eu/.

FAQ

  1. The fedcloud client is slow.

    Execute command fedcloud site save-config to download site configurations from GitHub repository and save them on a local machine. That will significantly speed up site configurations loading.

    Some sites in the repository may not respond, and client has to wait for long time before report "Connection time out". You can remove the sites from your local repository to speed-up all-sites operations

    libsodium which is used by oidc-agent Python library may be frozen at initialization on VMs with low entropy. The problem is described here. Check the entropy on the VMs by executing command cat /proc/sys/kernel/random/entropy_avail, and if the result is lower than 300, consider installing haveged or rng-tools to increase entropy. On VMs with CentOS, you also have to start the daemon manually after installation (or reboot the VMs)

  2. The fedcloud client fails with error message SSL exception connecting to <https://> ... when attempts to interact with some sites.

    Some sites use certificates issued by national grid CAs that are not included in default distribution, so fedcloud client cannot verify them. Follow this instruction to install EGI Core Trust Anchor and add certificates to Python request certificate bundle.

    In the case of using virtual environment for quick test, you can download and import bundle certificates by using the script from this repository

  3. The fedcloud client fails with error message "VO XX not found on site YY", but they do exist.

    Site configurations at GitHub repository may be incomplete. Check the site configurations stored in ~/.config/fedcloud/site-config/ if the VOs are included. If not, you can ask site admins to fix site configuration. You can also execute fedcloud endpoint projects --site SITE --oidc-access-token ACCESS_TOKEN to find project IDs of the VOs on the site and add the VOs to local site configuration on your machine manually.

  4. I would like to add supports for additional sites/VOs/identity providers that are not parts of EGI Federated Cloud.

    Other identity providers may be specified via option --oidc-url or environment variable CHECKIN_OIDC_URL. Additional sites and VOs may be added to local site configuration files.

  5. Why there are so many options for authentication: access token, refresh token, and oidc-agent? Which one should be used?

    Cloud operations need only access tokens, not refresh tokens. Access tokens have short lifetime (one hour in EGI Check-in), so they have lower security constraints. However, they have to be refreshed frequently, that may be inconvenient for some users.

    If a refresh token is given as parameter to fedcloud client (together with client ID and client secret), an access token will be generated on the fly from the refresh token and client ID/secret. However, using unencrypted refresh tokens is considered as insecure and will be removed in future versions in favor of oidc-agent.

    oidc-agent stores the refresh token securely and will automatically generate a new access token when the current one expires, so that is the recommended way to provide access token to fedcloudclient

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fedcloudclient-1.2.9.tar.gz (53.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fedcloudclient-1.2.9-py3-none-any.whl (24.2 kB view details)

Uploaded Python 3

File details

Details for the file fedcloudclient-1.2.9.tar.gz.

File metadata

  • Download URL: fedcloudclient-1.2.9.tar.gz
  • Upload date:
  • Size: 53.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for fedcloudclient-1.2.9.tar.gz
Algorithm Hash digest
SHA256 f930a55248c7cd859e16c8d01780f6c0c8f616a2c620a9758a4971aafbf000ee
MD5 82377baef90cef8c95de7771ff4d1037
BLAKE2b-256 e46a9c1d55c886f40530b51e148a952fc90990456b74be632b4eb6b5b6180046

See more details on using hashes here.

File details

Details for the file fedcloudclient-1.2.9-py3-none-any.whl.

File metadata

  • Download URL: fedcloudclient-1.2.9-py3-none-any.whl
  • Upload date:
  • Size: 24.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6

File hashes

Hashes for fedcloudclient-1.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c430fbe0e2f62e3e9dba12d5ecac3dee2f7fe9cf20bf1300308be7d5fff5cb96
MD5 8231e5b97808f598cf8e6125a2861e37
BLAKE2b-256 6413ba1396e768cef66ba637db00acadabc34784fa6b696250ca8da1baf45203

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page