This repository contains python clients to produce statistics that can be used by EGI Foundation team to identify trends and monitor progress following the Objectives and Key Results (OKRs) goal-setting framework.
- Cloud CPU/h consumed by the production VOs of EGI
- HTC CPU/h consumed by the production VOs of EGI
- Num. of 'Registered', 'Total' and 'Active' users of the production
- Registered users = Number of users registered into the registries (VOMS, COManage, Perun) not necessarily active.
- Total users = Number of users registered in the DB since the 1st. capture for a given VO.
- VOs registered in the EGI Operations Portal
- Num. of VOs registered in the EGI Operations Portal (in progress)
- Num. of Service Orders (SOs) received from the EOSC Marketplace
The statistics generated by these python clients will be pushed in a Google Worksheet using the gspread APIs
Python 3.10.12+
installed on your local computer- Install pip3:
apt-get install -y python3-pip
- Install gspread API:
sudo pip3 install gspread
- Install venv:
sudo apt install -y python3-venv
In order to read from and write data to Google Sheets in Python, we will have to create a Google Service Account.
Instructions to create a Google Service Account are the following:
- Head over to Google developer console
- Click on Create Project to create a new project
- Fill in the required fields and click on Create
- From the APIs & Services menu, click on Enable API and Services
- Search for "Google Drive API" and click on Enable
- Search for the "Google Sheets API" and click on Enable
- From the APIs & Services menu, click on Credentials
- From the "Credentials" menu, click on Create Credentials to create a new credentials account
- From the Credentials account, select Service Account
- Fill in the web form providing the name of the Service account name and click on "Create" and Continue
- Skip the step 3 to grant users access to this service account
- Click on Done
- Once the Service Account has been created, click on Keys and click on "Add new Keys" and select JSON
- The credentials will be created and downloaded as a JSON file
- Copy the JSON file to your code directory and rename it to
credentials.json
- Grant Edit rights to the Service Account in the Google Spread-sheet
Use virtualenv to configure the working environment:
]$ virtualenv -p /usr/bin/python3.10 venv
created virtual environment CPython3.10.12.final.0-64 in 1748ms
[..]
]$ source venv/bin/activate
Install the library gspread
with pip3:
]$ pip3 install gspread
[..]
This GitHub repository includes clients to generate:
- The HTC and Cloud CPU/h of the production VOs of the EGI Federation
- The SLA HTC and Cloud CPU/h of the production VOs of the EGI Federation
- The number of users in the production VOs of the EGI Federation
- The number of Services Orders (SOs) received throught the EOSC Marketplace
- Report of the VOs created/leaving the EGI Operations Portal