diff --git a/Dockerfile b/Dockerfile index 7be91b59..df866614 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,35 +3,18 @@ FROM registry.access.redhat.com/ubi8/ubi-minimal:latest as python-base ENV PYTHONUNBUFFERED=1 \ - # prevents python creating .pyc files PYTHONDONTWRITEBYTECODE=1 \ - \ - # pip PIP_DISABLE_PIP_VERSION_CHECK=on \ PIP_DEFAULT_TIMEOUT=100 \ - \ - # poetry - # https://python-poetry.org/docs/configuration/#using-environment-variables - POETRY_VERSION=1.5.1 \ - # make poetry install to this location - POETRY_HOME="/opt/poetry" \ - # make poetry create the virtual environment in the project's root - # it gets named `.venv` - POETRY_VIRTUALENVS_IN_PROJECT=true \ - # do not ask any interactive question - POETRY_NO_INTERACTION=1 \ - \ - # paths - # this is where our requirements + virtual environment will live + # Paths for the virtual environment and working directory PYSETUP_PATH="/trestle-bot" \ VENV_PATH="/trestle-bot/.venv" LABEL maintainer="Red Hat Product Security" \ summary="Trestle Bot" - -# prepend poetry and venv to path -ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH" +# Ensure we use the virtualenv +ENV PATH="$VENV_PATH/bin:$PATH" RUN microdnf update -y \ && microdnf install -y python3.9 git \ @@ -40,28 +23,36 @@ RUN microdnf update -y \ FROM python-base as dependencies -# install poetry - respects $POETRY_VERSION & $POETRY_HOME +ARG POETRY_VERSION=1.5.1 + +# https://python-poetry.org/docs/configuration/#using-environment-variables +ENV POETRY_HOME="/opt/poetry" \ + POETRY_VIRTUALENVS_IN_PROJECT=true \ + POETRY_NO_INTERACTION=1 + +ENV PATH="$POETRY_HOME/bin:$PATH" + +# install poetry - respects $POETRY_HOME RUN python3.9 -m pip install --no-cache-dir --upgrade pip \ && pip install --no-cache-dir poetry=="$POETRY_VERSION" -# Cache runtime deps WORKDIR "/build" COPY . "/build" # Install runtime deps and install the project in non-editable mode. -RUN python -m venv $VENV_PATH && \ +RUN python3.9 -m venv $VENV_PATH && \ . $VENV_PATH/bin/activate && \ poetry install --without tests,dev --no-root && \ poetry build -f wheel -n && \ pip install --no-cache-dir --no-deps dist/*.whl && \ rm -rf dist *.egg-info -# final image + FROM python-base as final COPY --from=dependencies $PYSETUP_PATH $PYSETUP_PATH -# Add wrappers for entrypoints that provide support the actions +# Add wrappers for entrypoints that provide support for the actions COPY ./actions/autosync/auto-sync-entrypoint.sh / COPY ./actions/rules-transform/rules-transform-entrypoint.sh / COPY ./actions/create-cd/create-cd-entrypoint.sh / diff --git a/tests/integration/__init__.py b/tests/workflows/__init__.py similarity index 90% rename from tests/integration/__init__.py rename to tests/workflows/__init__.py index 35ab7fef..37bacefe 100644 --- a/tests/integration/__init__.py +++ b/tests/workflows/__init__.py @@ -13,4 +13,4 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. -"""Integration tests between different types of tasks classes.""" +"""Tests that validate workflow outcomes by model type.""" diff --git a/tests/integration/test_rules_transform_workflow.py b/tests/workflows/test_rules_transform_workflow.py similarity index 100% rename from tests/integration/test_rules_transform_workflow.py rename to tests/workflows/test_rules_transform_workflow.py