Skip to content

Commit

Permalink
Update to Python 3.11
Browse files Browse the repository at this point in the history
JIRA: RHELWF-9772
  • Loading branch information
hluk committed Sep 11, 2023
1 parent 5d8393b commit 55a3788
Show file tree
Hide file tree
Showing 6 changed files with 203 additions and 197 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/resultsdb.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
name: ResultsDB

on:
"on":
pull_request:
push:
workflow_dispatch:
Expand All @@ -12,13 +13,13 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9"]
python-version: ["3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down Expand Up @@ -78,9 +79,9 @@ jobs:
- Dockerfile

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: hadolint/hadolint-action@v1.5.0
- uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ${{ matrix.dockerfile }}
# Ignore list:
Expand All @@ -98,10 +99,10 @@ jobs:
GH_REGISTRY: ghcr.io/${{ github.actor }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
27 changes: 16 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi8/ubi:8.7 as builder
FROM registry.fedoraproject.org/fedora:38 as builder

# hadolint ignore=DL3033,DL4006,SC2039,SC3040
RUN set -exo pipefail \
Expand All @@ -7,29 +7,31 @@ RUN set -exo pipefail \
&& yum install -y \
--setopt install_weak_deps=false \
--nodocs \
--disablerepo=* \
--enablerepo=fedora,updates \
gcc \
krb5-devel \
openldap-devel \
python39 \
python39-devel \
python3 \
python3-devel \
# install runtime dependencies
&& yum install -y \
--installroot=/mnt/rootfs \
--releasever=8 \
--releasever=38 \
--setopt install_weak_deps=false \
--nodocs \
--disablerepo=* \
--enablerepo=fedora,updates \
krb5-libs \
mod_ssl \
openldap \
python39 \
python39-mod_wsgi \
python3 \
python3-mod_wsgi \
&& yum --installroot=/mnt/rootfs clean all \
&& rm -rf /mnt/rootfs/var/cache/* /mnt/rootfs/var/log/dnf* /mnt/rootfs/var/log/yum.* \
# https://python-poetry.org/docs/master/#installing-with-the-official-installer
&& curl -sSL https://install.python-poetry.org | python3 - \
&& python3 -m venv --system-site-packages /venv \
# compatibility with previous images
&& ln -s mod_wsgi-express-3.9 /mnt/rootfs/usr/bin/mod_wsgi-express-3
&& python3 -m venv --system-site-packages /venv

ENV \
PIP_DEFAULT_TIMEOUT=100 \
Expand Down Expand Up @@ -89,13 +91,16 @@ ENV \
WEB_CONCURRENCY=8

COPY --from=builder /mnt/rootfs/ /
COPY --from=builder /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo
COPY --from=builder \
/etc/yum.repos.d/fedora.repo \
/etc/yum.repos.d/fedora-updates.repo \
/etc/yum.repos.d/
WORKDIR /app

USER 1001
EXPOSE 5001
ENTRYPOINT ["/app/entrypoint.sh"]
CMD ["mod_wsgi-express-3.9", "start-server", "/usr/share/resultsdb/resultsdb.wsgi", \
CMD ["mod_wsgi-express-3", "start-server", "/usr/share/resultsdb/resultsdb.wsgi", \
"--user", "apache", "--group", "apache", \
"--port", "5001", "--threads", "5", \
"--include-file", "/etc/httpd/conf.d/resultsdb.conf", \
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Should you, for some reason avoid docker, you could run the following command (w
To use tox-docker with podman without requiring root, you can use
`tox-podman.sh` script that wraps `tox`::

$ ./tox-podman.sh -e py39
$ ./tox-podman.sh -e py311

## Deployment

Expand Down
Loading

0 comments on commit 55a3788

Please sign in to comment.