Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ demo.py
*.pt
*.md
*.sh
*.yaml
*.yaml
.git
15 changes: 0 additions & 15 deletions .github/workflows/build-publish-latest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,6 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4

- name: Set up python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: '2.2.1'
plugins: poetry-plugin-export

- name: Export requirements
run: |
poetry export -o requirements.txt --without-hashes

- name: Login to Docker Hub
uses: docker/login-action@v3
Expand Down
15 changes: 0 additions & 15 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Set up python
uses: actions/setup-python@v6
with:
python-version: '3.13'

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: '2.2.1'
plugins: poetry-plugin-export

- name: Export requirements
run: |
poetry export -o requirements.txt --without-hashes

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: PR Build with Poetry
runs-on: [self-hosted, linux, X64]
container:
image: starwitorg/base-python-image:3.13.0
image: starwitorg/base-python-image:3.13.2-py3.13-ptr2.3.4
volumes:
- /home/githubrunner/.cache/pypoetry:/root/.cache/pypoetry
steps:
Expand Down
30 changes: 11 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# You must run `poetry export` before building this
FROM python:3.13-slim AS build
FROM starwitorg/base-python-image:3.13.2-py3.13-ptr2.3.4 AS build

RUN apt update && apt install --no-install-recommends -y \
build-essential \
git

# This needs to be generated with poetry export
COPY requirements.txt ./
# Copy only files that are necessary to install dependencies
COPY poetry.lock poetry.toml pyproject.toml /code/

RUN pip wheel --no-cache-dir --no-deps -r requirements.txt -w /wheels
WORKDIR /code
RUN poetry install

# Copy the rest of the project
COPY . /code/

FROM python:3.13-slim

Expand All @@ -20,17 +19,10 @@ RUN apt update && apt install --no-install-recommends -y \

RUN addgroup --system appgroup && adduser --system --ingroup appgroup appuser

WORKDIR /code

# This needs to be generated with poetry export (same file as above)
COPY requirements.txt ./
COPY --from=build --chown=appuser:appgroup /code /code

# This should be fine if and only if the wheels are generated based on the poetry exported requirements.txt (see above)
RUN --mount=type=bind,from=build,source=/wheels,target=/wheels \
pip install /wheels/*

COPY --chown=appuser:appgroup main.py ./
COPY --chown=appuser:appgroup ./objecttracker ./objecttracker
WORKDIR /code

USER appuser
ENV PATH="/code/.venv/bin:$PATH"
CMD [ "python", "main.py" ]
2 changes: 0 additions & 2 deletions docker_build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/bin/bash

poetry export -o requirements.txt --without-hashes

docker build -t starwitorg/sae-object-tracker:local .

# Run with other components from the SAE compose project (set redis host to `redis`):
Expand Down
Loading