Skip to content

Commit dd07b38

Browse files
e-davidsonEli Davidson
and
Eli Davidson
authored
upgrade python to 3.9 (#440)
* upgrade python to 3.9 * dont require python 3.9 to build * bump version in test * update conda version in test * pin numba to 0.59 * use numba 0.58 for ci/cd --------- Co-authored-by: Eli Davidson <[email protected]>
1 parent 3587c21 commit dd07b38

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

docker/1.7-1/base/Dockerfile.cpu

+9-9
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ ARG IMAGE_DIGEST=c2d95c9c6ff77da41cf0f2f9e8c5088f5b4db20c16a7566b808762f05b9032e
44

55
FROM nvidia/cuda:${CUDA_VERSION}-base-ubuntu${UBUNTU_VERSION}@sha256:${IMAGE_DIGEST}
66

7-
ARG MINICONDA_VERSION=4.9.2
7+
ARG MINICONDA_VERSION=24.7.1
8+
ARG CONDA_CHECKSUM=2006a61abc8b4fd04de5eb92620e1f72bada713cc84b5b4899463095e1210556
89
ARG CONDA_PY_VERSION=39
9-
ARG CONDA_CHECKSUM="b4e46fcc8029e2cfa731b788f25b1d36"
10-
ARG CONDA_PKG_VERSION=4.10.1
11-
ARG PYTHON_VERSION=3.8.19
10+
ARG CONDA_PKG_VERSION=24.7.1
11+
ARG PYTHON_VERSION=3.9
1212
ARG PYARROW_VERSION=14.0.1
1313
ARG MLIO_VERSION=0.9.0
1414
ARG XGBOOST_VERSION=1.7.4
@@ -80,8 +80,8 @@ RUN apt-key del 7fa2af80 && \
8080

8181
# Install conda
8282
RUN cd /tmp && \
83-
curl -L --output /tmp/Miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-py${CONDA_PY_VERSION}_${MINICONDA_VERSION}-Linux-x86_64.sh && \
84-
echo "${CONDA_CHECKSUM} /tmp/Miniconda3.sh" | md5sum -c - && \
83+
curl -L --output /tmp/Miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-py${CONDA_PY_VERSION}_${MINICONDA_VERSION}-0-Linux-x86_64.sh && \
84+
echo "${CONDA_CHECKSUM} /tmp/Miniconda3.sh" | sha256sum -c - && \
8585
bash /tmp/Miniconda3.sh -bfp /miniconda3 && \
8686
rm /tmp/Miniconda3.sh
8787

@@ -96,11 +96,11 @@ RUN echo "conda ${CONDA_PKG_VERSION}" >> /miniconda3/conda-meta/pinned && \
9696
conda config --system --set auto_update_conda false && \
9797
conda config --system --set show_channel_urls true && \
9898
echo "python ${PYTHON_VERSION}.*" >> /miniconda3/conda-meta/pinned && \
99-
conda install -c conda-forge python=${PYTHON_VERSION} && \
99+
conda install -c conda-forge python=${PYTHON_VERSION} --solver classic && \
100100
pip install requests==2.27.0 && \
101-
conda install conda=${CONDA_PKG_VERSION} && \
101+
conda install conda=${CONDA_PKG_VERSION} --solver classic && \
102102
conda update -y conda && \
103-
conda install -c conda-forge pyarrow=${PYARROW_VERSION} && \
103+
conda install -c conda-forge pyarrow=${PYARROW_VERSION} --solver classic && \
104104
cd /tmp && \
105105
git clone --branch v${MLIO_VERSION} https://github.com/awslabs/ml-io.git mlio && \
106106
cd mlio && \

docker/1.7-1/final/Dockerfile.cpu

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG SAGEMAKER_XGBOOST_VERSION=1.7-1
2-
ARG PYTHON_VERSION=3.8
2+
ARG PYTHON_VERSION=3.9
33

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

@@ -19,7 +19,7 @@ RUN python3 -m pip install git+https://github.com/awslabs/sagemaker-debugger.git
1919
# Copy wheel to container #
2020
###########################
2121
COPY dist/sagemaker_xgboost_container-2.0-py2.py3-none-any.whl /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl
22-
RUN rm -rf /miniconda3/lib/python3.8/site-packages/numpy-1.21.2.dist-info && \
22+
RUN rm -rf /miniconda3/lib/python${PYTHON_VERSION}/site-packages/numpy-1.21.2.dist-info && \
2323
python3 -m pip install --no-cache /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl && \
2424
python3 -m pip uninstall -y typing && \
2525
rm /sagemaker_xgboost_container-1.0-py2.py3-none-any.whl

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ MarkupSafe==1.1.1
2929
Werkzeug==0.15.6
3030
certifi==2023.7.22
3131
gevent==23.9.1
32+
numba==0.58.1

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ def read(fname):
3030
"Programming Language :: Python :: 3.6",
3131
"Programming Language :: Python :: 3.7",
3232
"Programming Language :: Python :: 3.8",
33+
"Programming Language :: Python :: 3.9",
3334
],
3435
install_requires=read("requirements.txt"),
3536
extras_require={"test": read("test-requirements.txt")},
@@ -38,5 +39,5 @@ def read(fname):
3839
"serve=sagemaker_xgboost_container.serving:serving_entrypoint",
3940
]
4041
},
41-
python_requires=">=3.6",
42+
python_requires=">=3.8",
4243
)

src/sagemaker_xgboost_container/dmlc_patch/tracker.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,11 @@ def run():
392392
self.thread.start()
393393

394394
def join(self):
395-
while self.thread.isAlive():
395+
while self.thread.is_alive():
396396
self.thread.join(1)
397397

398398
def alive(self):
399-
return self.thread.isAlive()
399+
return self.thread.is_alive()
400400

401401

402402
class PSTracker(object):
@@ -437,7 +437,7 @@ def __init__(self, hostIP, cmd, port=9091, port_end=9999, envs=None):
437437

438438
def join(self):
439439
if self.cmd is not None:
440-
while self.thread.isAlive():
440+
while self.thread.is_alive():
441441
self.thread.join(100)
442442

443443
def slave_envs(self):

test/resources/versions/train.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
import pkg_resources
44

55
PYTHON_MAJOR_VERSION = 3
6-
PYTHON_MINOR_VERSION = 8
6+
PYTHON_MINOR_VERSION = 9
77
REQUIREMENTS = """\
88
Flask==1.1.1
99
Pillow==9.1.1
1010
PyYAML==5.4.1
1111
boto3==1.17.52
1212
botocore==1.20.52
13-
conda==4.10.1
13+
conda==24.7.1
1414
cryptography==39.0.1
1515
gunicorn==19.10.0
1616
matplotlib==3.4.1

0 commit comments

Comments
 (0)