-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes unused files.
- Loading branch information
Showing
49 changed files
with
1,847 additions
and
2,285 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[run] | ||
branch = True | ||
include = | ||
waiverdb/* | ||
|
||
[report] | ||
fail_under = 75 | ||
exclude_lines = | ||
pragma: no cover | ||
if __name__ == .__main__.: | ||
omit = | ||
waiverdb/wsgi.py | ||
waiverdb/migrations/* |
This file contains 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
This file contains 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 |
---|---|---|
|
@@ -17,3 +17,4 @@ dist | |
.pytest_cache/ | ||
docker/home/ | ||
.idea | ||
.coverage |
This file contains 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
This file contains 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,43 +1,79 @@ | ||
FROM registry.fedoraproject.org/fedora:34 AS builder | ||
FROM registry.access.redhat.com/ubi8/ubi:8.5 as builder | ||
|
||
RUN dnf -y install --nodocs --setopt=install_weak_deps=false \ | ||
'dnf-command(builddep)' \ | ||
git-core \ | ||
rpm-build \ | ||
&& dnf -y clean all | ||
# hadolint ignore=DL3033,DL4006,SC2039,SC3040 | ||
RUN set -exo pipefail \ | ||
&& mkdir -p /mnt/rootfs \ | ||
# install builder dependencies | ||
&& yum install -y \ | ||
--setopt install_weak_deps=false \ | ||
--nodocs \ | ||
gcc \ | ||
krb5-devel \ | ||
openldap-devel \ | ||
python39 \ | ||
python39-devel \ | ||
# install runtime dependencies | ||
&& yum install -y \ | ||
--installroot=/mnt/rootfs \ | ||
--releasever=8 \ | ||
--setopt install_weak_deps=false \ | ||
--nodocs \ | ||
python39 \ | ||
&& 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 /venv | ||
|
||
COPY .git /src/.git | ||
ENV \ | ||
PIP_DEFAULT_TIMEOUT=100 \ | ||
PIP_DISABLE_PIP_VERSION_CHECK=1 \ | ||
PIP_NO_CACHE_DIR=1 \ | ||
PYTHONFAULTHANDLER=1 \ | ||
PYTHONHASHSEED=random \ | ||
PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /src | ||
RUN git reset --hard HEAD \ | ||
&& dnf -y builddep waiverdb.spec \ | ||
&& ./rpmbuild.sh -bb \ | ||
&& rm /src/rpmbuild-output/*/waiverdb-cli-* | ||
WORKDIR / | ||
WORKDIR /build | ||
COPY . . | ||
# hadolint ignore=SC1091 | ||
RUN set -ex \ | ||
&& export PATH=/root/.local/bin:$PATH \ | ||
&& . /venv/bin/activate \ | ||
&& pip install --no-cache-dir -r requirements.txt \ | ||
&& poetry build --format=wheel \ | ||
&& version=$(poetry version --short) \ | ||
&& pip install --no-cache-dir dist/waiverdb-"$version"-py3*.whl \ | ||
&& deactivate \ | ||
&& mv /venv /mnt/rootfs \ | ||
&& mkdir -p /mnt/rootfs/app /etc/waiverdb \ | ||
&& cp -v docker/docker-entrypoint.sh /mnt/rootfs/app/entrypoint.sh \ | ||
&& cp conf/settings.py.example /etc/waiverdb/settings.py \ | ||
&& cp conf/client.conf.example /etc/waiverdb/client.conf | ||
|
||
FROM registry.fedoraproject.org/fedora:34 | ||
# --- Final image | ||
FROM scratch | ||
ARG GITHUB_SHA | ||
LABEL \ | ||
name="waiverdb" \ | ||
maintainer="WaiverDB developers" \ | ||
description="WaiverDB application" \ | ||
vendor="WaiverDB developers" \ | ||
license="GPLv2+" | ||
summary="WaiverDB application" \ | ||
description="An engine for storing waivers against test results." \ | ||
maintainer="Red Hat, Inc." \ | ||
license="GPLv2+" \ | ||
url="https://github.com/release-engineering/waiverdb" \ | ||
vcs-type="git" \ | ||
vcs-ref=$GITHUB_SHA \ | ||
io.k8s.display-name="WaiverDB" | ||
|
||
COPY --from=builder /src/rpmbuild-output /src/rpmbuild-output | ||
COPY conf/settings.py.example /etc/waiverdb/settings.py | ||
COPY conf/client.conf.example /etc/waiverdb/client.conf | ||
COPY docker /docker | ||
ENV \ | ||
PYTHONFAULTHANDLER=1 \ | ||
PYTHONHASHSEED=random \ | ||
PYTHONUNBUFFERED=1 \ | ||
WEB_CONCURRENCY=8 | ||
|
||
# Allow a non-root user to install a custom root CA at run-time | ||
RUN chmod g+w /etc/pki/tls/certs/ca-bundle.crt \ | ||
&& dnf -y install \ | ||
python3-gunicorn \ | ||
python3-ldap \ | ||
/src/rpmbuild-output/*/*.rpm \ | ||
&& dnf -y clean all \ | ||
&& rm -r /src | ||
COPY --from=builder /mnt/rootfs/ / | ||
COPY --from=builder /etc/yum.repos.d/ubi.repo /etc/yum.repos.d/ubi.repo | ||
WORKDIR /app | ||
|
||
USER 1001 | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/docker/docker-entrypoint.sh"] | ||
CMD ["/usr/bin/gunicorn-3", "--bind", "0.0.0.0:8080", "--access-logfile", "-", "--enable-stdio-inheritance", "waiverdb.wsgi:app"] | ||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--access-logfile", "-", "--enable-stdio-inheritance", "waiverdb.wsgi:app"] |
Oops, something went wrong.