Skip to content

Commit

Permalink
Fix Python 3.10.13 container (#215)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kilo59 committed Apr 19, 2024
1 parent 4e5ff05 commit db45bd6
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,34 @@ jobs:
slug: great-expectations/cloud
flags: ${{ matrix.python-version }}

test-docker-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache-dependency-path: poetry.lock

- name: Load cached Poetry installation
id: cached-poetry
uses: actions/cache@v4
with:
path: ~/.local # the path depends on the OS
key: poetry-3.10 # increment to reset cache

- name: Install Poetry
if: steps.cached-poetry.outputs.cache-hit != 'true'
uses: snok/install-poetry@v1

- name: Install dependencies
run: poetry install --sync --only dev

- run: poetry run invoke docker --no-pty

check-if-agent-changed:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'schedule' }}
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10.12-slim
FROM python:3.10.13-slim
WORKDIR /app/

# File Structure:
Expand All @@ -19,9 +19,9 @@ ENV PYTHONUNBUFFERED=1
ENV POETRY_CACHE_DIR=/tmp/pypoetry

# Required for arm64, for building psutil
RUN apt-get update && apt-get install --no-install-recommends gcc=4:12.2.0-3 -y && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install --no-install-recommends python3-dev=3.11.2-1+b1 gcc=4:12.2.0-3 -y && rm -rf /var/lib/apt/lists/*

RUN pip --no-cache-dir install poetry==1.6.1
RUN pip --no-cache-dir install poetry==1.8.2

COPY pyproject.toml poetry.lock ./

Expand Down
4 changes: 3 additions & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,15 @@ def lint(ctx: Context, check: bool = False, unsafe_fixes: bool = False) -> None:
help={
"check": "Lint Dockerfile using hadolint tool",
"run": "Run the Docker container. Inject .env file",
"pty": "Use a pseudo-terminal for the Docker command (default: True)",
},
)
def docker(
ctx: Context,
check: bool = False,
run: bool = False,
tag: str = "greatexpectations/agent:develop",
pty: bool = True,
) -> None:
"""
Docker tasks
Expand Down Expand Up @@ -114,7 +116,7 @@ def docker(
else:
cmds = ["docker", "build", "-f", DOCKERFILE_PATH, "-t", tag, "."]

ctx.run(" ".join(cmds), echo=True, pty=True)
ctx.run(" ".join(cmds), echo=True, pty=pty)


@invoke.task(
Expand Down

0 comments on commit db45bd6

Please sign in to comment.