Welcome to the Ersilia Maintenance repository! This project contains automated workflows and scripts to ensure the smooth operation and upkeep of the Ersilia Model Hub. It runs cron job to select models from Ersilia Model Hub and run inspection. It automatically creates issue when error happens during the inspection.
The inspect_model.yml
file defines the GitHub action responsible for running the inspections. The workflow performs several checks on each repository and reports the results. If a check fails, an issue is created with the details.
inspect_model.yml
: Defines the GitHub Actions workflow.inspect.sh
: Shell script that runs the inspection process.extract.py
: Processes the inspection results.repo_info.json
: Contains metadata about the repositories.fetch_repos.yml
: GitHub Actions workflow to fetch and update repository data.
To add additional checks, update the following files:
publish/test.py
: Create the new check function.commands/test.py
: Call the new function and store the results.inspect_model.yml
: Access the results and report them.
The repo_info.json
file contains a list of all repositories in the Ersilia organization. It stores the last time each repository was checked and updated.
fetch_repos.py
: Initializesrepo_info.json
and uodate with repository data.update_repo_doc.py: Updates
repo_info.json` with the latest repository information.pick_repo.py
: Selects the next repository to inspect. If the repos are updated and no models need to be inspected, it randomly select one model fromcommon_files.json
, a collection of commonly used models by the community.inspect.sh
: Runs the inspection process for a selected repository.fetch_repos.yml
: Fetches and updates repository data periodically.
The inspect_model.yml
workflow is responsible for inspecting the repositories in the Ersilia Model Hub. It performs the following steps:
- Determine Model to Inspect:
- If a
MODEL_ID
is provided, it uses that. Otherwise, it runs thepick_repo.py
script to select a repository.
- If a
- Run Inspection:
- Executes the
inspect.sh
script to run the inspection process.
- Executes the
- Process Results:
- Runs the
extract.py
script to process the inspection results and create GitHub issues for any failed checks.
- Runs the
- Update Repository Information:
- Updates the
repo_info.json
file with the current timestamp for the inspected repository.
- Updates the
The fetch_repos.yml
workflow is responsible for fetching and updating repository data periodically. It performs the following steps:
- Fetch Repository Data:
- Runs the
fetch_repos.py
script to initialize therepo_info.json
file with repository data as well as used in the workflow to sync the lastes repo data. - Runs the
update_repo_doc.py
script to update therepo_info.json
file with the latest repository information.
- Runs the
- Commit and Push Changes:
- Commits the updated
repo_info.json
file and pushes the changes back to the repository.
- Commits the updated
The inspect.sh
script is responsible for running the inspection process for a selected repository. It performs the following steps:
- Set Up Environment:
- Sets up the necessary environment variables and configurations.
- Run Inspection Command:
- Executes the
ersilia test
command to inspect the model repository. This steps including fetching models and run several inspection on them.
- Executes the
- Save Results:
- Saves the inspection results to a file named
result.txt
. Usingextract.py
, the result inresult.txt
will be coverted to json file which has structure as below:
If the status is{ "Is Github Url Available": { "Status": true, "Details": "Is Github Url Available Repository exists.Details" }, "Complete Metadata": { "Status": true, "Details": "Complete Metadata Details Metadata is complete." }, ... }
False
for one of the checks, it create an issue using theDetails
section. - Saves the inspection results to a file named
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.