-
Notifications
You must be signed in to change notification settings - Fork 56
Automatically select latest version of conda pack #1263
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
base: main
Are you sure you want to change the base?
Conversation
get the latest conda pack. | ||
""" | ||
try: | ||
auth = ads.auth.default_signer() |
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.
Is this the way we handle throughout? Is there an option to BYO auth through storage_options or equivalent?
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.
Reading other datasets from object storage works the same way.
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.
Let's move this logic out of "init" and into runtime. Maybe we could offer a tag "latest" that forces this logic?
The yaml file could set conda to "forecast_p311...latest", which triggers this method, and ultimately gives "forecast_p311..._v10" at runtime
return tuple(map(int, match.group(1).split("."))) if match else (0,) | ||
|
||
latest_obj = max(objects, key=lambda obj: extract_version(obj.name)) | ||
return latest_obj.name.split("/")[-1] |
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.
Nice logic here 👍
There could be edge cases if any non-numerical versions are allowed, but we'll have to double check we don't support that.
We will still need to provide the python version and architecture by default, but this will greatly improve the current UX.
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.
This triggers when a user runs the operator init command, where we only support numerical versions.
Yes, we do need to support Python specific versions. At present, the latest releases are available only for Python 3.11.
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 should be the plan when we eventually release forecast_312_... ? Should we then update this logic? Or have some sort of transition period where we have both versions?
thanks
return latest_obj.name.split("/")[-1] | ||
except Exception as e: | ||
logger.warning(f"Error while fetching latest conda pack: {e}") | ||
return base_conda |
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.
Is base_conda a valid pack?
Isn't it just forecast_py310_x86-84_v
?
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.
Base conda is coming from MLOperator and it's forecast_p311_cpu_x86_64_v10
@@ -117,6 +123,29 @@ def info( | |||
) | |||
|
|||
|
|||
def get_latest_conda_pack(prefix, base_conda) -> str: | |||
""" | |||
get the latest conda pack. |
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.
can you please clarify what prefix and base_conda should be?
And is it guaranteed to return a valid conda path? or slug?
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.
base_conda and prefix is coming from MLoperator, If get_latest_conda_pack fails to get the latest conda pack, it returns base_conda which is also valid.
@@ -157,6 +186,7 @@ def init( | |||
|
|||
# load operator info | |||
operator_info: OperatorInfo = OperatorLoader.from_uri(uri=type).load() | |||
operator_info.conda = get_latest_conda_pack(operator_info.prefix, operator_info.conda) |
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.
Isn't the prefix service_pack/cpu/AI_Forecasting_Operator/
?
So how does the method know that it's looking for the latest "forecast" pack?
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.
Yes the prefix is service_pack/cpu/AI_Forecasting_Operator/
. The method list the bucket with this prefix and it always picks the latest when the user runs the init command with the fallback to base_conda, both of these are coming from MLOperator file
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.
For other operators, we can specify a prefix for that operator to list in MLOperator file in the bucket and it will retrieve the latest item after that prefix. Prefix can be different for different operators.
No description provided.