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

Enhancement: Python 3.12 upgrade #67

Merged

Conversation

Faraz32123
Copy link
Collaborator

@Faraz32123 Faraz32123 commented Mar 14, 2024

close #62

@Faraz32123 Faraz32123 self-assigned this Mar 14, 2024
@Faraz32123 Faraz32123 changed the base branch from master to nightly March 14, 2024 08:44
Copy link

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

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

I have not tested it on local yet, but the changes look good.

ModuleNotFoundError: No module named '_sqlite3'
fixed above error on line
>>> RUN python manage.py compilemessages
@@ -27,15 +27,26 @@ WORKDIR /openedx/discovery
RUN echo "{}" > /openedx/config.yml
ENV DISCOVERY_CFG /openedx/config.yml

# Install python venv
RUN python3 -m venv ../venv/
# Install pyenv
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we inherit FROM the python:3.12-bookworm image instead of installing python manually with pyenv? These steps make the build more complex, and I'd rather not use them if possible at all.

Choose a reason for hiding this comment

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

P.S. this is on my todo list to test out python build using python images. That can be done in a followup PR, in my opinion (once tested).
Why do we want to use bookworm specifically? why not slim?

@hinakhadim
Copy link

@regisb @DawoudSheraz Tested on my local system and Image building is successful using this branch.
Tutor core: nightly branch
course-discovery: master branch

Copy link

@DawoudSheraz DawoudSheraz left a comment

Choose a reason for hiding this comment

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

Tested locally, image builds as expected.

 => [minimal  7/19] RUN echo "{}" > /openedx/config.yml                                                                          0.2s
 => ERROR [minimal  8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1                     0.4s
------
 > importing cache manifest from docker.io/overhangio/openedx-discovery:17.0.0-nightly-cache:
------
------
 > [minimal  8/19] RUN git clone https://github.com/pyenv/pyenv /opt/pyenv --branch v2.3.36 --depth 1:
0.341 fatal: could not create work tree dir '/opt/pyenv': Permission denied
------
Dockerfile:36
--------------------
  34 |     ENV PYENV_ROOT /opt/pyenv
  35 |     # USER root
  36 | >>> RUN git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1
  37 |     # Install Python
  38 |     RUN $PYENV_ROOT/bin/pyenv install $PYTHON_VERSION
--------------------
ERROR: failed to solve: process "/bin/sh -c git clone https://github.com/pyenv/pyenv $PYENV_ROOT --branch v2.3.36 --depth 1" did not complete successfully: exit code: 128
@DawoudSheraz DawoudSheraz requested a review from regisb April 9, 2024 06:51
@DawoudSheraz
Copy link

@Faraz32123 you should be good to merge this for now. We can work on using python image in a followup PR.

@Faraz32123 Faraz32123 merged commit 34691b5 into overhangio:nightly May 2, 2024
@Faraz32123 Faraz32123 deleted the enhancement/python_upgrade_to_v3.12.2 branch May 2, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

tutor-discovery codebase Python 3.12 upgrade
4 participants