Skip to content

Commit 69d791b

Browse files
authored
Merge pull request aws#35 from verdimrc/fp-integ-test-non-tf
Integration tests for MXNetProcessor and PyTorchProcessor
2 parents 3525a4b + 0de3a8f commit 69d791b

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

tests/integ/test_mxnet.py

+30
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
from sagemaker import ModelPackage
2323
from sagemaker.mxnet.estimator import MXNet
2424
from sagemaker.mxnet.model import MXNetModel
25+
from sagemaker.mxnet.processing import MXNetProcessor
2526
from sagemaker.utils import sagemaker_timestamp
2627
from tests.integ import DATA_DIR, TRAINING_DEFAULT_TIMEOUT_MINUTES
2728
from tests.integ.kms_utils import get_or_create_kms_key
@@ -65,6 +66,35 @@ def mxnet_training_job(
6566
return mx.latest_training_job.name
6667

6768

69+
@pytest.mark.release
70+
def test_framework_processing_job_with_deps(
71+
sagemaker_session,
72+
mxnet_training_latest_version,
73+
mxnet_training_latest_py_version,
74+
cpu_instance_type,
75+
):
76+
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
77+
code_path = os.path.join(DATA_DIR, "dummy_code_bundle_with_reqs")
78+
entry_point = "main_script.py"
79+
80+
processor = MXNetProcessor(
81+
framework_version=mxnet_training_latest_version,
82+
py_version=mxnet_training_latest_py_version,
83+
role="SageMakerRole",
84+
instance_count=1,
85+
instance_type=cpu_instance_type,
86+
sagemaker_session=sagemaker_session,
87+
base_job_name="test-mxnet",
88+
)
89+
90+
processor.run(
91+
code=entry_point,
92+
source_dir=code_path,
93+
inputs=[],
94+
wait=True,
95+
)
96+
97+
6898
@pytest.mark.release
6999
def test_attach_deploy(mxnet_training_job, sagemaker_session, cpu_instance_type):
70100
endpoint_name = "test-mxnet-attach-deploy-{}".format(sagemaker_timestamp())

tests/integ/test_pytorch.py

+30
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
from sagemaker.pytorch.estimator import PyTorch
2020
from sagemaker.pytorch.model import PyTorchModel
21+
from sagemaker.pytorch.processing import PyTorchProcessor
2122
from sagemaker.utils import sagemaker_timestamp
2223
from tests.integ import (
2324
test_region,
@@ -95,6 +96,35 @@ def fixture_training_job_with_latest_inference_version(
9596
return pytorch.latest_training_job.name
9697

9798

99+
@pytest.mark.release
100+
def test_framework_processing_job_with_deps(
101+
sagemaker_session,
102+
pytorch_training_latest_version,
103+
pytorch_training_latest_py_version,
104+
cpu_instance_type,
105+
):
106+
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
107+
code_path = os.path.join(DATA_DIR, "dummy_code_bundle_with_reqs")
108+
entry_point = "main_script.py"
109+
110+
processor = PyTorchProcessor(
111+
framework_version=pytorch_training_latest_version,
112+
py_version=pytorch_training_latest_py_version,
113+
role="SageMakerRole",
114+
instance_count=1,
115+
instance_type=cpu_instance_type,
116+
sagemaker_session=sagemaker_session,
117+
base_job_name="test-pytorch",
118+
)
119+
120+
processor.run(
121+
code=entry_point,
122+
source_dir=code_path,
123+
inputs=[],
124+
wait=True,
125+
)
126+
127+
98128
@pytest.mark.release
99129
def test_fit_deploy(
100130
pytorch_training_job_with_latest_infernce_version, sagemaker_session, cpu_instance_type

0 commit comments

Comments
 (0)