File tree 2 files changed +45
-0
lines changed
2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Test Docker Image
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ paths :
8
+ - ' docker/Dockerfile.intel'
9
+
10
+ pull_request :
11
+ branches :
12
+ - main
13
+ paths :
14
+ - ' docker/Dockerfile.intel'
15
+
16
+ jobs :
17
+ build_and_run :
18
+ runs-on : ubuntu-latest
19
+
20
+ steps :
21
+ - name : Checkout code
22
+ uses : actions/checkout@v4
23
+
24
+ - name : Set up Docker Buildx
25
+ uses : docker/setup-buildx-action@v3
26
+
27
+ - name : Build and Run Docker Image
28
+ run : |
29
+ IMAGE_NAME="intel_image:latest"
30
+ docker build -f docker/Dockerfile.intel -t $IMAGE_NAME .
31
+ if [ $? -ne 0 ]; then
32
+ echo "Docker image build failed."
33
+ exit 1
34
+ fi
35
+ CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null)
36
+ if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then
37
+ echo "Container is running."
38
+ else
39
+ echo "Container failed to start."
40
+ docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found."
41
+ exit 1
42
+ fi
43
+ docker stop $CONTAINER_ID
44
+ docker rm $CONTAINER_ID
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ ARG TORCHVISION_VERSION=0.18.1+cpu
37
37
ARG TORCHAUDIO_VERSION=2.3.1+cpu
38
38
39
39
RUN python3 -m pip install --no-cache-dir \
40
+ intel-openmp \
40
41
torch==${PYTORCH_VERSION}+cpu \
41
42
torchvision==${TORCHVISION_VERSION} \
42
43
torchaudio==${TORCHAUDIO_VERSION} \
You can’t perform that action at this time.
0 commit comments