-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: blacklist unknown xgboost image versions #1519
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
Changes from 2 commits
16768ff
69e6fe0
20fc81a
5502167
96f9ec3
9629642
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -452,6 +452,10 @@ def test_file_system_record_set_data_channel(): | |
def test_get_xgboost_image_uri(): | ||
legacy_xgb_image_uri = get_image_uri(REGION, "xgboost") | ||
assert legacy_xgb_image_uri == "433757028032.dkr.ecr.us-west-2.amazonaws.com/xgboost:1" | ||
legacy_xgb_image_uri = get_image_uri(REGION, "xgboost", 1) | ||
assert legacy_xgb_image_uri == "433757028032.dkr.ecr.us-west-2.amazonaws.com/xgboost:1" | ||
legacy_xgb_image_uri = get_image_uri(REGION, "xgboost", "latest") | ||
assert legacy_xgb_image_uri == "433757028032.dkr.ecr.us-west-2.amazonaws.com/xgboost:latest" | ||
|
||
updated_xgb_image_uri = get_image_uri(REGION, "xgboost", "0.90-1") | ||
assert ( | ||
|
@@ -465,6 +469,47 @@ def test_get_xgboost_image_uri(): | |
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:0.90-2-cpu-py3" | ||
) | ||
|
||
assert ( | ||
get_image_uri(REGION, "xgboost", "0.90-2-cpu-py3") | ||
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:0.90-2-cpu-py3" | ||
) | ||
assert ( | ||
get_image_uri(REGION, "xgboost", "0.90") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Once again, we were previously returning the 0.90-1 image for this. Let's check with Rahul on whether or not we want this new behavior. |
||
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:0.90-2-cpu-py3" | ||
) | ||
assert ( | ||
get_image_uri(REGION, "xgboost", "1.0-1") | ||
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:1.0-1-cpu-py3" | ||
) | ||
assert ( | ||
get_image_uri(REGION, "xgboost", "1.0-1-cpu-py3") | ||
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:1.0-1-cpu-py3" | ||
) | ||
assert ( | ||
get_image_uri(REGION, "xgboost", "1.0") | ||
== "246618743249.dkr.ecr.us-west-2.amazonaws.com/sagemaker-xgboost:1.0-1-cpu-py3" | ||
) | ||
|
||
|
||
def test_get_xgboost_image_uri_warning_with_legacy(caplog): | ||
get_image_uri(REGION, "xgboost", 1) | ||
assert "There is a more up to date SageMaker XGBoost image." in caplog.text | ||
|
||
|
||
def test_get_xgboost_image_uri_no_warning_with_latest(caplog): | ||
get_image_uri(REGION, "xgboost", XGBOOST_LATEST_VERSION.split("-")[0]) | ||
assert "There is a more up to date SageMaker XGBoost image." not in caplog.text | ||
|
||
|
||
def test_get_xgboost_image_uri_throws_error_for_unsupported_version(): | ||
with pytest.raises(ValueError) as error: | ||
get_image_uri(REGION, "xgboost", "99.99-9") | ||
assert "SageMaker XGBoost version 99.99-9 is not supported" in str(error) | ||
|
||
with pytest.raises(ValueError) as error: | ||
get_image_uri(REGION, "xgboost", "0.90-1-gpu-py3") | ||
assert "SageMaker XGBoost version 0.90-1-gpu-py3 is not supported" in str(error) | ||
|
||
|
||
def test_regitry_throws_error_if_mapping_does_not_exist_for_lda(): | ||
with pytest.raises(ValueError) as error: | ||
|
@@ -484,7 +529,7 @@ def test_is_latest_xgboost_version(): | |
assert _is_latest_xgboost_version(version) is False | ||
|
||
assert _is_latest_xgboost_version("0.90-1-cpu-py3") is False | ||
|
||
assert _is_latest_xgboost_version("0.90-2-cpu-py3") is False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we just perform a loop over the supported versions, excluding the last entry? That way we don't need to add a new line each time there's a new version. |
||
assert _is_latest_xgboost_version(XGBOOST_LATEST_VERSION) is True | ||
|
||
|
||
|
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 backwards compatibility, I don't think this is the behavior we want. If a customer is setting "0.90" as the
repo_version
and was previously getting the 0.90-1 image, we don't want to suddenly give them the 0.90-2 image.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 think you are right. We don't want to change 0.90 -> 0.90-2 if customers were getting 0.90-1 previously. Will update.