Skip to content

Commit 5db204e

Browse files
Updates to Dockerfile for support of Python3.10 (#519)
* Updates to Dockerfile for support of Python3.10 * Add changelog entry --------- Co-authored-by: Michael Chin <chnmch@amazon.com>
1 parent 5274255 commit 5db204e

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Starting with v1.31.6, this file will contain a record of major features and upd
55
## Upcoming
66
- Added `--explain-type` option to `%%gremlin` ([Link to PR](https://github.com/aws/graph-notebook/pull/503))
77
- Added general documentation for `%%graph_notebook_config` options ([Link to PR](https://github.com/aws/graph-notebook/pull/504))
8+
- Modified Dockerfile to support Python 3.10 ([Link to PR](https://github.com/aws/graph-notebook/pull/519))
89
- Updated Docker documentation with platform-specific run commands ([Link to PR](https://github.com/aws/graph-notebook/pull/502))
910
- Fixed deprecation warnings in GitHub workflows ([Link to PR](https://github.com/aws/graph-notebook/pull/506))
1011
- Fixed seed dataset unzip path in Identity Graph sample notebook ([Link to PR](https://github.com/aws/graph-notebook/pull/507))

Dockerfile

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM amazonlinux:2
1+
FROM amazonlinux:2022
22

33
# Notebook Port
44
EXPOSE 8888
@@ -11,7 +11,8 @@ ENV pipargs=""
1111
ENV WORKING_DIR="/root"
1212
ENV NOTEBOOK_DIR="${WORKING_DIR}/notebooks"
1313
ENV EXAMPLE_NOTEBOOK_DIR="${NOTEBOOK_DIR}/Example Notebooks"
14-
ENV NODE_VERSION=14.x
14+
ENV NODE_VERSION=14
15+
ENV PYTHON_VERSION=3.10
1516
ENV GRAPH_NOTEBOOK_AUTH_MODE="DEFAULT"
1617
ENV GRAPH_NOTEBOOK_HOST="neptune.cluster-XXXXXXXXXXXX.us-east-1.neptune.amazonaws.com"
1718
ENV GRAPH_NOTEBOOK_PROXY_PORT="8192"
@@ -36,18 +37,18 @@ RUN mkdir -p "${WORKING_DIR}" && \
3637
mkdir -p "${EXAMPLE_NOTEBOOK_DIR}" && \
3738
# Yum Update and install dependencies
3839
yum update -y && \
39-
yum install tar gzip git amazon-linux-extras which -y && \
40+
yum install tar gzip git findutils -y && \
4041
# Install NPM/Node
41-
curl --silent --location https://rpm.nodesource.com/setup_${NODE_VERSION} | bash - && \
42-
yum install nodejs -y && \
43-
npm install -g opencollective && \
44-
# Install Python 3.8
45-
amazon-linux-extras install python3.8 -y && \
46-
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1 && \
42+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && \
43+
. ~/.nvm/nvm.sh && \
44+
nvm install ${NODE_VERSION} && \
45+
# Install Python
46+
yum install python${PYTHON_VERSION} -y && \
47+
# update-alternatives --install /usr/bin/python3 python3 /usr/bin/python${PYTHON_VERSION} 1 && \
4748
echo 'Using python version:' && \
48-
python3 --version && \
49-
python3 -m ensurepip --upgrade && \
50-
python3 -m venv /tmp/venv && \
49+
python${PYTHON_VERSION} --version && \
50+
python${PYTHON_VERSION} -m ensurepip --upgrade && \
51+
python${PYTHON_VERSION} -m venv /tmp/venv && \
5152
source /tmp/venv/bin/activate && \
5253
cd "${WORKING_DIR}" && \
5354
# Clone the repo and install python dependencies
@@ -67,14 +68,16 @@ RUN mkdir -p "${WORKING_DIR}" && \
6768
jupyter nbextension enable --py --sys-prefix graph_notebook.widgets && \
6869
# This allows for the `.ipython` to be set
6970
python -m graph_notebook.start_jupyterlab --jupyter-dir "${NOTEBOOK_DIR}" && \
71+
deactivate && \
7072
# Cleanup
7173
yum clean all && \
7274
yum remove wget tar git -y && \
7375
rm -rf /var/cache/yum && \
7476
rm -rf "${WORKING_DIR}/graph-notebook" && \
7577
rm -rf /root/.cache && \
7678
rm -rf /root/.npm/_cacache && \
77-
rm -rf /usr/share
79+
cd /usr/share && \
80+
rm -r $(ls -A | grep -v terminfo)
7881

7982
ADD "docker/Example-Remote-Server-Setup.ipynb" "${NOTEBOOK_DIR}/Example-Remote-Server-Setup.ipynb"
8083
ADD ./docker/service.sh /usr/bin/service.sh

0 commit comments

Comments
 (0)