Skip to content

Commit ec28c4b

Browse files
authored
feat: add SM XgBoost 1.7-1-1(#454)
* feat: update python version to 3.10 * feat: update python version to 3.10
1 parent f7a93a2 commit ec28c4b

File tree

9 files changed

+27
-18
lines changed

9 files changed

+27
-18
lines changed

docker/1.7-1/base/Dockerfile.cpu renamed to docker/1.7-1-1/base/Dockerfile.cpu

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2626
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu${UBUNTU_VERSION}@sha256:${IMAGE_DIGEST}
2727

2828
ARG MINICONDA_VERSION=24.7.1
29-
ARG CONDA_CHECKSUM=2006a61abc8b4fd04de5eb92620e1f72bada713cc84b5b4899463095e1210556
30-
ARG CONDA_PY_VERSION=39
29+
ARG CONDA_CHECKSUM=684cda724bc37e3bbbb342e440fc4cac515c92e91a489eb4359feca35382894b
30+
ARG CONDA_PY_VERSION=310
3131
ARG CONDA_PKG_VERSION=24.7.1
32-
ARG PYTHON_VERSION=3.9
32+
ARG PYTHON_VERSION=3.10
3333
ARG PYARROW_VERSION=14.0.1
3434
ARG MLIO_VERSION=0.9.0
3535
ARG XGBOOST_VERSION=1.7.4

docker/1.7-1/final/Dockerfile.cpu renamed to docker/1.7-1-1/final/Dockerfile.cpu

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG SAGEMAKER_XGBOOST_VERSION=1.7-1
2-
ARG PYTHON_VERSION=3.9
1+
ARG SAGEMAKER_XGBOOST_VERSION=1.7-1-1
2+
ARG PYTHON_VERSION=3.10
33

44
FROM xgboost-container-base:${SAGEMAKER_XGBOOST_VERSION}-cpu-py3
55

@@ -11,6 +11,14 @@ ARG SAGEMAKER_XGBOOST_VERSION
1111
COPY requirements.txt /requirements.txt
1212
RUN python3 -m pip install -r /requirements.txt && rm /requirements.txt
1313

14+
# Fix Python 3.10 compatibility for sagemaker-containers
15+
RUN python3 -c "import sys; sys.path.insert(0, '/miniconda3/lib/python3.10/site-packages'); \
16+
import sagemaker_containers._mapping as m; \
17+
import collections.abc; \
18+
setattr(collections, 'Mapping', collections.abc.Mapping); \
19+
exec(open('/miniconda3/lib/python3.10/site-packages/sagemaker_containers/_mapping.py').read().replace('collections.Mapping', 'collections.abc.Mapping'))" || \
20+
sed -i 's/collections\.Mapping/collections.abc.Mapping/g' /miniconda3/lib/python3.10/site-packages/sagemaker_containers/_mapping.py
21+
1422
# Install smdebug from source
1523
RUN python3 -m pip install git+https://github.com/awslabs/sagemaker-debugger.git@1.0.29
1624

@@ -20,7 +28,8 @@ RUN python3 -m pip install git+https://github.com/awslabs/sagemaker-debugger.git
2028
###########################
2129
COPY dist/sagemaker_xgboost_container-2.0-py2.py3-none-any.whl /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl
2230
RUN rm -rf /miniconda3/lib/python${PYTHON_VERSION}/site-packages/numpy-1.21.2.dist-info && \
23-
python3 -m pip install --no-cache /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl && \
31+
python3 -m pip install --force-reinstall PyYAML==6.0.1 && \
32+
python3 -m pip install --no-cache --no-deps /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl && \
2433
python3 -m pip uninstall -y typing && \
2534
rm /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl
2635

requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Flask==1.1.1 # sagemaker-containers requires flask 1.1.1
2-
PyYAML==5.4.1
2+
PyYAML==6.0.1
33
Pillow==9.1.1
44
boto3==1.17.52
55
botocore==1.20.52
@@ -8,10 +8,10 @@ dask==2022.11.1
88
dask-cuda==22.12.0
99
gunicorn==23.0.0
1010
itsdangerous==2.0.1
11-
matplotlib==3.4.1
11+
matplotlib==3.6.3
1212
multi-model-server==1.1.2
1313
numpy==1.24.1
14-
pandas==1.2.4
14+
pandas==1.4.4
1515
protobuf==3.20.1
1616
psutil==5.6.7 # sagemaker-containers requires psutil 5.6.7
1717
pynvml==11.4.1
@@ -20,8 +20,8 @@ retrying==1.3.3
2020
requests==2.29.0
2121
sagemaker-containers==2.8.6.post2
2222
sagemaker-inference==1.5.5
23-
scikit-learn==0.24.1
24-
scipy==1.8.0
23+
scikit-learn==1.0.2
24+
scipy==1.9.3
2525
urllib3==1.26.5
2626
wheel==0.36.2
2727
jinja2==2.11.3

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def read(fname):
3131
"Programming Language :: Python :: 3.7",
3232
"Programming Language :: Python :: 3.8",
3333
"Programming Language :: Python :: 3.9",
34+
"Programming Language :: Python :: 3.10",
3435
],
3536
install_requires=read("requirements.txt"),
3637
extras_require={"test": read("test-requirements.txt")},

test-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Flask==1.1.1 # sagemaker-containers requires flask 1.1.1
22
black
33
coverage
44
docker==6.1.3 # docker 7.0.0 has a breaking change: https://github.com/docker/docker-py/issues/3194#issuecomment-1848950456
5-
docker-compose
65
flake8
76
isort
87
mock

test/resources/versions/train.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
import pkg_resources
44

55
PYTHON_MAJOR_VERSION = 3
6-
PYTHON_MINOR_VERSION = 9
6+
PYTHON_MINOR_VERSION = 10
77
REQUIREMENTS = """\
88
Flask==1.1.1
99
Pillow==9.1.1
10-
PyYAML==5.4.1
10+
PyYAML==6.0.1
1111
boto3==1.17.52
1212
botocore==1.20.52
1313
conda==24.7.1
1414
cryptography==39.0.1
1515
gunicorn==23.0.0
16-
matplotlib==3.4.1
16+
matplotlib==3.6.3
1717
multi-model-server==1.1.2
1818
numpy==1.24.1
19-
pandas==1.2.4
19+
pandas==1.4.4
2020
psutil==5.6.7
2121
pyarrow==14.0.1
2222
python-dateutil==2.8.1
2323
retrying==1.3.3
2424
sagemaker-containers==2.8.6.post2
2525
sagemaker-inference==1.5.5
26-
scikit-learn==0.24.1
27-
scipy==1.8.0
26+
scikit-learn==1.0.2
27+
scipy==1.9.3
2828
smdebug==1.0.29
2929
urllib3==1.26.5
3030
wheel==0.36.2

0 commit comments

Comments
 (0)