Skip to content

chore: build images using python 3.12 #510

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

Closed
wants to merge 3 commits into from
Closed
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ main ]

env:
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.12"
PIPELINE_FAMILY: "general"

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
PACKAGE: "unstructured-api"
PIPELINE_FAMILY: "general"
PIP_VERSION: "25.1.1"
PYTHON_VERSION: "3.10"
PYTHON_VERSION: "3.12"

jobs:
setup:
Expand Down
10 changes: 8 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
# syntax=docker/dockerfile:experimental
FROM quay.io/unstructured-io/base-images:wolfi-base-latest as base
FROM cgr.dev/chainguard/wolfi-base as base

RUN apk add python-3.12
RUN python3.12 -m ensurepip

# NOTE(crag): NB_USER ARG for mybinder.org compat:
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
ARG NB_USER=notebook-user
ARG NB_UID=1000
ARG PIP_VERSION
ARG PIPELINE_PACKAGE
ARG PYTHON_VERSION="3.11"
ARG PYTHON_VERSION="3.12"

# Set up environment
ENV PYTHON python${PYTHON_VERSION}
ENV PIP ${PYTHON} -m pip

RUN adduser -u ${NB_UID} -D ${NB_USER}
ENV HOME=/home/${NB_USER}

WORKDIR ${HOME}
USER ${NB_USER}

Expand Down
10 changes: 5 additions & 5 deletions docker/rockylinux-9.4/Dockerfile
Copy link
Author

Choose a reason for hiding this comment

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

Are we still using this image?

Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ ENV PATH="/home/${NB_USER}/.local/bin:${PATH}"
FROM base as python-deps
# COPY requirements/dev.txt requirements-dev.txt
COPY requirements/base.txt requirements-base.txt
RUN python3.10 -m pip install pip==${PIP_VERSION} \
RUN python3.12 -m pip install pip==${PIP_VERSION} \
&& dnf -y groupinstall "Development Tools" \
&& su -l ${NB_USER} -c 'pip3.10 install --no-cache -r requirements-base.txt' \
&& su -l ${NB_USER} -c 'pip3.12 install --no-cache -r requirements-base.txt' \
&& dnf -y groupremove "Development Tools" \
&& dnf clean all \
&& ln -s /home/notebook-user/.local/bin/pip3.10 /usr/local/bin/pip3.10 || true
&& ln -s /home/notebook-user/.local/bin/pip3.12 /usr/local/bin/pip3.12 || true

USER ${NB_USER}

FROM python-deps as model-deps
RUN python3.10 -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \
python3.10 -c "from unstructured.partition.model_init import initialize; initialize()"
RUN python3.12 -c "from unstructured.nlp.tokenize import download_nltk_packages; download_nltk_packages()" && \
python3.12 -c "from unstructured.partition.model_init import initialize; initialize()"

FROM model-deps as code
COPY --chown=${NB_USER}:${NB_USER} CHANGELOG.md CHANGELOG.md
Expand Down