7676 test-e2e-pc-gpu :
7777 runs-on : gpu
7878 needs : lint-and-unit-tests
79- env :
80- BUILD_TYPE : Release
8179 permissions :
8280 checks : write
8381 pull-requests : write
@@ -90,30 +88,54 @@ jobs:
9088 rm -rf .[!.]*
9189 fi
9290 - uses : actions/checkout@v4
91+ - name : Install Docker CLI
92+ run : |
93+ if ! command -v docker &> /dev/null; then
94+ echo "Docker CLI not found, installing..."
95+ sudo apt-get update
96+ sudo apt-get install -y docker.io
97+ else
98+ echo "Docker CLI already installed"
99+ fi
100+ - name : Generate Docker Image Version
101+ id : version
102+ run : |
103+ DATE=$(date +%Y%m%d)
104+ SHORT_SHA=$(echo '${{ github.sha }}' | cut -c1-7)
105+ VERSION="${{ github.ref_name }}-${DATE}-${{ github.run_number }}-${SHORT_SHA}"
106+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
107+ echo "Docker image version: ${VERSION}"
93108 - name : Build
94109 run : |
95110 cd ${{github.workspace}}
96- export PLATFORM=cuda
97- pip install -v -e . --no-build-isolation
98- - name : Test E2E
111+ sudo docker build -t ucm-e2etest-gpu-pc:${{ steps.version.outputs.version }} -f ./docker/Dockerfile-onlyPC ./
112+ - name : Test E2E in Docker
99113 run : |
100- cd ${{github.workspace}}
101- cd test
102- pip install -r requirements.txt
103- python3 -m pytest -x --stage=1 --feature=offline_inference --junitxml=offline-inference.xml
114+ sudo docker run --rm \
115+ -itd \
116+ --gpus all \
117+ --network=host \
118+ --ipc=host \
119+ --cap-add IPC_LOCK \
120+ -v /home/models:/home/models \
121+ -v ${{github.workspace}}:/workspace \
122+ ucm-e2etest-gpu-pc:${{ steps.version.outputs.version }} \
123+ -c "cd /workspace/test && pip install -r requirements.txt && python3 -m pytest -x --stage=1 --feature=offline_inference --junitxml=offline-inference.xml"
104124 - name : Upload pytest results
105125 uses : EnricoMi/publish-unit-test-result-action/linux@v2
106126 if : (!cancelled())
107127 with :
108128 files : |
109129 ${{github.workspace}}/test/offline-inference.xml
110130 check_name : Prefix cache test results
131+ - name : Cleanup Docker Image
132+ if : always()
133+ run : |
134+ sudo docker rmi ucm-e2etest-gpu-pc:${{ steps.version.outputs.version }} || true
111135
112136 test-e2e-sparse-gpu :
113137 runs-on : gpu
114138 needs : lint-and-unit-tests
115- env :
116- BUILD_TYPE : Release
117139 permissions :
118140 checks : write
119141 pull-requests : write
@@ -126,23 +148,48 @@ jobs:
126148 rm -rf .[!.]*
127149 fi
128150 - uses : actions/checkout@v4
151+ - name : Install Docker CLI
152+ run : |
153+ if ! command -v docker &> /dev/null; then
154+ echo "Docker CLI not found, installing..."
155+ sudo apt-get update
156+ sudo apt-get install -y docker.io
157+ else
158+ echo "Docker CLI already installed"
159+ fi
160+ - name : Generate Docker Image Version
161+ id : version
162+ run : |
163+ DATE=$(date +%Y%m%d)
164+ SHORT_SHA=$(echo '${{ github.sha }}' | cut -c1-7)
165+ VERSION="${{ github.ref_name }}-${DATE}-${{ github.run_number }}-${SHORT_SHA}"
166+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
167+ echo "Docker image version: ${VERSION}"
129168 - name : Build
130169 run : |
131170 cd ${{github.workspace}}
132- export PLATFORM=cuda
133- export ENABLE_SPARSE=TRUE
134- pip install -v -e . --no-build-isolation
135- - name : Test E2E
171+ sudo docker build -t ucm-e2etest-gpu-sparse:${{ steps.version.outputs.version }} -f ./docker/Dockerfile ./
172+ - name : Test E2E in Docker
136173 run : |
137- cd ${{github.workspace}}
138- cd test
139- pip install -r requirements.txt
140- python3 -m pytest -x --stage=1 --feature=offline_inference_sparse --junitxml=offline-inference-sparse.xml
174+ sudo docker run --rm \
175+ -itd \
176+ --gpus all \
177+ --network=host \
178+ --ipc=host \
179+ --cap-add IPC_LOCK \
180+ -v /home/models:/home/models \
181+ -v ${{github.workspace}}:/workspace \
182+ ucm-e2etest-gpu-sparse:${{ steps.version.outputs.version }} \
183+ -c "cd /workspace/test && pip install -r requirements.txt && python3 -m pytest -x --stage=1 --feature=offline_inference_sparse --junitxml=offline-inference-sparse.xml"
141184 - name : Upload pytest results
142185 uses : EnricoMi/publish-unit-test-result-action/linux@v2
143186 if : (!cancelled())
144187 with :
145188 files : |
146189 ${{github.workspace}}/test/offline-inference-sparse.xml
147190 check_name : Sparse attention test results
191+ - name : Cleanup Docker Image
192+ if : always()
193+ run : |
194+ sudo docker rmi ucm-e2etest-gpu-sparse:${{ steps.version.outputs.version }} || true
148195
0 commit comments