Skip to content

Commit 9cd4705

Browse files
authored
Merge branch 'master' into inference-id
2 parents d8547b5 + 89141dd commit 9cd4705

26 files changed

+83
-117
lines changed

buildspec-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ phases:
1818
tox -e py36,py37,py38 -- tests/unit
1919

2020
# run a subset of the integration tests
21-
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m canary_quick -n 64 --boxed --reruns 2
21+
- IGNORE_COVERAGE=- tox -e py36 -- tests/integ -m "not (local_mode or slow_test)" -n 32 --boxed --reruns 2

buildspec-slowtests.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- start-dockerd
7+
8+
build:
9+
commands:
10+
- IGNORE_COVERAGE=-
11+
12+
# slow tests
13+
- start_time=`date +%s`
14+
- execute-command-if-has-matching-changes "tox -e py38 -- tests/integ -m slow_test -n 16 --durations 0" "tests/integ" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "setup.py" "setup.cfg" "buildspec-slowtests.yml"
15+
- ./ci-scripts/displaytime.sh 'py38 slow tests' $start_time

buildspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ phases:
1616

1717
- start_time=`date +%s`
1818
- |
19-
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py38 -- tests/integ -m \"not local_mode and not cron\" -n 384 --reruns 3 --reruns-delay 15 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "src/sagemaker/image_uri_config/*.json" "setup.py" "setup.cfg" "buildspec.yml"
19+
execute-command-if-has-matching-changes "env -u AWS_DEFAULT_REGION tox -e py38 -- tests/integ -m \"not local_mode and not cron and not slow_test\" -n 384 --reruns 3 --reruns-delay 15 --durations 50 --boto-config '{\"region_name\": \"us-east-2\"}'" "tests/integ" "tests/scripts" "tests/data" "tests/conftest.py" "tests/__init__.py" "src/*.py" "src/sagemaker/image_uri_config/*.json" "setup.py" "setup.cfg" "buildspec.yml"
2020
- ./ci-scripts/displaytime.sh 'py38 tests/integ' $start_time
2121

2222
post_build:

doc/workflows/pipelines/sagemaker.workflow.pipelines.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ Steps
110110

111111
.. autoclass:: sagemaker.workflow.steps.ProcessingStep
112112

113-
.. autoclass:: sagemaker.workflow.steps.FailStep
114-
115113
Utilities
116114
---------
117115

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ def read_version():
6666
"pytest<6.1.0",
6767
"pytest-cov",
6868
"pytest-rerunfailures",
69+
"pytest-timeout",
6970
"pytest-xdist",
7071
"mock",
7172
"contextlib2",

src/sagemaker/image_uris.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ def retrieve(
9898
"mxnet-1.8.0-gpu-py37": "cu110-ubuntu16.04",
9999
"pytorch-1.6-gpu-py36": "cu110-ubuntu18.04-v3",
100100
"pytorch-1.6.0-gpu-py36": "cu110-ubuntu18.04",
101+
"pytorch-1.6-gpu-py3": "cu110-ubuntu18.04-v3",
102+
"pytorch-1.6.0-gpu-py3": "cu110-ubuntu18.04",
101103
}
102104
key = "-".join([framework, tag])
103105
if key in container_versions:

src/sagemaker/workflow/steps.py

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class StepTypeEnum(Enum, metaclass=DefaultEnumMeta):
5050

5151
CONDITION = "Condition"
5252
CREATE_MODEL = "Model"
53-
FAIL = "Fail"
5453
PROCESSING = "Processing"
5554
REGISTER_MODEL = "RegisterModel"
5655
TRAINING = "Training"
@@ -341,44 +340,3 @@ def to_request(self) -> RequestType:
341340
property_file.expr for property_file in self.property_files
342341
]
343342
return request_dict
344-
345-
346-
class FailStep(Step):
347-
"""Pipeline step to indicate failure."""
348-
349-
def __init__(self, name: str = "Fail"):
350-
"""Construct a FailStep.
351-
352-
Causes the pipeline execution to terminate in a failed state.
353-
354-
Args:
355-
name (str): The name of the step.
356-
"""
357-
super(FailStep, self).__init__(name, StepTypeEnum.FAIL)
358-
root_path = f"Steps.{name}"
359-
root_prop = Properties(path=root_path)
360-
root_prop.__dict__["Fail"] = Properties(f"{root_path}.Fail")
361-
self._properties = root_prop
362-
363-
@property
364-
def arguments(self) -> RequestType:
365-
"""The arguments to the particular step service call."""
366-
return {}
367-
368-
@property
369-
def properties(self):
370-
"""The properties of the particular step."""
371-
return self._properties
372-
373-
def to_request(self) -> RequestType:
374-
"""Get the request structure for workflow service calls."""
375-
return {
376-
"Name": self.name,
377-
"Type": self.step_type.value,
378-
"Arguments": self.arguments,
379-
}
380-
381-
@property
382-
def ref(self) -> Dict[str, str]:
383-
"""Get a reference dict for steps"""
384-
return {"Name": self.name}

tests/data/multimodel/container/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM 142577830533.dkr.ecr.us-east-2.amazonaws.com/ubuntu:16.04
1+
FROM public.ecr.aws/ubuntu/ubuntu:18.04
22

33
# Set a docker label to advertise multi-model support on the container
44
LABEL com.amazonaws.sagemaker.capabilities.multi-models=true
@@ -15,7 +15,7 @@ RUN apt-get update && \
1515
curl \
1616
vim \
1717
&& rm -rf /var/lib/apt/lists/* \
18-
&& curl -O https://bootstrap.pypa.io/3.5/get-pip.py \
18+
&& curl -O https://bootstrap.pypa.io/get-pip.py \
1919
&& python3 get-pip.py
2020

2121
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

tests/integ/sagemaker/lineage/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def artifact_obj_with_association(sagemaker_session, artifact_obj):
155155
@pytest.fixture
156156
def trial_component_obj(sagemaker_session):
157157
trial_component_obj = trial_component.TrialComponent.create(
158-
trial_component_name=name(), sagemaker_boto_client=sagemaker_session.sagemaker_client
158+
trial_component_name=name(),
159+
sagemaker_boto_client=sagemaker_session.sagemaker_client,
159160
)
160161
yield trial_component_obj
161162
time.sleep(0.5)

tests/integ/sagemaker/lineage/test_action.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
import datetime
1717
import logging
18+
import time
19+
20+
import pytest
1821

1922
from sagemaker.lineage import action
2023

@@ -80,6 +83,7 @@ def test_list(action_objs, sagemaker_session):
8083
assert action_names
8184

8285

86+
@pytest.mark.timeout(30)
8387
def test_tag(action_obj, sagemaker_session):
8488
tag = {"Key": "foo", "Value": "bar"}
8589
action_obj.set_tag(tag)
@@ -90,12 +94,14 @@ def test_tag(action_obj, sagemaker_session):
9094
)["Tags"]
9195
if actual_tags:
9296
break
97+
time.sleep(5)
9398
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
9499
# length of actual tags will be greater than 1
95100
assert len(actual_tags) > 0
96101
assert actual_tags[0] == tag
97102

98103

104+
@pytest.mark.timeout(30)
99105
def test_tags(action_obj, sagemaker_session):
100106
tags = [{"Key": "foo1", "Value": "bar1"}]
101107
action_obj.set_tags(tags)
@@ -106,6 +112,7 @@ def test_tags(action_obj, sagemaker_session):
106112
)["Tags"]
107113
if actual_tags:
108114
break
115+
time.sleep(5)
109116
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
110117
# length of actual tags will be greater than 1
111118
assert len(actual_tags) > 0

tests/integ/sagemaker/lineage/test_artifact.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import logging
1818
import time
1919

20+
import pytest
21+
2022
from sagemaker.lineage import artifact
2123

2224

@@ -111,6 +113,7 @@ def test_downstream_trials(trial_associated_artifact, trial_obj, sagemaker_sessi
111113
assert trial_obj.trial_name in trials
112114

113115

116+
@pytest.mark.timeout(30)
114117
def test_tag(artifact_obj, sagemaker_session):
115118
tag = {"Key": "foo", "Value": "bar"}
116119
artifact_obj.set_tag(tag)
@@ -121,12 +124,14 @@ def test_tag(artifact_obj, sagemaker_session):
121124
)["Tags"]
122125
if actual_tags:
123126
break
127+
time.sleep(5)
124128
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
125129
# length of actual tags will be greater than 1
126130
assert len(actual_tags) > 0
127131
assert actual_tags[0] == tag
128132

129133

134+
@pytest.mark.timeout(30)
130135
def test_tags(artifact_obj, sagemaker_session):
131136
tags = [{"Key": "foo1", "Value": "bar1"}]
132137
artifact_obj.set_tags(tags)
@@ -137,6 +142,7 @@ def test_tags(artifact_obj, sagemaker_session):
137142
)["Tags"]
138143
if actual_tags:
139144
break
145+
time.sleep(5)
140146
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
141147
# length of actual tags will be greater than 1
142148
assert len(actual_tags) > 0

tests/integ/sagemaker/lineage/test_association.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import datetime
1717
import time
1818

19+
import pytest
20+
1921
from sagemaker.lineage import association
2022

2123

@@ -55,6 +57,7 @@ def test_list(association_objs, sagemaker_session):
5557
assert association_keys_listed
5658

5759

60+
@pytest.mark.timeout(30)
5861
def test_set_tag(association_obj, sagemaker_session):
5962
tag = {"Key": "foo", "Value": "bar"}
6063
association_obj.set_tag(tag)
@@ -65,13 +68,14 @@ def test_set_tag(association_obj, sagemaker_session):
6568
)["Tags"]
6669
if actual_tags:
6770
break
68-
time.sleep(1)
71+
time.sleep(5)
6972
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
7073
# length of actual tags will be greater than 1
7174
assert len(actual_tags) > 0
7275
assert actual_tags[0] == tag
7376

7477

78+
@pytest.mark.timeout(30)
7579
def test_tags(association_obj, sagemaker_session):
7680
tags = [{"Key": "foo1", "Value": "bar1"}]
7781
association_obj.set_tags(tags)
@@ -82,7 +86,7 @@ def test_tags(association_obj, sagemaker_session):
8286
)["Tags"]
8387
if actual_tags:
8488
break
85-
time.sleep(1)
89+
time.sleep(5)
8690
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
8791
# length of actual tags will be greater than 1
8892
assert len(actual_tags) > 0

tests/integ/sagemaker/lineage/test_context.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
import datetime
1717
import logging
18+
import time
19+
20+
import pytest
1821

1922
from sagemaker.lineage import context
2023

@@ -78,6 +81,7 @@ def test_list(context_objs, sagemaker_session):
7881
assert context_names
7982

8083

84+
@pytest.mark.timeout(30)
8185
def test_tag(context_obj, sagemaker_session):
8286
tag = {"Key": "foo", "Value": "bar"}
8387
context_obj.set_tag(tag)
@@ -88,12 +92,14 @@ def test_tag(context_obj, sagemaker_session):
8892
)["Tags"]
8993
if actual_tags:
9094
break
95+
time.sleep(5)
9196
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
9297
# length of actual tags will be greater than 1
9398
assert len(actual_tags) > 0
9499
assert actual_tags[0] == tag
95100

96101

102+
@pytest.mark.timeout(30)
97103
def test_tags(context_obj, sagemaker_session):
98104
tags = [{"Key": "foo1", "Value": "bar1"}]
99105
context_obj.set_tags(tags)
@@ -104,6 +110,7 @@ def test_tags(context_obj, sagemaker_session):
104110
)["Tags"]
105111
if actual_tags:
106112
break
113+
time.sleep(5)
107114
# When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
108115
# length of actual tags will be greater than 1
109116
assert len(actual_tags) > 0

tests/integ/test_auto_ml.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
}
4848

4949

50+
@pytest.mark.slow_test
5051
@pytest.mark.skipif(
5152
tests.integ.test_region() in tests.integ.NO_AUTO_ML_REGIONS,
5253
reason="AutoML is not supported in the region yet.",

tests/integ/test_clarify_model_monitor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ def test_bias_monitor(sagemaker_session, scheduled_bias_monitor, endpoint_name,
285285
monitor.delete_monitoring_schedule()
286286

287287

288+
@pytest.mark.slow_test
288289
@pytest.mark.skipif(
289290
tests.integ.test_region() in tests.integ.NO_MODEL_MONITORING_REGIONS,
290291
reason="ModelMonitoring is not yet supported in this region.",
@@ -393,6 +394,7 @@ def test_explainability_monitor(sagemaker_session, scheduled_explainability_moni
393394
monitor.delete_monitoring_schedule()
394395

395396

397+
@pytest.mark.slow_test
396398
@pytest.mark.skipif(
397399
tests.integ.test_region() in tests.integ.NO_MODEL_MONITORING_REGIONS,
398400
reason="ModelMonitoring is not yet supported in this region.",

tests/integ/test_experiments_analytics.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -128,22 +128,6 @@ def test_experiment_analytics_artifacts(sagemaker_session):
128128
]
129129

130130

131-
@pytest.mark.canary_quick
132-
def test_experiment_analytics(sagemaker_session):
133-
with experiment(sagemaker_session) as experiment_name:
134-
analytics = ExperimentAnalytics(
135-
experiment_name=experiment_name, sagemaker_session=sagemaker_session
136-
)
137-
138-
assert list(analytics.dataframe().columns) == [
139-
"TrialComponentName",
140-
"DisplayName",
141-
"hp1",
142-
"Trials",
143-
"Experiments",
144-
]
145-
146-
147131
def test_experiment_analytics_pagination(sagemaker_session):
148132
with experiment(sagemaker_session) as experiment_name:
149133
analytics = ExperimentAnalytics(

tests/integ/test_inference_pipeline.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def test_inference_pipeline_model_deploy(sagemaker_session, cpu_instance_type):
149149
assert "Could not find model" in str(exception.value)
150150

151151

152+
@pytest.mark.slow_test
152153
def test_inference_pipeline_model_deploy_and_update_endpoint(
153154
sagemaker_session, cpu_instance_type, alternative_cpu_instance_type
154155
):

tests/integ/test_lda.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from tests.integ.record_set import prepare_record_set_from_local_files
2727

2828

29+
@pytest.mark.slow_test
2930
@pytest.mark.skipif(
3031
tests.integ.test_region() in tests.integ.NO_LDA_REGIONS,
3132
reason="LDA image is not supported in certain regions",

tests/integ/test_model_quality_monitor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ def test_model_quality_monitor(
230230
monitor.delete_monitoring_schedule()
231231

232232

233+
@pytest.mark.slow_test
233234
@pytest.mark.skipif(
234235
tests.integ.test_region() in tests.integ.NO_MODEL_MONITORING_REGIONS,
235236
reason="ModelMonitoring is not yet supported in this region.",
@@ -254,6 +255,7 @@ def test_run_model_quality_monitor(
254255
monitor.delete_monitoring_schedule()
255256

256257

258+
@pytest.mark.slow_test
257259
@pytest.mark.skipif(
258260
tests.integ.test_region() in tests.integ.NO_MODEL_MONITORING_REGIONS,
259261
reason="ModelMonitoring is not yet supported in this region.",

0 commit comments

Comments
 (0)