-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API] Resolve function URI when submitting a schedule from hub function #3691
[API] Resolve function URI when submitting a schedule from hub function #3691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions :)
assert len(schedules) == 1 | ||
|
||
schedule = schedules[0] | ||
assert schedule["scheduled_object"]["task"]["spec"]["function"] != hub_function_uri |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest using a regex to see the function uri is as expected ({project}/{name}@{hash}:{tag})
# if the task is pointing to a remote function (hub://), we need to save it to the db | ||
# and update the task to point to the saved function, so that the scheduler will be able to | ||
# access the db version of the function, and not the remote one (which can be changed between runs) | ||
if "://" in task["spec"]["function"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if the function points to db? (db://)
function_uri = fn.save(versioned=True) | ||
data.pop("function", None) | ||
data.pop("function_url", None) | ||
task["spec"]["function"] = function_uri.replace("db://", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove the db:// ?
Fixes https://jira.iguazeng.com/browse/ML-3933
Full details for the fix inside the code and the ticket