Skip to content

Commit b24e14b

Browse files
yijiezhyangaws
authored andcommitted
Nrt support for existing algorithms in spark sdk (#50)
* Add support for NRT region for existing algorithms in Spark SDK. * updated version to 1.1.0
1 parent 81ac056 commit b24e14b

File tree

10 files changed

+50
-5
lines changed

10 files changed

+50
-5
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
CHANGELOG
33
=========
44

5+
1.1.0
6+
=====
7+
8+
* spark/pyspark: Enable NRT region support for spark SDK
9+
510
1.0.5
611
=====
712

sagemaker-pyspark-sdk/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from setuptools import setup
88

99

10-
VERSION = "1.0.5"
10+
VERSION = "1.1.0"
1111

1212
TEMP_PATH = "deps"
1313
JARS_TARGET = os.path.join(TEMP_PATH, "jars")

sagemaker-spark-sdk/build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ scalaVersion := "2.11.7"
1919
// to change the version of spark add -DSPARK_VERSION=2.x.x when running sbt
2020
// for example: "sbt -DSPARK_VERSION=2.1.1 clean compile test doc package"
2121
val sparkVersion = System.getProperty("SPARK_VERSION", "2.2.0")
22-
version := "spark_" + sparkVersion + "-1.0.5"
22+
version := "spark_" + sparkVersion + "-1.1.0"
2323

2424
lazy val SageMakerSpark = (project in file("."))
2525

sagemaker-spark-sdk/src/main/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/ImageURIProvider.scala

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,23 +36,26 @@ private[algorithms] object SagerMakerRegionAccountMaps {
3636
Regions.EU_WEST_1.getName -> "438346466558",
3737
Regions.US_EAST_1.getName -> "382416733822",
3838
Regions.US_EAST_2.getName -> "404615174143",
39-
Regions.US_WEST_2.getName -> "174872318107"
39+
Regions.US_WEST_2.getName -> "174872318107",
40+
Regions.AP_NORTHEAST_1.getName -> "351501993468"
4041
)
4142

4243
// For LDA
4344
val LDAAccountMap: Map[String, String] = Map(
4445
Regions.EU_WEST_1.getName -> "999678624901",
4546
Regions.US_EAST_1.getName -> "766337827248",
4647
Regions.US_EAST_2.getName -> "999911452149",
47-
Regions.US_WEST_2.getName -> "266724342769"
48+
Regions.US_WEST_2.getName -> "266724342769",
49+
Regions.AP_NORTHEAST_1.getName -> "258307448986"
4850
)
4951

5052
// For XGBoost
5153
val ApplicationsAccountMap: Map[String, String] = Map(
5254
Regions.EU_WEST_1.getName -> "685385470294",
5355
Regions.US_EAST_1.getName -> "811284229777",
5456
Regions.US_EAST_2.getName -> "825641698319",
55-
Regions.US_WEST_2.getName -> "433757028032"
57+
Regions.US_WEST_2.getName -> "433757028032",
58+
Regions.AP_NORTHEAST_1.getName -> "501404015308"
5659
)
5760
}
5861

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/FactorizationMachinesSageMakerEstimatorTests.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ class FactorizationMachinesSageMakerEstimatorTests extends FlatSpec with Mockito
7676
createFactorizationMachinesBinaryClassifier(region = Regions.US_WEST_2.getName)
7777
assert(estimatorUSWest2.trainingImage ==
7878
"174872318107.dkr.ecr.us-west-2.amazonaws.com/factorization-machines:1")
79+
80+
val estimatorAPNorthEast1 =
81+
createFactorizationMachinesBinaryClassifier(region = Regions.AP_NORTHEAST_1.getName)
82+
assert(estimatorAPNorthEast1.trainingImage ==
83+
"351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/factorization-machines:1")
7984
}
8085

8186
it should "use the correct defaults for regressor" in {
@@ -102,6 +107,11 @@ class FactorizationMachinesSageMakerEstimatorTests extends FlatSpec with Mockito
102107
val estimatorUSWest2 = createFactorizationMachinesRegressor(region = Regions.US_WEST_2.getName)
103108
assert(estimatorUSWest2.trainingImage ==
104109
"174872318107.dkr.ecr.us-west-2.amazonaws.com/factorization-machines:1")
110+
111+
val estimatorAPNorthEast1 =
112+
createFactorizationMachinesRegressor(region = Regions.AP_NORTHEAST_1.getName)
113+
assert(estimatorAPNorthEast1.trainingImage ==
114+
"351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/factorization-machines:1")
105115
}
106116

107117
it should "setFeatureDim" in {

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/KMeansSageMakerEstimatorTests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ class KMeansSageMakerEstimatorTests extends FlatSpec with Matchers with MockitoS
6868
val estimatorUSWest2 = createKMeansEstimator(region = Regions.US_WEST_2.getName)
6969
assert(estimatorUSWest2.trainingImage
7070
== "174872318107.dkr.ecr.us-west-2.amazonaws.com/kmeans:1")
71+
72+
val estimatorAPNorthEast1 = createKMeansEstimator(region = Regions.AP_NORTHEAST_1.getName)
73+
assert(estimatorAPNorthEast1.trainingImage
74+
== "351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/kmeans:1")
7175
}
7276

7377
it should "setK" in {

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/LDASageMakerEstimatorTests.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ class LDASageMakerEstimatorTests extends FlatSpec with MockitoSugar {
6666
createLDAEstimator(region = Regions.US_WEST_2.getName)
6767
assert(estimatorUSWest2.trainingImage ==
6868
"266724342769.dkr.ecr.us-west-2.amazonaws.com/lda:1")
69+
70+
val estimatorAPNorthEast1 =
71+
createLDAEstimator(region = Regions.AP_NORTHEAST_1.getName)
72+
assert(estimatorAPNorthEast1.trainingImage ==
73+
"258307448986.dkr.ecr.ap-northeast-1.amazonaws.com/lda:1")
6974
}
7075

7176
it should "setFeatureDim" in {

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/LinearLearnerSageMakerEstimatorTests.scala

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@ class LinearLearnerSageMakerEstimatorTests extends FlatSpec with MockitoSugar {
7171
val estimatorUSWest2 = createLinearLearnerBinaryClassifier(region = Regions.US_WEST_2.getName)
7272
assert(estimatorUSWest2.trainingImage ==
7373
"174872318107.dkr.ecr.us-west-2.amazonaws.com/linear-learner:1")
74+
75+
val estimatorAPNorthEast1 =
76+
createLinearLearnerBinaryClassifier(region = Regions.AP_NORTHEAST_1.getName)
77+
assert(estimatorAPNorthEast1.trainingImage ==
78+
"351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/linear-learner:1")
7479
}
7580

7681
it should "use the correct defaults for regressor" in {
@@ -97,6 +102,11 @@ class LinearLearnerSageMakerEstimatorTests extends FlatSpec with MockitoSugar {
97102
val estimatorUSWest2 = createLinearLearnerRegressor(region = Regions.US_WEST_2.getName)
98103
assert(estimatorUSWest2.trainingImage ==
99104
"174872318107.dkr.ecr.us-west-2.amazonaws.com/linear-learner:1")
105+
106+
val estimatorAPNorthEast1 =
107+
createLinearLearnerRegressor(region = Regions.AP_NORTHEAST_1.getName)
108+
assert(estimatorAPNorthEast1.trainingImage ==
109+
"351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/linear-learner:1")
100110
}
101111

102112
it should "setFeatureDim" in {

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/PCASageMakerEstimatorTests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ class PCASageMakerEstimatorTests extends FlatSpec with MockitoSugar {
4848

4949
val estimatorUSWest2 = createPCAEstimator(region = Regions.US_WEST_2.getName)
5050
assert(estimatorUSWest2.trainingImage == "174872318107.dkr.ecr.us-west-2.amazonaws.com/pca:1")
51+
52+
val estimatorAPNorthEast1 = createPCAEstimator(region = Regions.AP_NORTHEAST_1.getName)
53+
assert(estimatorAPNorthEast1.trainingImage ==
54+
"351501993468.dkr.ecr.ap-northeast-1.amazonaws.com/pca:1")
5155
}
5256

5357
it should "use the correct defaults" in {

sagemaker-spark-sdk/src/test/scala/com/amazonaws/services/sagemaker/sparksdk/algorithms/XGBoostSageMakerEstimatorTests.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ class XGBoostSageMakerEstimatorTests extends FlatSpec with Matchers with Mockito
6767
val estimatorUSWest2 = createXGBoostEstimator(region = Regions.US_WEST_2.getName)
6868
assert(estimatorUSWest2.trainingImage ==
6969
"433757028032.dkr.ecr.us-west-2.amazonaws.com/xgboost:1")
70+
71+
val estimatorAPNorthEast1 = createXGBoostEstimator(region = Regions.AP_NORTHEAST_1.getName)
72+
assert(estimatorAPNorthEast1.trainingImage ==
73+
"501404015308.dkr.ecr.ap-northeast-1.amazonaws.com/xgboost:1")
7074
}
7175

7276
it should "setBooster" in {

0 commit comments

Comments
 (0)