Package: fedcloudclient
FedCloud client: Command-line client and library for EGI Federated CloudTL;DR: Visit thecheat sheetfor real examples of
fedcloud commands.TheFedCloud clientis 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:fedcloudopenstackimagelist--vofedcloud.egi.eu--siteCYFRONET-CLOUDcan perform an action/command on all OpenStack sites in EGI infrastructure by specifying--site ALL_SITES.can be used inscripts for automationor called directly
fromPython codes.Five modules are included:fedcloudclient.checkinfor operation with EGI Check-in like getting tokens,fedcloudclient.endpointfor searching endpoints via GOCDB, getting unscoped/scoped token from OpenStack keystone,fedcloudclient.sitesfor managing site configurations,fedcloudclient.openstackfor performing OpenStack
operations on sites, and finallyfedcloudclient.ec3for deploying elastic computing clusters in Cloud.A short tutorial of the fedcloudclient is available in thispresentation.
The full documentation, including installation, usage and API description is available
athttps://fedcloudclient.fedcloud.eu/.Quick startInstall FedCloud client viapip:pip3installfedcloudclientor use Docker container:dockerrun-ittdviet/fedcloudclientbashGet a new access token from EGI Check-in according to instructions fromEGI Check-in Token Portal, or fromoidc-agentand set environment variable.exportOIDC_ACCESS_TOKEN=<ACCESS_TOKEN>Check the expiration time of the access token usingfedcloudcommand:fedcloudtokencheckList the VO memberships of the access token:fedcloudtokenlist-vosList the OpenStack sites available in EGI Federated Cloud. That may take few seconds because all site configurations
are retrieved fromGitHub repositoryfedcloudsitelistSave the site configuration to local machine at~/.config/fedcloud/site-config/to speed up the client's start in the next time:fedcloudsitesave-configExecute 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):fedcloudopenstackimagelist--siteCYFRONET-CLOUD--vofedcloud.egi.euExecute an OpenStack command on all sites, e.g. list VMs in eosc-synergy.eu VO on all OpenStack sites in EGI Federated
Cloudfedcloudopenstackserverlist--siteALL_SITES--voeosc-synergy.euLearn more commands offedcloudclient and experiment with them:fedcloud--help
fedcloudsite--helpRead theQuick startfor more information about customizations and advanced usages.Using fedcloudclient as development libraryAll functionalities offered by thefedcloudclient 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:fromfedcloudclient.openstackimportfedcloud_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 athttps://fedcloudclient.fedcloud.eu/.FAQThefedcloudclient is slow.Execute commandfedcloud site save-configto download site configurations fromGitHub repositoryand 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 operationslibsodiumwhich is used byoidc-agentPython library may be frozen at initialization on VMs with low entropy. The
problem is describedhere. Check the entropy on the VMs by executing
commandcat /proc/sys/kernel/random/entropy_avail, and if the result is lower than 300, consider installinghavegedorrng-toolsto increase entropy. On VMs with CentOS, you also have to start the daemon manually after installation
(or reboot the VMs)Thefedcloudclient 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, sofedcloudclient cannot verify them. Follow thisinstructionto installEGI Core Trust Anchorand 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 fromthis repositoryThefedcloudclient fails with error message"VO XX not found on site YY", but they do exist.Site configurations atGitHub repositorymay 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_TOKENto find project IDs of the VOs on the site
and add the VOs to local site configuration on your machine manually.