googlecloudplatform-perfkitbenchmarker
SUCCESS
8m 28s
History Source
SummaryIterations1Transcript10Dockerfile
01Iteration 1
WRITEWriteFile· step #1
0s
Dockerfile622 chars
text24 lines · 622 chars
ARG PYTHON_VERSION=3.9

FROM python:${PYTHON_VERSION}

WORKDIR /pkb

SHELL ["/bin/bash", "-c"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Run tests in isolation
CMD set -Eeuo pipefail; for test in $(find tests/ | grep "test.py"); do echo ; echo "Running $test ...";  python -m unittest $test -v ; done
WRITEWriteFile· step #2
0s
Dockerfile589 bytes written
text22 lines · 589 chars
FROM python:3.9-slim

WORKDIR /pkb

SHELL ["/bin/bash", "-c"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Run tests in isolation
CMD set -Eeuo pipefail; for test in $(find tests/ | grep "test.py"); do echo ; echo "Running $test ...";  python -m unittest $test -v ; done
WRITEWriteFile· step #3
0s
.dockerignore157 bytes written
dockerignore20 lines · 157 chars
__pycache__/
*.pyc
*.pyo
*.pyd
*.egg-info/
build/
dist/
downloads/
*.egg
*.egg-info
.eggs
*.log
*.tmp
.vscode/
.env
venv/
*/__pycache__/
node_modules/
.git/
VERIFYVerifyBuild· step #4
43s
VerifyBuildrejected
Concerns: CMD uses Bash-specific options (set -Eeuo pipefail) but the default CMD runs under /bin/sh, which will likely cause the container to fail to start due to an invalid set command., The Dockerfile does not install the CLI package entrypoint itself (no 'pip install -e .' or similar). This means the actual CLI binary/entrypoint may not be available in PATH, so the container may not exercise the CLI even if tests run., Test invocation in CMD is brittle: it relies on finding test.py files with find/grep and passes file paths to python -m unittest. This can break with spaces in paths or changes in test layout. A more robust approach is to use unittest discover or a dedicated test script.
WRITEWriteFile· step #5
0s
Dockerfile757 chars
text27 lines · 757 chars
ARG PYTHON_VERSION=3.9

FROM python:${PYTHON_VERSION}-slim

WORKDIR /pkb

SHELL ["/bin/bash", "-lc"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Optionally install the package in editable mode if setup.py exists
RUN if [ -f setup.py ]; then pip install --no-cache-dir -e .; else echo "No setup.py found, skipping editable install"; fi

# Run tests in isolation
CMD ["bash","-lc","set -euo pipefail; python -m unittest discover -v tests"]
WRITEWriteFile· step #6
0s
Dockerfile719 bytes written
text25 lines · 719 chars
FROM python:3.9-slim

WORKDIR /pkb

SHELL ["/bin/bash", "-lc"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Optionally install the package in editable mode if setup.py exists
RUN if [ -f setup.py ]; then pip install --no-cache-dir -e .; else echo "No setup.py found, skipping editable install"; fi

# Run tests in isolation
CMD ["bash","-lc","set -euo pipefail; python -m unittest discover -v tests"]
VERIFYVerifyBuild· step #7
2m 37s
VerifyBuildsmoke_failed
Concerns: Potential missing python3-dev could block building some Python package wheels that require Python headers; not necessarily fatal for all repos, but a possible pitfall.
Smoke [PASS]: python -V
Smoke [FAIL]: python -c \"import sys; print('ok', sys.version.split()[0])\
  Output: sh: 1: Syntax error: word unexpected (expecting ")")

Smoke [PASS]: python -m unittest discover -v tests
READReadFile· step #8
0s
Dockerfile719 chars · 25 lines
text25 lines · 719 chars
FROM python:3.9-slim

WORKDIR /pkb

SHELL ["/bin/bash", "-lc"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends build-essential ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Optionally install the package in editable mode if setup.py exists
RUN if [ -f setup.py ]; then pip install --no-cache-dir -e .; else echo "No setup.py found, skipping editable install"; fi

# Run tests in isolation
CMD ["bash","-lc","set -euo pipefail; python -m unittest discover -v tests"]
WRITEWriteFile· step #9
0s
Dockerfile744 bytes written
text26 lines · 744 chars
FROM python:3.9-slim

WORKDIR /pkb

SHELL ["/bin/bash", "-lc"]

# Install system dependencies needed for building Python wheels
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      build-essential python3-dev libffi-dev libssl-dev ca-certificates && \
    rm -rf /var/lib/apt/lists/*

COPY requirements.txt /pkb/

RUN pip install --no-cache-dir -r requirements.txt

COPY . /pkb/

RUN pip install --no-cache-dir -r requirements-testing.txt

# Optionally install the package in editable mode if setup.py exists
RUN if [ -f setup.py ]; then pip install --no-cache-dir -e .; else echo "No setup.py found, skipping editable install"; fi

# Run tests in isolation
CMD ["bash", "-lc", "python -m unittest discover -v tests"]
VERIFYVerifyBuild· step #10
2m 14s
VerifyBuildaccepted
Concerns: If the project uses pyproject.toml instead of setup.py, the editable install step will be skipped; tests may rely on an installed package., No explicit CLI binary smoke test is included; the container's smoke test relies on running the test suite.
Smoke [PASS]: python -m unittest discover -v tests