Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Upgrade python to 3.12.2 #34

Draft
wants to merge 2 commits into
base: nightly
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/20240322_111437_fahad.khalid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- 💥[Feature] Upgrade Python version to 3.12.2 (by @Fahadkhalid210)
17 changes: 15 additions & 2 deletions tutorcairn/templates/cairn/build/cairn-clickhouse/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ FROM docker.io/yandex/clickhouse-server:22.1.3.7
# curl https://repo.yandex.ru/clickhouse/deb/stable/
# The above command should be a 200, and not a 404.
RUN rm /etc/apt/sources.list.d/clickhouse.list
RUN apt update && apt install -y python3
RUN apt update && apt install -y git build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev

COPY ./scripts /scripts
RUN chmod a+x /scripts/*
ENV PATH /scripts:${PATH}
# Install pyenv
# https://www.python.org/downloads/
# https://github.com/pyenv/pyenv/releases
ARG PYTHON_VERSION=3.12.2
ENV PYENV_ROOT /opt/pyenv
RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1
# Install Python
RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION
RUN $PYENV_ROOT/bin/pyenv global $PYTHON_VERSION

ENV PATH /opt/pyenv/shims:/opt/pyenv/bin:/scripts:${PATH}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need 2 levels of path here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this, we are getting python 3.8 version when we check python version inside container. Including both /opt/pyenv/shims and /opt/pyenv/bin ensures that both the shims and the actual Python binaries managed by pyenv are accessible and utilized correctly within the Docker container.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are pulling python 3.8 because the clickhouse-server image is based on ubuntu 22.04:

$ docker run --rm -it docker.io/clickhouse/clickhouse-server:24.1.8 uname -a
ClickHouse Database directory appears to contain a database; Skipping initialization
Linux 327ee7036a61 6.5.0-26-generic #26~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Mar 12 10:22:43 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Let's not attempt to install python 3.12 in this image. We should just wait until the base image is upgraded to ubuntu 24.04 upstream.

Moreover, note that the image was moved from docker.io/yandex/clickhouse-server to docker.io/clickhouse/clickhouse-server: https://hub.docker.com/r/clickhouse/clickhouse-server/tags

See this issue: #30