Skip to content

Commit

Permalink
utils.py with function to get repositories for given hpc
Browse files Browse the repository at this point in the history
  • Loading branch information
fbaig committed May 15, 2024
1 parent 64e3c83 commit 18f9f6d
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tools/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import urllib.request, json

CYBERGIS_COMPUTE_SERVER='https://cgjobsup.cigi.illinois.edu/v2/git'

def get_model_repos_for_hpc(hpc_name:str) -> list[str]:
git_repos = []
with urllib.request.urlopen(CYBERGIS_COMPUTE_SERVER) as url:
data = json.load(url)
print(len(data['git']))
for model, value in data['git'].items():
if hpc_name in value['supported_hpc']:
git_repos.append(value["repository"])
pass
pass
pass
return git_repos

if __name__ == '__main__':
repos = get_model_repos_for_hpc(hpc_name='anvil_community')
for r in repos:
print(r)

0 comments on commit 18f9f6d

Please sign in to comment.