Skip to content

Commit 5905c00

Browse files
guoqiao1992Dan Choi
authored and
Dan Choi
committed
feature: add spark image_uri_retriever support for framework_version 3.0 (aws#450)
* add spark image_uri_retriever support for framework_version 3.0 * changing framework_version to 2.4 in spark unit tests * fix spark integration
1 parent e8d16f8 commit 5905c00

File tree

3 files changed

+58
-9
lines changed

3 files changed

+58
-9
lines changed

src/sagemaker/image_uri_config/spark.json

+29
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,35 @@
3030
"us-gov-west-1": "271483468897"
3131
},
3232
"repository": "sagemaker-spark-processing"
33+
},
34+
"3.0": {
35+
"py_versions": ["py37"],
36+
"registries": {
37+
"me-south-1": "750251592176",
38+
"ap-south-1": "105495057255",
39+
"eu-north-1": "330188676905",
40+
"eu-west-3": "136845547031",
41+
"us-east-2": "314815235551",
42+
"eu-west-1": "571004829621",
43+
"eu-central-1": "906073651304",
44+
"sa-east-1": "737130764395",
45+
"ap-east-1": "732049463269",
46+
"us-east-1": "173754725891",
47+
"ap-northeast-2": "860869212795",
48+
"eu-west-2": "836651553127",
49+
"ap-northeast-1": "411782140378",
50+
"us-west-2": "153931337802",
51+
"us-west-1": "667973535471",
52+
"ap-southeast-1": "759080221371",
53+
"ap-southeast-2": "440695851116",
54+
"ca-central-1": "446299261295",
55+
"cn-north-1": "671472414489",
56+
"cn-northwest-1": "844356804704",
57+
"eu-south-1": "753923664805",
58+
"af-south-1": "309385258863",
59+
"us-gov-west-1": "271483468897"
60+
},
61+
"repository": "sagemaker-spark-processing"
3362
}
3463
}
3564
}

tests/integ/test_spark_processing.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -75,26 +75,26 @@ def build_jar():
7575

7676

7777
@pytest.fixture(scope="module")
78-
def spark_py_processor(sagemaker_session, cpu_instance_type, spark_processing_latest_version):
78+
def spark_py_processor(sagemaker_session, cpu_instance_type):
7979
spark_py_processor = PySparkProcessor(
8080
role="SageMakerRole",
8181
instance_count=2,
8282
instance_type=cpu_instance_type,
8383
sagemaker_session=sagemaker_session,
84-
framework_version=spark_processing_latest_version,
84+
framework_version="2.4",
8585
)
8686

8787
return spark_py_processor
8888

8989

9090
@pytest.fixture(scope="module")
91-
def spark_jar_processor(sagemaker_session, cpu_instance_type, spark_processing_latest_version):
91+
def spark_jar_processor(sagemaker_session, cpu_instance_type):
9292
spark_jar_processor = SparkJarProcessor(
9393
role="SageMakerRole",
9494
instance_count=2,
9595
instance_type=cpu_instance_type,
9696
sagemaker_session=sagemaker_session,
97-
framework_version=spark_processing_latest_version,
97+
framework_version="2.4",
9898
)
9999

100100
return spark_jar_processor

tests/unit/sagemaker/spark/test_processing.py

+25-5
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def spark_processor_base(sagemaker_session) -> _SparkProcessorBase:
6868
spark_processor_base = _SparkProcessorBase(
6969
base_job_name="sm-spark",
7070
role="AmazonSageMaker-ExecutionRole",
71-
framework_version="0.1.0",
71+
framework_version="2.4",
7272
instance_count=1,
7373
instance_type="ml.c5.xlarge",
7474
image_uri="790336243319.dkr.ecr.us-west-2.amazonaws.com/sagemaker-spark:0.1",
@@ -83,7 +83,7 @@ def py_spark_processor(sagemaker_session) -> PySparkProcessor:
8383
spark = PySparkProcessor(
8484
base_job_name="sm-spark",
8585
role="AmazonSageMaker-ExecutionRole",
86-
framework_version="0.1.0",
86+
framework_version="2.4",
8787
instance_count=1,
8888
instance_type="ml.c5.xlarge",
8989
image_uri="790336243319.dkr.ecr.us-west-2.amazonaws.com/sagemaker-spark:0.1",
@@ -125,7 +125,7 @@ def test_pyspark_processor_instantiation(sagemaker_session):
125125
PySparkProcessor(
126126
base_job_name="sm-spark",
127127
role="AmazonSageMaker-ExecutionRole",
128-
framework_version="0.1.0",
128+
framework_version="2.4",
129129
instance_count=1,
130130
instance_type="ml.c5.xlarge",
131131
sagemaker_session=sagemaker_session,
@@ -183,7 +183,7 @@ def test_configuration_validation(config, expected, sagemaker_session) -> None:
183183
spark = PySparkProcessor(
184184
base_job_name="sm-spark",
185185
role="AmazonSageMaker-ExecutionRole",
186-
framework_version="0.1.0",
186+
framework_version="2.4",
187187
instance_count=1,
188188
instance_type="ml.c5.xlarge",
189189
sagemaker_session=sagemaker_session,
@@ -362,6 +362,16 @@ def test_stage_submit_deps(mock_s3_uploader, py_spark_processor, jar_file, confi
362362
},
363363
"153931337802.dkr.ecr.us-west-2.amazonaws.com/sagemaker-spark-processing:2.4-cpu",
364364
),
365+
(
366+
{
367+
"image_uri": None,
368+
"framework_version": "3.0",
369+
"py_version": None,
370+
"container_version": None,
371+
"instance_type": "ml.c5.xlarge",
372+
},
373+
"153931337802.dkr.ecr.us-west-2.amazonaws.com/sagemaker-spark-processing:3.0-cpu",
374+
),
365375
(
366376
{
367377
"image_uri": "image_uri",
@@ -372,6 +382,16 @@ def test_stage_submit_deps(mock_s3_uploader, py_spark_processor, jar_file, confi
372382
},
373383
"image_uri",
374384
),
385+
(
386+
{
387+
"image_uri": None,
388+
"framework_version": "invalidFrameworkVersion",
389+
"py_version": None,
390+
"container_version": None,
391+
"instance_type": "ml.c5.xlarge",
392+
},
393+
ValueError,
394+
),
375395
(
376396
{
377397
"image_uri": None,
@@ -848,7 +868,7 @@ def test_spark_jar_processor_run(
848868
spark_jar_processor = SparkJarProcessor(
849869
base_job_name="sm-spark",
850870
role="AmazonSageMaker-ExecutionRole",
851-
framework_version="0.1.0",
871+
framework_version="2.4",
852872
instance_count=1,
853873
instance_type="ml.c5.xlarge",
854874
image_uri="790336243319.dkr.ecr.us-west-2.amazonaws.com/sagemaker-spark:0.1",

0 commit comments

Comments
 (0)