Skip to content

Commit

Permalink
feat: move to ai4os-hub/modules-catalog
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Feb 28, 2024
1 parent 9e8b998 commit 8487d8c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions ai4papi/routers/v1/catalog/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ def get_metadata(
"license": "",
"date_creation": "",
"sources": {
"dockerfile_repo": f"https://github.com/deephdc/{item_name}",
"docker_registry_repo": f"deephdc/{item_name}",
"dockerfile_repo": f"https://github.com/ai4os-hub/{item_name}",
"docker_registry_repo": f"ai4os-hub/{item_name}",
"code": "",
}
}
Expand All @@ -271,7 +271,7 @@ def get_config(

def retrieve_docker_tags(
image: str,
repo: str = 'deephdc',
repo: str = 'ai4oshub',
):
"""
Retrieve tags from Dockerhub image
Expand Down
9 changes: 5 additions & 4 deletions ai4papi/routers/v1/catalog/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@cached(cache=TTLCache(maxsize=1024, ttl=6*60*60))
def get_items(
):
gitmodules_url = "https://raw.githubusercontent.com/deephdc/deep-oc/master/.gitmodules"
gitmodules_url = "https://raw.githubusercontent.com/ai4os-hub/modules-catalog/master/.gitmodules"
r = requests.get(gitmodules_url)

cfg = configparser.ConfigParser()
Expand All @@ -24,6 +24,7 @@ def get_items(
for section in cfg.sections():
items = dict(cfg.items(section))
key = items.pop('path').lower()
items['url'] = items['url'].replace('.git', '') # remove `.git`, if present
modules[key] = items

return modules
Expand Down Expand Up @@ -63,8 +64,8 @@ def get_metadata(
"license": "",
"date_creation": "",
"sources": {
"dockerfile_repo": f"https://github.com/deephdc/{item_name}",
"docker_registry_repo": f"deephdc/{item_name}",
"dockerfile_repo": f"https://github.com/ai4os-hub/{item_name}",
"docker_registry_repo": f"ai4oshub/{item_name}",
"code": "",
}
}
Expand Down Expand Up @@ -97,7 +98,7 @@ def get_config(
registry = metadata['sources']['docker_registry_repo']
repo, image = registry.split('/')[:2]
if repo not in ['deephdc', 'ai4oshub']:
repo = 'deephdc'
repo = 'ai4oshub'

# Fill with correct Docker image
conf["general"]["docker_image"]["value"] = f"{repo}/{image}"
Expand Down
6 changes: 3 additions & 3 deletions ai4papi/routers/v1/catalog/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ def get_metadata(
"license": "",
"date_creation": "",
"sources": {
"dockerfile_repo": f"https://github.com/deephdc/{item_name}",
"docker_registry_repo": f"deephdc/{item_name}",
"dockerfile_repo": f"https://github.com/ai4os-hub/{item_name}",
"docker_registry_repo": f"ai4oshub/{item_name}",
"code": "",
}
}
Expand Down Expand Up @@ -95,7 +95,7 @@ def get_config(
registry = metadata['sources']['docker_registry_repo']
repo, image = registry.split('/')[:2]
if repo not in ['deephdc', 'ai4oshub']:
repo = 'deephdc'
repo = 'ai4oshub'

# Fill with correct Docker image
conf["general"]["docker_image"]["value"] = f"{repo}/{image}"
Expand Down

0 comments on commit 8487d8c

Please sign in to comment.