-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Upgrade to Python 3.11 and fix most existing vulnerabilities #7510
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
Draft
wtfiwtz
wants to merge
10
commits into
getredash:master
Choose a base branch
from
orchestrated-io:python-311-vulns
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dc8ea52
Upgrade python 3.10 libs (#12)
wtfiwtz ff5a42b
Upgrade python 3.11 libs (#13)
wtfiwtz 1511b27
Fix tests
wtfiwtz 104029f
Restore whitespace back
wtfiwtz 95bd334
Keep xmlschema on 2.x
wtfiwtz 3bd4bc3
Switch to Debian trixie
wtfiwtz 01641d8
Fix setuptools and upgrade simba ODBC
wtfiwtz 9ac9c3c
Upgrade werkzeug to 3.x
wtfiwtz fdd2045
Medium risk vuln python library updates
wtfiwtz 7f08253
Make trixie-proposed-updates optional
wtfiwtz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM node:18-bookworm AS frontend-builder | ||
FROM node:20-trixie AS frontend-builder | ||
|
||
RUN npm install --global --force [email protected] | ||
|
||
|
@@ -37,12 +37,15 @@ RUN <<EOF | |
fi | ||
EOF | ||
|
||
FROM python:3.10-slim-bookworm | ||
FROM python:3.11-slim-trixie | ||
|
||
EXPOSE 5000 | ||
|
||
RUN useradd --create-home redash | ||
|
||
# OPTIONAL: Add Debian trixie-proposed-updates repository to fix more recent vulnerabilities | ||
# RUN echo "deb http://deb.debian.org/debian trixie-proposed-updates main" > /etc/apt/sources.list.d/trixie-proposed-updates.list | ||
|
||
# Ubuntu packages | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
|
@@ -74,11 +77,11 @@ RUN apt-get update && \ | |
|
||
|
||
ARG TARGETPLATFORM | ||
ARG databricks_odbc_driver_url=https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/odbc/2.6.26/SimbaSparkODBC-2.6.26.1045-Debian-64bit.zip | ||
ARG databricks_odbc_driver_url=https://databricks-bi-artifacts.s3.us-east-2.amazonaws.com/simbaspark-drivers/odbc/2.9.2/SimbaSparkODBC-2.9.2.1008-Debian-64bit.zip | ||
RUN <<EOF | ||
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then | ||
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor -o /usr/share/keyrings/microsoft-prod.gpg | ||
curl https://packages.microsoft.com/config/debian/12/prod.list > /etc/apt/sources.list.d/mssql-release.list | ||
curl https://packages.microsoft.com/config/debian/13/prod.list > /etc/apt/sources.list.d/mssql-release.list | ||
apt-get update | ||
ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql18 | ||
apt-get clean | ||
|
@@ -98,18 +101,20 @@ WORKDIR /app | |
ENV POETRY_VERSION=1.8.3 | ||
ENV POETRY_HOME=/etc/poetry | ||
ENV POETRY_VIRTUALENVS_CREATE=false | ||
ENV PIP_PREFER_BINARY=1 | ||
RUN curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
# Avoid crashes, including corrupted cache artifacts, when building multi-platform images with GitHub Actions. | ||
RUN /etc/poetry/bin/poetry cache clear pypi --all | ||
|
||
# Use BuildKit cache mount for Poetry cache to speed up builds | ||
COPY pyproject.toml poetry.lock ./ | ||
|
||
ARG POETRY_OPTIONS="--no-root --no-interaction --no-ansi" | ||
ARG POETRY_OPTIONS="--no-root --no-ansi --no-interaction" | ||
# for LDAP authentication, install with `ldap3` group | ||
# disabled by default due to GPL license conflict | ||
ARG install_groups="main,all_ds,dev" | ||
RUN /etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS | ||
RUN --mount=type=cache,target=/root/.cache/pypoetry \ | ||
/etc/poetry/bin/poetry install --only $install_groups $POETRY_OPTIONS && \ | ||
/etc/poetry/bin/poetry add "setuptools@latest" | ||
RUN rm -rf /etc/poetry/venv/lib/python3.11/site-packages/setuptools-65.5.0.dist-info/ | ||
|
||
COPY --chown=redash . /app | ||
COPY --from=frontend-builder --chown=redash /frontend/client/dist /app/client/dist | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,14 @@ x-redash-service: &redash-service | |
context: . | ||
args: | ||
skip_frontend_build: "true" # set to empty string to build | ||
# Enable BuildKit for faster builds with cache mounts | ||
dockerfile: Dockerfile | ||
volumes: | ||
- .:/app | ||
env_file: | ||
- .env | ||
x-redash-environment: &redash-environment | ||
REDASH_HOST: http://localhost:5001 | ||
REDASH_HOST: http://localhost:5000 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is 5001 now the default? Restore this. |
||
REDASH_LOG_LEVEL: "INFO" | ||
REDASH_REDIS_URL: "redis://redis:6379/0" | ||
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" | ||
|
@@ -29,7 +31,7 @@ services: | |
- postgres | ||
- redis | ||
ports: | ||
- "5001:5000" | ||
- "5000:5000" | ||
- "5678:5678" | ||
environment: | ||
<<: *redash-environment | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still required?