diff --git a/.github/workflows/dockerfile_sanity.yml b/.github/workflows/dockerfile_sanity.yml new file mode 100644 index 0000000000..12be9a5b15 --- /dev/null +++ b/.github/workflows/dockerfile_sanity.yml @@ -0,0 +1,44 @@ +name: Build and Test Docker Image + +on: + push: + branches: + - main + paths: + - 'docker/Dockerfile.intel' + + pull_request: + branches: + - main + paths: + - 'docker/Dockerfile.intel' + +jobs: + build_and_run: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build and Run Docker Image + run: | + IMAGE_NAME="intel_image:latest" + docker build -f docker/Dockerfile.intel -t $IMAGE_NAME . + if [ $? -ne 0 ]; then + echo "Docker image build failed." + exit 1 + fi + CONTAINER_ID=$(docker run -d $IMAGE_NAME tail -f /dev/null) + if docker inspect -f '{{.State.Running}}' $CONTAINER_ID 2>/dev/null | grep -q 'true'; then + echo "Container is running." + else + echo "Container failed to start." + docker logs $CONTAINER_ID 2>/dev/null || echo "No container ID found." + exit 1 + fi + docker stop $CONTAINER_ID + docker rm $CONTAINER_ID \ No newline at end of file diff --git a/docker/Dockerfile.intel b/docker/Dockerfile.intel index 18ea2b60d1..60fd51b424 100644 --- a/docker/Dockerfile.intel +++ b/docker/Dockerfile.intel @@ -37,6 +37,7 @@ ARG TORCHVISION_VERSION=0.18.1+cpu ARG TORCHAUDIO_VERSION=2.3.1+cpu RUN python3 -m pip install --no-cache-dir \ + intel-openmp \ torch==${PYTORCH_VERSION}+cpu \ torchvision==${TORCHVISION_VERSION} \ torchaudio==${TORCHAUDIO_VERSION} \