-
Notifications
You must be signed in to change notification settings - Fork 9
149 lines (133 loc) · 5.62 KB
/
rbln_rh_ci.yaml
File metadata and controls
149 lines (133 loc) · 5.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: vLLM-RBLN RH CI
on:
pull_request:
branches:
- dev
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
inputs:
ref:
description: "ref to checkout"
required: false
type: string
python_version:
description: "Python version to use"
required: false
type: string
default: "3.12.9"
vllm_upstream_tag:
description: "vLLM upstream tag/version to use for tests (e.g., v0.9.1)"
required: false
type: string
jobs:
build:
name: Build Container Image
runs-on: fsw-r18s-atom-ext-rbln-sw-general-c3m48a1
outputs:
image_name: ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:${{ steps.image_tag.outputs.tag }}
steps:
- name: Checkout Repository with Submodules
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GIT_PAT }}
ref: ${{ inputs.ref || github.ref }}
submodules: recursive
- name: Convert repository owner to lowercase
id: lowercase
run: |
echo "repository_owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> "${GITHUB_OUTPUT}"
- name: Calculate dependency hash
id: dep_hash
run: |
HASH=$(grep -E '^ARG (ATOM_DRIVER_VERSION|LLVM_VERSION|OPTIMUM_RBLN_VERSION|RAY_VERSION|REBEL_COMPILER_VERSION|TORCHVISION_VERSION|TORCH_VERSION|TRITON_VERSION|PYTHON_VERSION)=' assets/Dockerfile.ubi.ci | sort | sha256sum | cut -c1-8)
echo "hash=${HASH}" >> "${GITHUB_OUTPUT}"
echo "Dependency hash: ${HASH}" >&2
- name: Set image tag
id: image_tag
run: |
TAG="env-${{ steps.dep_hash.outputs.hash }}"
echo "tag=${TAG}" >> "${GITHUB_OUTPUT}"
echo "Image tag: ${TAG}" >&2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Check if image exists
id: check_image
run: |
IMAGE="ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:${{ steps.image_tag.outputs.tag }}"
if docker manifest inspect "${IMAGE}" > /dev/null 2>&1; then
echo "exists=true" >> "${GITHUB_OUTPUT}"
echo "Image already exists: ${IMAGE}" >&2
else
echo "exists=false" >> "${GITHUB_OUTPUT}"
echo "Image does not exist, will build: ${IMAGE}" >&2
fi
- name: Set up Docker Buildx
if: steps.check_image.outputs.exists == 'false'
uses: docker/setup-buildx-action@v3
with:
driver: kubernetes
- name: Build and push Container image
if: steps.check_image.outputs.exists == 'false'
id: docker_build
uses: docker/build-push-action@v5
with:
context: .
file: ./assets/Dockerfile.ubi.ci
push: true
tags: ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:${{ steps.image_tag.outputs.tag }}
cache-from: type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:buildcache,mode=max
build-args: |
PYTHON_VERSION=${{ inputs.python_version || '3.12.9' }}
secrets: |
E2E_REPOSITORY_URL=${{ secrets.E2E_REPOSITORY_URL }}
E2E_REPOSITORY_ID=${{ secrets.E2E_REPOSITORY_ID }}
E2E_REPOSITORY_PWD=${{ secrets.E2E_REPOSITORY_PWD }}
ACTIVATION_KEY=${{ secrets.ACTIVATION_KEY }}
ORG_ID=${{ secrets.ORG_ID }}
- name: Image info
run: |
echo "Using image: ghcr.io/${{ steps.lowercase.outputs.repository_owner }}/${{ github.event.repository.name }}:${{ steps.image_tag.outputs.tag }}" >&2
echo "Image exists: ${{ steps.check_image.outputs.exists }}" >&2
echo "Build skipped: ${{ steps.check_image.outputs.exists }}" >&2
test:
if: github.repository_owner == 'RBLN-SW'
name: Run Tests
runs-on: fsw-r18s-atom-ext-rbln-sw-general-c3m48a1
needs: build
timeout-minutes: 1440
container:
image: ${{ needs.build.outputs.image_name }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GIT_PAT }}
ref: ${{ inputs.ref || github.ref }}
submodules: recursive
- name: Install uv
uses: astral-sh/setup-uv@v6
- name: Install vLLM-RBLN with all dependencies from PR source
env:
UV_EXTRA_INDEX_URL: "http://${{ secrets.E2E_REPOSITORY_ID }}:${{ secrets.E2E_REPOSITORY_PWD }}@${{ secrets.E2E_REPOSITORY_URL }}/repository/pypi/simple"
VLLM_TARGET_DEVICE: cpu
UV_NO_CACHE: "1"
run: |
uv venv
source .venv/bin/activate
uv add --index-strategy unsafe-best-match rebel-compiler==0.9.3.dev128+g2f4cc397.latestumd triton-rbln==3.2.0+rbln.git617682d1
uv pip install --index-strategy unsafe-best-match --no-binary vllm -e ".[test]"
uv pip list | grep -E "(vllm|rebel|torch|triton)"
- name: Run vLLM-RBLN Tests
run: |
source .venv/bin/activate
pytest tests/mock.py -vv --durations 0