Skip to content

Commit 6647709

Browse files
authored
Merge pull request #740 from roboflow/feature/depot_ci_gpu
feature/depot ci gpu
2 parents e7c2508 + 4222c8c commit 6647709

File tree

3 files changed

+60
-41
lines changed

3 files changed

+60
-41
lines changed

.github/workflows/docker.gpu.yml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,52 @@ on:
44
release:
55
types: [created]
66
push:
7-
branches: [ main ]
7+
branches: [main]
8+
pull_request:
9+
branches: [main]
810
workflow_dispatch:
911
inputs:
1012
force_push:
1113
type: boolean
1214
description: "Do you want to push image after build?"
1315
default: false
16+
1417
env:
15-
VERSION: '0.0.0' # Default version, will be overwritten
18+
VERSION: "0.0.0" # Default version, will be overwritten
1619

1720
jobs:
1821
docker:
1922
runs-on:
20-
group: group8core
23+
labels: ubuntu-latest
2124
timeout-minutes: 120
25+
permissions:
26+
id-token: write
27+
contents: read
2228
steps:
23-
- name: Remove unnecessary files
24-
run: |
25-
sudo rm -rf /usr/share/dotnet
26-
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
27-
-
28-
name: Set up QEMU
29-
uses: docker/setup-qemu-action@v2
30-
-
31-
name: Set up Docker Buildx
32-
uses: docker/setup-buildx-action@v2
33-
-
34-
name: Login to Docker Hub
35-
uses: docker/login-action@v2
29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v3
3631
with:
3732
username: ${{ secrets.DOCKERHUB_USERNAME }}
3833
password: ${{ secrets.DOCKERHUB_TOKEN }}
39-
-
40-
name: 🛎️ Checkout
41-
uses: actions/checkout@v3
42-
-
43-
name: Read version from file
34+
- name: 🛎️ Checkout
35+
uses: actions/checkout@v4
36+
- name: Read version from file
4437
run: echo "VERSION=$(DISABLE_VERSION_CHECK=true python ./inference/core/version.py)" >> $GITHUB_ENV
45-
-
46-
name: Build and Push
47-
uses: docker/build-push-action@v4
38+
- name: Set up Depot CLI
39+
uses: depot/setup-action@v1
40+
- name: Build and Push
41+
uses: depot/build-push-action@v1
4842
with:
43+
save: true
4944
push: ${{ github.event_name == 'release' || (github.event.inputs.force_push == 'true')}}
45+
project: grl7ffzxd7
5046
tags: roboflow/roboflow-inference-server-gpu:latest,roboflow/roboflow-inference-server-gpu:${{env.VERSION}}
51-
cache-from: type=registry,ref=roboflow/roboflow-inference-server-gpu:cache
52-
cache-to: type=registry,ref=roboflow/roboflow-inference-server-gpu:cache,mode=max
5347
platforms: linux/amd64
54-
file: ./docker/dockerfiles/Dockerfile.onnx.gpu
48+
file: ./docker/dockerfiles/Dockerfile.onnx.gpu
49+
- name: Store build ID
50+
run: echo ${{ steps.build.outputs.build-id }} > build_id.txt
51+
- name: Upload build ID
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: build_id
55+
path: build_id.txt

.github/workflows/test.nvidia_t4.yml

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name: Code Quality & Regression Tests - NVIDIA T4
22

33
on:
4-
push:
5-
branches: [main]
6-
workflow_dispatch:
4+
workflow_run:
5+
workflows: ["Build and Push GPU Container"] # The name of the first workflow
6+
types:
7+
- completed # Trigger this workflow when the first workflow completes
78

89
jobs:
910
build:
@@ -17,19 +18,39 @@ jobs:
1718
- name: Set up Docker Buildx
1819
uses: docker/setup-buildx-action@v2
1920
- name: 🛎️ Checkout
20-
uses: actions/checkout@v3
21+
uses: actions/checkout@v4
2122
with:
2223
ref: ${{ github.head_ref }}
24+
- name: 📦 Cache Python packages
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cache/pip
28+
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements/**') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-${{ matrix.python-version }}-
31+
- name: Read version from file
32+
run: echo "VERSION=$(DISABLE_VERSION_CHECK=true python ./inference/core/version.py)" >> $GITHUB_ENV
2333
- name: 🦾 Install dependencies
2434
run: |
2535
python3 -m pip install --upgrade pip
2636
python3 -m pip install -r requirements/requirements.test.integration.txt
27-
- name: �🔨 Build and Push Test Docker - GPU
28-
run: |
29-
docker build -t roboflow/roboflow-inference-server-gpu:test -f docker/dockerfiles/Dockerfile.onnx.gpu .
37+
- name: Set up Depot CLI
38+
uses: depot/setup-action@v1
39+
- name: Retireve build ID
40+
uses: actions/download-artifact@v3
41+
with:
42+
name: build_id
43+
path: .
44+
- name: Read build ID
45+
run: echo "BUILD_ID=$(cat build_id/build_id.txt)" >> $GITHUB_ENV
46+
- name: Set Repo
47+
run: echo "INFERENCE_SERVER_REPO=roboflow-inference-server-gpu" >> $GITHUB_ENV
48+
- name: Pull GPU Image
49+
run: depot pull $BUILD_ID -t roboflow/${INFERENCE_SERVER_REPO}:${VERSION}
3050
- name: 🔋 Start Test Docker - GPU
3151
run: |
32-
PORT=9101 INFERENCE_SERVER_REPO=roboflow-inference-server-gpu make start_test_docker_gpu
52+
docker tag roboflow/${INFERENCE_SERVER_REPO}:${VERSION} roboflow/${INFERENCE_SERVER_REPO}:test
53+
PORT=9101 make start_test_docker_gpu
3354
- name: 🧪 Regression Tests - GPU
3455
id: regression_tests
3556
run: |
@@ -85,10 +106,10 @@ jobs:
85106
- name: 🧪 Regression Tests - SAM2
86107
id: sam2_tests
87108
run: |
88-
PORT=9101 API_KEY=${{ secrets.API_KEY }} SKIP_SAM2_TESTS=False python3 -m pytest tests/inference/integration_tests/test_sam2.py
109+
PORT=9101 API_KEY=${{ secrets.API_KEY }} SKIP_SAM2_TESTS=False python3 -m pytest tests/inference/integration_tests/test_sam2.py
89110
- name: 🚨 Show server logs on error
90111
run: docker logs inference-test
91112
if: ${{ steps.sam2_tests.outcome != 'success' }}
92113
- name: 🧹 Cleanup Test Docker - SAM2
93114
run: make stop_test_docker
94-
if: success() || failure()
115+
if: success() || failure()

docker/dockerfiles/Dockerfile.onnx.gpu

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ RUN python3 -m pip install packaging==24.1 && rm -rf ~/.cache/pip
5151
# Install flash_attn required for Paligemma and Florence2
5252
RUN python3 -m pip install -r requirements.pali.flash_attn.txt --no-build-isolation && rm -rf ~/.cache/pip
5353

54-
FROM scratch
55-
COPY --from=base / /
56-
5754
WORKDIR /build
5855
COPY . .
5956
RUN ln -s /usr/bin/python3 /usr/bin/python
@@ -82,4 +79,4 @@ ENV ENABLE_STREAM_API=True
8279
ENV ENABLE_WORKFLOWS_PROFILING=True
8380
ENV ENABLE_PROMETHEUS=True
8481

85-
ENTRYPOINT uvicorn gpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT
82+
ENTRYPOINT uvicorn gpu_http:app --workers $NUM_WORKERS --host $HOST --port $PORT

0 commit comments

Comments
 (0)