diff --git a/README.rst b/README.rst index 553ac01..69f724b 100644 --- a/README.rst +++ b/README.rst @@ -184,7 +184,7 @@ If you want to run local integration tests, then use: # Example pytest test/integration --docker-base-name preprod-sklearn ``\`` - --tag 1.0-1 ``\`` + --tag 1.2-1 ``\`` --py-version 3 ``\`` --framework-version |FRAMEWORK_VERSION| @@ -242,4 +242,4 @@ SageMaker Scikit-learn Container is licensed under the Apache 2.0 License. It is .com, Inc. or its affiliates. All Rights Reserved. The license is available at: http://aws.amazon.com/apache2.0/ -.. |FRAMEWORK_VERSION| replace:: 1.0-1 +.. |FRAMEWORK_VERSION| replace:: 1.2-1 diff --git a/docker/1.0-1/base/Dockerfile.cpu b/docker/1.2-1/base/Dockerfile.cpu similarity index 98% rename from docker/1.0-1/base/Dockerfile.cpu rename to docker/1.2-1/base/Dockerfile.cpu index fab320f..822effc 100644 --- a/docker/1.0-1/base/Dockerfile.cpu +++ b/docker/1.2-1/base/Dockerfile.cpu @@ -116,4 +116,4 @@ ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8 LANG=C.U # Install Scikit-Learn # Scikit-learn 0.20 was the last version to support Python 2.7 and Python 3.4. # Scikit-learn now requires Python 3.6 or newer. -RUN python -m pip install --no-cache -I scikit-learn==1.0.2 +RUN python -m pip install --no-cache -I scikit-learn==1.2.1 diff --git a/docker/1.0-1/base/Dockerfile_arm.cpu b/docker/1.2-1/base/Dockerfile_arm.cpu similarity index 100% rename from docker/1.0-1/base/Dockerfile_arm.cpu rename to docker/1.2-1/base/Dockerfile_arm.cpu diff --git a/docker/1.0-1/extension/Dockerfile.cpu b/docker/1.2-1/extension/Dockerfile.cpu similarity index 63% rename from docker/1.0-1/extension/Dockerfile.cpu rename to docker/1.2-1/extension/Dockerfile.cpu index 823b1a9..1317c8e 100644 --- a/docker/1.0-1/extension/Dockerfile.cpu +++ b/docker/1.2-1/extension/Dockerfile.cpu @@ -1,9 +1,9 @@ -FROM preprod-sklearn:1.0-1 +FROM preprod-sklearn:1.2-1 -RUN pip freeze | grep -q 'scikit-learn==1.0.2'; \ +RUN pip freeze | grep -q 'scikit-learn==1.2.1'; \ if [ $? -eq 0 ]; \ - then echo 'scikit-learn version 1.0.2 requirement met'; \ - else echo 'ERROR: Expected scikit-learn version is 1.0.2, check base images for scikit-learn version' && \ + then echo 'scikit-learn version 1.2.1 requirement met'; \ + else echo 'ERROR: Expected scikit-learn version is 1.2.1, check base images for scikit-learn version' && \ exit 1; fi RUN pip install --upgrade --no-cache --no-deps sagemaker-scikit-learn-extension==2.5.0 diff --git a/docker/1.0-1/extension/README.md b/docker/1.2-1/extension/README.md similarity index 87% rename from docker/1.0-1/extension/README.md rename to docker/1.2-1/extension/README.md index 8bc19b4..b1a0779 100644 --- a/docker/1.0-1/extension/README.md +++ b/docker/1.2-1/extension/README.md @@ -8,15 +8,15 @@ The SageMaker Scikit-learn Extension Container is built in 3 steps. The first 2 The "base" Dockerfile encompass the installation of the framework and all of the dependencies needed. -Tagging scheme is based on --cpu-py. (e.g. 1.0-1-cpu-py3) +Tagging scheme is based on --cpu-py. (e.g. 1.2-1-cpu-py3) All "final" Dockerfiles build images using base images that use the tagging scheme above. ``` -docker build -t sklearn-base:1.0-1-cpu-py3 -f docker/1.0-1/base/Dockerfile.cpu . +docker build -t sklearn-base:1.2-1-cpu-py3 -f docker/1.2-1/base/Dockerfile.cpu . ``` -Notice that this Dockerfile has the updated version of sklearn (1.0.2) installed. +Notice that this Dockerfile has the updated version of sklearn (1.2.1) installed. ### Step 2: Final Image @@ -38,7 +38,7 @@ python setup.py bdist_wheel Then build the final image, like in the sagemaker-sklearn-container ``` -docker build -t preprod-sklearn:1.0-1-cpu-py3 -f docker/1.0-1/final/Dockerfile.cpu . +docker build -t preprod-sklearn:1.2-1-cpu-py3 -f docker/1.2-1/final/Dockerfile.cpu . ``` ### Step 3: Build the extension image for SageMaker Scikit-learn Extension Container @@ -47,10 +47,10 @@ The "extension" Dockerfiles encompass the installation of the SageMaker Autopilo The "extension" Dockerfiles use final images for building. -Build the third additional Dockerfile needed for SageMaker Scikit-learn Extension Container. This Dockerfile specifies a hard dependency on a certain version of scikit-learn (i.e. v1.0.2). +Build the third additional Dockerfile needed for SageMaker Scikit-learn Extension Container. This Dockerfile specifies a hard dependency on a certain version of scikit-learn (i.e. v1.2.1). Tagging scheme is based on extension---cpu-py. (e.g. extension-2.5-1-cpu-py3). Make sure the "extension" image is tagged in accordance with the `extension` (i.e. `extension-2.5-1-cpu-py3`). ``` -docker build -t preprod-sklearn-extension:2.5-1-cpu-py3 -f docker/1.0-1/extension/Dockerfile.cpu . +docker build -t preprod-sklearn-extension:2.5-1-cpu-py3 -f docker/1.2-1/extension/Dockerfile.cpu . ``` \ No newline at end of file diff --git a/docker/1.0-1/final/Dockerfile.cpu b/docker/1.2-1/final/Dockerfile.cpu similarity index 96% rename from docker/1.0-1/final/Dockerfile.cpu rename to docker/1.2-1/final/Dockerfile.cpu index be7d20c..58f1d84 100644 --- a/docker/1.0-1/final/Dockerfile.cpu +++ b/docker/1.2-1/final/Dockerfile.cpu @@ -1,5 +1,5 @@ -FROM sklearn-base:1.0-1 -ENV SAGEMAKER_SKLEARN_VERSION 1.0-1 +FROM sklearn-base:1.2-1 +ENV SAGEMAKER_SKLEARN_VERSION 1.2-1 LABEL com.amazonaws.sagemaker.capabilities.accept-bind-to-port=true diff --git a/docker/1.0-1/final/Dockerfile_arm.cpu b/docker/1.2-1/final/Dockerfile_arm.cpu similarity index 100% rename from docker/1.0-1/final/Dockerfile_arm.cpu rename to docker/1.2-1/final/Dockerfile_arm.cpu diff --git a/docker/1.0-1/resources/libffi7_3.3-6_arm64.deb b/docker/1.2-1/resources/libffi7_3.3-6_arm64.deb similarity index 100% rename from docker/1.0-1/resources/libffi7_3.3-6_arm64.deb rename to docker/1.2-1/resources/libffi7_3.3-6_arm64.deb diff --git a/docker/1.0-1/resources/mms/ExecutionParameters.java b/docker/1.2-1/resources/mms/ExecutionParameters.java similarity index 100% rename from docker/1.0-1/resources/mms/ExecutionParameters.java rename to docker/1.2-1/resources/mms/ExecutionParameters.java diff --git a/docker/1.0-1/resources/mms/config.properties.tmp b/docker/1.2-1/resources/mms/config.properties.tmp similarity index 100% rename from docker/1.0-1/resources/mms/config.properties.tmp rename to docker/1.2-1/resources/mms/config.properties.tmp diff --git a/docker/1.0-1/resources/mms/endpoints-1.0.jar b/docker/1.2-1/resources/mms/endpoints-1.0.jar similarity index 100% rename from docker/1.0-1/resources/mms/endpoints-1.0.jar rename to docker/1.2-1/resources/mms/endpoints-1.0.jar diff --git a/requirements.txt b/requirements.txt index d2a4751..5d6a9d9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -14,7 +14,7 @@ retrying==1.3.3 sagemaker-containers==2.8.6.post2 sagemaker-inference==1.2.0 sagemaker-training==4.0.1 -scikit-learn==1.0.2 +scikit-learn==1.2.1 scipy==1.5.3 six==1.15.0 jinja2==3.0.3 diff --git a/test/conftest.py b/test/conftest.py index 8bda75b..4b46dde 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -43,7 +43,7 @@ def pytest_addoption(parser): parser.addoption('--install-container-support', '-C', action='store_true') parser.addoption('--docker-base-name', default='sk-learn') parser.addoption('--region', default='us-west-2') - parser.addoption('--framework-version', default='1.0.2') + parser.addoption('--framework-version', default='1.2.1') parser.addoption('--py-version', choices=['2', '3'], default=str(sys.version_info.major)) parser.addoption('--processor', choices=['cpu'], default='cpu') # If not specified, will default to {framework-version}-{processor}-py{py-version} diff --git a/test/integration/test_multiple_model_endpoint.py b/test/integration/test_multiple_model_endpoint.py index 64ddb29..f6acf79 100644 --- a/test/integration/test_multiple_model_endpoint.py +++ b/test/integration/test_multiple_model_endpoint.py @@ -150,7 +150,7 @@ def test_load_and_unload_model(): res_json = json.loads(res) assert res_json['status'] == 'Workers scaled' - code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0, 0.0', model_name) + code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0', model_name) assert code == 200, res code, res = make_unload_model_request(model_name) @@ -158,7 +158,7 @@ def test_load_and_unload_model(): res_json = json.loads(res) assert res_json['status'] == "Model \"{}\" unregistered".format(model_name), res - code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0, 0.0', model_name) + code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0', model_name) assert code == 404, res assert res['message'] == "Model not found: {}".format(model_name), res @@ -184,10 +184,10 @@ def test_load_and_unload_two_models(): res_json = json.loads(res) assert res_json['status'] == 'Workers scaled' - code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0, 0.0', model_name_0) + code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0', model_name_0) assert code == 200, res - code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0, 0.0', model_name_1) + code, res = make_invocation_request('0.0, 0.0, 0.0, 0.0, 0.0', model_name_1) assert code == 200, res code, res = make_unload_model_request(model_name_0) diff --git a/test/resources/models/pickled-model-1/sklearn-model b/test/resources/models/pickled-model-1/sklearn-model index 26f7c5a..b5bf177 100644 Binary files a/test/resources/models/pickled-model-1/sklearn-model and b/test/resources/models/pickled-model-1/sklearn-model differ diff --git a/test/resources/models/pickled-model-2/sklearn-model b/test/resources/models/pickled-model-2/sklearn-model index 26f7c5a..bcea8bb 100644 Binary files a/test/resources/models/pickled-model-2/sklearn-model and b/test/resources/models/pickled-model-2/sklearn-model differ diff --git a/tox.ini b/tox.ini index 62e2a51..30f9620 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,12 @@ [tox] -envlist = {py3}-sklearn{1.0},flake8 +envlist = {py3}-sklearn{1.2},flake8 [flake8] max-line-length = 120 [testenv] deps = - sklearn1.0: scikit-learn==1.0.2 + sklearn1.2: scikit-learn==1.2.1 -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt conda_deps=