Skip to content

Commit 1f2296e

Browse files
authored
feat: update to infinity 0.0.76; better error handing; added test_input.json; removed broken workflows (#27)
* feat: update to infinity 0.0.76; added test_input.json; improved error handling when MODEL_NAMES not set; added docker-compose * ci: remove broken workflows * ci: simplified release * ci: removed wrong test
1 parent 732ec51 commit 1f2296e

File tree

14 files changed

+76
-218
lines changed

14 files changed

+76
-218
lines changed

.github/tests.json

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/CI-runpod_dep.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
echo "Fetching the current runpod version from requirements.txt..."
2323
2424
# Get current version (supports '~=' versioning)
25-
current_version=$(grep -oP 'runpod~=\K[^ ]+' ./builder/requirements.txt)
25+
current_version=$(grep -oP 'runpod~=\K[^ ]+' ./requirements.txt)
2626
echo "Current version: $current_version"
2727
2828
# Get new version from PyPI
@@ -51,7 +51,7 @@ jobs:
5151
echo "New major/minor detected ($new_major_minor). Updating runpod version..."
5252
5353
# Update requirements.txt with the new version while keeping '~='
54-
sed -i "s/runpod~=.*/runpod~=$new_version/" ./builder/requirements.txt
54+
sed -i "s/runpod~=.*/runpod~=$new_version/" ./requirements.txt
5555
echo "requirements.txt has been updated."
5656
5757
- name: Create Pull Request

.github/workflows/CI-test_e2e.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/CI-test_handler.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.
Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CD | Build-Test-Release
1+
name: release
22

33
on:
44
push:
@@ -38,35 +38,3 @@ jobs:
3838
with:
3939
push: true
4040
tags: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag) || 'dev' }}
41-
42-
dev-test:
43-
needs: docker-build
44-
runs-on: ubuntu-latest
45-
46-
steps:
47-
# Checkout
48-
- uses: actions/checkout@v4
49-
50-
# Tests
51-
- name: Run Tests
52-
if: github.event_name != 'release'
53-
id: run-tests
54-
uses: direlines/[email protected]
55-
with:
56-
image-tag: ${{ vars.DOCKERHUB_REPO }}/${{ vars.DOCKERHUB_IMG }}:${{ (github.event_name == 'release' && github.event.release.tag_name) || (github.event_name == 'workflow_dispatch' && github.event.inputs.image_tag) || 'dev' }}
57-
runpod-api-key: ${{ secrets.RUNPOD_API_KEY }}
58-
request-timeout: 600
59-
60-
# Pass/Fail
61-
- name: Verify Tests
62-
env:
63-
TOTAL_TESTS: ${{ steps.run-tests.outputs.total-tests }}
64-
SUCCESSFUL_TESTS: ${{ steps.run-tests.outputs.succeeded }}
65-
RESULTS: ${{ steps.run-tests.outputs.results }}
66-
run: |
67-
echo "Total tests: $TOTAL_TESTS"
68-
echo "Successful tests: $SUCCESSFUL_TESTS"
69-
echo "Full results: $RESULTS"
70-
if [ "$TOTAL_TESTS" != "$SUCCESSFUL_TESTS" ]; then
71-
exit 1
72-
fi

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,6 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
#.idea/
161+
162+
163+
data

.pre-commit-config.yaml

Lines changed: 0 additions & 6 deletions
This file was deleted.

Dockerfile

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
ARG WORKER_CUDA_VERSION=12.4.1
2-
FROM runpod/pytorch:2.4.0-py3.11-cuda${WORKER_CUDA_VERSION}-devel-ubuntu22.04
1+
FROM nvidia/cuda:12.4.1-cudnn-runtime-ubuntu22.04 AS base
32

4-
#Reinitialize, as its lost after the FROM command
5-
ARG WORKER_CUDA_VERSION=12.4.1
3+
ENV HF_HOME=/runpod-volume
64

7-
# Python dependencies
8-
COPY builder/requirements.txt /requirements.txt
9-
RUN python3.11 -m pip install --upgrade pip && \
10-
python3.11 -m pip install -r /requirements.txt --no-cache-dir && \
11-
rm /requirements.txt
5+
# install python and other packages
6+
RUN apt-get update && apt-get install -y \
7+
python3.11 \
8+
python3-pip \
9+
git \
10+
wget \
11+
libgl1 \
12+
&& ln -sf /usr/bin/python3.11 /usr/bin/python \
13+
&& ln -sf /usr/bin/pip3 /usr/bin/pip
1214

13-
RUN pip uninstall torch -y && \
14-
CUDA_VERSION_SHORT=$(echo ${WORKER_CUDA_VERSION} | cut -d. -f1,2 | tr -d .) && \
15-
pip install torch==2.5.1 --index-url https://download.pytorch.org/whl/test/cu${CUDA_VERSION_SHORT} --no-cache-dir
15+
# install uv
16+
RUN pip install uv
1617

17-
ENV HF_HOME=/runpod-volume
18+
# install python dependencies
19+
COPY requirements.txt /requirements.txt
20+
RUN uv pip install -r /requirements.txt --system
1821

19-
# Add src files (Worker Template)
22+
# install torch
23+
RUN pip install torch==2.5.1+cu124 --index-url https://download.pytorch.org/whl/test/cu124 --no-cache-dir
24+
25+
# Add src files
2026
ADD src .
2127

22-
CMD python3.11 -u /handler.py
28+
# Add test input
29+
COPY test_input.json /test_input.json
30+
31+
# start the handler
32+
CMD python -u /handler.py

docker-bake.hcl

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,12 @@ variable "WORKER_VERSION" {
1111
}
1212

1313
group "all" {
14-
targets = ["worker-1180", "worker-1210"]
14+
targets = ["worker-1241"]
1515
}
1616

17-
target "worker-1180" {
18-
tags = ["${REPOSITORY}/worker-infinity-text-embedding:${WORKER_VERSION}-cuda11.8.0"]
17+
target "worker-1241" {
18+
tags = ["${REPOSITORY}/worker-infinity-embedding:${WORKER_VERSION}-cuda12.4.1"]
1919
context = "."
2020
dockerfile = "Dockerfile"
21-
args = {
22-
WORKER_VERSION = "${WORKER_VERSION}"
23-
WORKER_CUDA_VERSION = "11.8.0"
24-
}
25-
output = ["type=docker,push=${PUSH}"]
26-
}
27-
28-
target "worker-1210" {
29-
tags = ["${REPOSITORY}/worker-infinity-text-embedding:${WORKER_VERSION}-cuda12.1.0"]
30-
context = "."
31-
dockerfile = "Dockerfile"
32-
args = {
33-
WORKER_VERSION = "${WORKER_VERSION}"
34-
WORKER_CUDA_VERSION = "12.1.0"
35-
}
3621
output = ["type=docker,push=${PUSH}"]
3722
}

docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
services:
2+
embedding-worker:
3+
build:
4+
context: .
5+
deploy:
6+
resources:
7+
reservations:
8+
devices:
9+
- driver: nvidia
10+
count: all
11+
capabilities: [gpu]
12+
environment:
13+
MODEL_NAMES: "BAAI/bge-small-en-v1.5"
14+
NVIDIA_VISIBLE_DEVICES: "all"
15+
volumes:
16+
- ./data/runpod-volume:/runpod-volume
17+
ports:
18+
- "9000:9000"

0 commit comments

Comments
 (0)