Skip to content

Commit

Permalink
fix: relax constraints on Dockerhub image name
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnacioHeredia committed Feb 28, 2024
1 parent 71d805b commit 9e8b998
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions ai4papi/module_patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def patch_nextcloud_mount(
"DEEP-OC-speech-to-text-tf",
]
modules = [f'deephdc/{m.lower()}' for m in modules]
# TODO: this will need to be updated to ai4os-hub

if docker_image in modules:
task['Env']['RCLONE_CONTIMEOUT'] = '1s'
Expand Down
11 changes: 8 additions & 3 deletions ai4papi/routers/v1/catalog/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,17 @@ def get_config(
# Retrieve module metadata
metadata = get_metadata(item_name)

# Add available Docker tags
# Parse docker registry
registry = metadata['sources']['docker_registry_repo']
repo = registry.split('/')[0]
repo, image = registry.split('/')[:2]
if repo not in ['deephdc', 'ai4oshub']:
repo = 'deephdc'
tags = retrieve_docker_tags(image=item_name, repo=repo)

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

# Add available Docker tags
tags = retrieve_docker_tags(image=image, repo=repo)
conf["general"]["docker_tag"]["options"] = tags
conf["general"]["docker_tag"]["value"] = tags[0]

Expand Down
13 changes: 9 additions & 4 deletions ai4papi/routers/v1/catalog/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_items(
tools = {}
for k in papiconf.TOOLS.keys():
tools[k] = {
'url': f'https://github.com/deephdc/{k}',
'url': f'https://github.com/deephdc/{k}', #TODO: this will need to be updated
'branch': tools_branches[k],
}

Expand Down Expand Up @@ -91,12 +91,17 @@ def get_config(
# Retrieve tool metadata
metadata = get_metadata(item_name)

# Add available Docker tags
# Parse docker registry
registry = metadata['sources']['docker_registry_repo']
repo = registry.split('/')[0]
repo, image = registry.split('/')[:2]
if repo not in ['deephdc', 'ai4oshub']:
repo = 'deephdc'
tags = retrieve_docker_tags(image=item_name, repo=repo)

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

# Add available Docker tags
tags = retrieve_docker_tags(image=image, repo=repo)
conf["general"]["docker_tag"]["options"] = tags
conf["general"]["docker_tag"]["value"] = tags[0]

Expand Down

0 comments on commit 9e8b998

Please sign in to comment.