Skip to content

Commit

Permalink
Merge branch 'master' into 2.0-alpha1
Browse files Browse the repository at this point in the history
# Conflicts:
#	requirements.txt
  • Loading branch information
tdviet committed Oct 25, 2024
2 parents b18c34b + dbf0f03 commit 9b261f8
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 24 deletions.
8 changes: 3 additions & 5 deletions config/sites.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# List of sites in https://github.com/EGI-Federation/fedcloud-catchall-operations/tree/main/sites
# As GitHub API has limited access rates, the list of sites is stored here for simple access

- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/100IT.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/BIFI.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CENI.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CESGA.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CESGA-CLOUD.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CESNET-MCC.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CESNET-MCCG2.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CETA-GRID.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CLOUDIFIN.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CSTCLOUD-EGI.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/CYFRONET-CLOUD.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/DESY-CC.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/GRNET-OPENSTACK.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/GSI-LCG2.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/IFCA-LCG2.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/IISAS-FedCloud-cloud.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/ILIFU-UCT.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/IN2P3-IRES.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/INFN-CLOUD-BARI.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/INFN-CLOUD-CNAF.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/INFN-PADOVA-STACK.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/NCG-INGRID-PT.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/SCAI.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/TR-FC1-ULAKBIM.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/UA-BITP.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/UNIV-LILLE.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/UPV-GRyCAP.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/WALTON-CLOUD.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/fedcloud.srce.hr.yaml"
- "https://raw.githubusercontent.com/EGI-Federation/fedcloud-catchall-operations/main/sites/EODC.yaml"
Expand Down
8 changes: 7 additions & 1 deletion docs/cheat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,18 @@ Basic usages

$ fedcloud token list-vos

* List sites in EGI Federated Cloud:
* List sites in the EGI Federated Cloud:

::

$ fedcloud site list

* List all sites supporting a Virtual Organization in the EGI Federated Cloud:

::

$ fedcloud site list --vo vo.access.egi.eu

* Execute an OpenStack command:

::
Expand Down
12 changes: 11 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Basic usages
training.egi.eu
...

* List sites in EGI Federated Cloud
* List sites in the EGI Federated Cloud

::

Expand All @@ -53,6 +53,16 @@ Basic usages
CESGA
...

* List sites supporting a Virtual Organization in the EGI Federated Cloud

::

$ fedcloud site list --vo vo.access.egi.eu
BIFI
CENI
CESGA-CLOUD
...

* Execute an OpenStack command, e.g. list images in eosc-synergy.eu VO on IISAS-FedCloud site
(or other combination of site and VO you have access):

Expand Down
11 changes: 11 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,17 @@ VOs and so on.
...


* **"fedcloud site list --vo <VO-name>"** : List all sites supporting a Virtual Organization

::

$ fedcloud site vo-list --vo vo.access.egi.eu
BIFI
CENI
CESGA-CLOUD
...


* **"fedcloud site show --site <SITE>"** : Show configuration of the corresponding site.

::
Expand Down
9 changes: 9 additions & 0 deletions fedcloudclient/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ def wrapper(*args, **kwargs):
metavar="vo-name",
)

# Optional decorator for --vo
vo_params_optional = click.option(
"--vo",
help="Name of the VO",
required=False,
envvar="EGI_VO",
metavar="vo-name",
)


def site_vo_params(func):
"""
Expand Down
36 changes: 28 additions & 8 deletions fedcloudclient/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@
"title": "site specs",
"description": "site configuration schema",
"definitions": {
"imagesdata": {
"type": "object",
"properties": {
"sync": {
"type": "boolean",
"description": "Do image synchronisation",
"default": false
},
"formats": {
"type": "array",
"title": "formats",
"description": "Supported VM image formats at the site.",
"items": {
"type": "string"
}
}
},
"additionalProperties": false
},
"vodata": {
"type": "object",
"properties": {
Expand All @@ -22,17 +41,11 @@
}
}
},
"required": [
"auth",
"name"
],
"required": ["auth", "name"],
"additionalProperties": true
}
},
"required": [
"gocdb",
"endpoint"
],
"required": ["gocdb", "endpoint"],
"properties": {
"gocdb": {
"$id": "#/properties/gocdb",
Expand Down Expand Up @@ -70,6 +83,13 @@
"items": {
"$ref": "#/definitions/vodata"
}
},
"images": {
"$id": "#/properties/images",
"title": "Image Configuration",
"description": "Image configuration",
"type": "object",
"$ref": "#/definitions/imagesdata"
}
},
"additionalProperties": false
Expand Down
24 changes: 16 additions & 8 deletions fedcloudclient/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
all_site_params,
oidc_params,
site_vo_params,
vo_params_optional,
)
from fedcloudclient.shell import print_set_env_command

Expand Down Expand Up @@ -184,16 +185,22 @@ def delete_site_config(config_dir):
shutil.rmtree(config_dir, ignore_errors=True)


def list_sites():
def list_sites(vo=None):
"""
List of all sites IDs in site configurations
List all sites IDs in site configurations
Optionally list all sites supporting a Virtual Organization
:return: list of site IDs
"""
read_site_config()
result = []
for site_info in __site_config_data:
result.append(site_info["gocdb"])
if vo is None:
result.append(site_info["gocdb"])
else:
for vos in site_info["vos"]:
if vo == vos["name"]:
result.append(site_info["gocdb"])
return result


Expand Down Expand Up @@ -319,13 +326,14 @@ def save_config():


@site.command("list")
def list_():
@vo_params_optional
def list_(vo=None):
"""
List all sites
List all sites. If "--vo <name>" is provided, list only sites
supporting a Virtual Organization.
"""
read_site_config()
for site_info in __site_config_data:
print(site_info["gocdb"])
for site in list_sites(vo):
print(site)


@site.command()
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ setuptools==68.2.2
jsonschema==4.19.2
psutil==5.9.6
hvac==2.0.0
cryptography==41.0.5
cryptography==42.0.4

0 comments on commit 9b261f8

Please sign in to comment.