Skip to content

Commit

Permalink
Merge pull request #7 from moriyalab/support_new_docker_system
Browse files Browse the repository at this point in the history
Support New Docker System
  • Loading branch information
TakanoTaiga authored Nov 3, 2024
2 parents b74cc32 + 3ef78d5 commit 2e1824f
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 168 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Docker Build and Push to GHCR
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-22.04

steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false

- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to GitHub Container Registry
if: github.event_name == 'push'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}_dev:latest --target builder_image .
docker build -t ghcr.io/${{ github.repository }}:latest --target release_image .
- name: Push Docker image
if: github.event_name == 'push'
run: |
docker push ghcr.io/${{ github.repository }}_dev:latest
docker push ghcr.io/${{ github.repository }}:latest
70 changes: 0 additions & 70 deletions .github/workflows/docker_check.yml

This file was deleted.

80 changes: 0 additions & 80 deletions .github/workflows/docker_release.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
*.png
*.onnx
*.engine
*.mcap

flagged*/
19 changes: 19 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ultralytics/ultralytics:8.2.63 AS builder_image

RUN apt-get update && apt-get install -y git curl ffmpeg
RUN git config --global --add safe.directory /app
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install poetry \
&& poetry config virtualenvs.create false

WORKDIR /app

COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root

FROM builder_image AS release_image

COPY --from=builder_image /app /app
COPY . /app/

CMD [ "python3", "app.py" ]
File renamed without changes.
14 changes: 0 additions & 14 deletions docker/Dockerfile.x86

This file was deleted.

File renamed without changes.
3 changes: 0 additions & 3 deletions poetylock.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#!/bin/bash

cp /home/root/docker/pyproject.toml /app/pyproject.toml
cd /app
poetry lock --no-update
rm -rf /home/root/docker/poetry.lock
cp /app/poetry.lock /home/root/docker/poetry.lock
File renamed without changes.
2 changes: 1 addition & 1 deletion run_dev_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ PLATFORM="$(uname -m)"
if [ $PLATFORM = "x86_64" ]; then
echo "x86"
docker pull ghcr.io/moriyalab/horus_inference_server:latest
docker run -it --rm --gpus all --runtime nvidia --shm-size=32G -v $ROOT/datasets:/usr/src/datasets -v $ROOT:/home/root -w /home/root --network host ghcr.io/moriyalab/horus_inference_server:latest
docker run -it --rm --gpus all --runtime nvidia --shm-size=32G -v $ROOT/datasets:/usr/src/datasets -v $ROOT:/home/root -w /home/root --network host ghcr.io/moriyalab/horus_inference_server_dev:latest
else
echo "Not Support Platform. Only support x86."
fi

0 comments on commit 2e1824f

Please sign in to comment.