Skip to content

Commit

Permalink
fix: workaround for updating function image URI
Browse files Browse the repository at this point in the history
Signed-off-by: SdgJlbl <sarah.diot-girard@owkin.com>
  • Loading branch information
SdgJlbl committed Oct 17, 2023
1 parent 553e85d commit f8bbd29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backend/substrapp/compute_tasks/image_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ def load_remote_function_image(function: orchestrator.Function, channel: str) ->
container_image_tag = utils.container_image_tag_from_function(function)
# Ask the backend owner of the function if it's available

# Necessary to query the DB again to get an updated Function object
# Else the image URI is not available
api_function = ApiFunction.objects.get(key=function.key)

function_image_content = organization_client.get(
channel=channel,
organization_id=function.owner,
url=function.image.uri,
checksum=function.image.checksum,
url=api_function.image_address,
checksum=api_function.image_checksum,
)

os.makedirs(SUBTUPLE_TMP_DIR, exist_ok=True)
Expand Down

0 comments on commit f8bbd29

Please sign in to comment.