EGI FedCloud client
Project description
FedCloud client: Command-line client and library for EGI Federated Cloud
TL;DR: Visit the cheat sheet for real examples of fedcloud commands.
The FedCloud client is a high-level Python package for a command-line client designed for interaction with the OpenStack services in the EGI infrastructure. The client can access various EGI services and can perform many tasks for users including managing access tokens, listing services, and mainly execute commands on OpenStack sites in EGI infrastructure.
The most notable features of FedCloud client are following:
-
have wide ranges of useful commands, including checking access token, searching for services, listing sites and VOs, and interaction with OpenStack sites.
-
can perform any OpenStack command on any sites with only three parameters: the site, the VO and the command. For example, to list virtual machines (VM) images available to members of VO fedcloud.egi.eu on the site CYFRONET-CLOUD, run the following command:
fedcloud openstack image list --vo fedcloud.egi.eu --site CYFRONET-CLOUD
-
can perform an action/command on all OpenStack sites in EGI infrastructure by specifying
--site ALL_SITES
. -
can be used in scripts for automation or called directly from Python codes.
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 for managing site configurations, fedcloudclient.openstack for performing OpenStack operations on sites, 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 EGI Check-in Token Portal, 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
-
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 byoidc-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 commandcat /proc/sys/kernel/random/entropy_avail
, and if the result is lower than 300, consider installinghaveged
orrng-tools
to increase entropy. On VMs with CentOS, you also have to start the daemon manually after installation (or reboot the VMs) -
The
fedcloud
client fails with error messageSSL 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
-
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 executefedcloud 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.
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
Built Distribution
File details
Details for the file fedcloudclient-1.4.4.tar.gz
.
File metadata
- Download URL: fedcloudclient-1.4.4.tar.gz
- Upload date:
- Size: 62.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a47ef565e73d8c9a2ec5d83c4f41e8e0b662f42ffd83f9e2a5eb12e3f7856687 |
|
MD5 | 5675a2d760a23777fb4f4b409dd92f25 |
|
BLAKE2b-256 | 440ebc0173bc61a2da621f055a88ff9375f5827f62e723dbc30a75aa7e965f14 |
File details
Details for the file fedcloudclient-1.4.4-py3-none-any.whl
.
File metadata
- Download URL: fedcloudclient-1.4.4-py3-none-any.whl
- Upload date:
- Size: 32.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 296725f982d14fbfeadec74adc62bbdcb78ff6d495bdeadd974b0ada9b777d9d |
|
MD5 | f999181a83e078bb9fc20dc0438eec8d |
|
BLAKE2b-256 | 90cb4bf18703a296a7d5b118685822ee44c782b20b701839f957c46d05b26f27 |