first commit
Some checks failed
Build and push Docker images / build-and-push (push) Failing after 2m33s
Some checks failed
Build and push Docker images / build-and-push (push) Failing after 2m33s
This commit is contained in:
48
.github/workflows/docker-build-and-push.yaml
vendored
Normal file
48
.github/workflows/docker-build-and-push.yaml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
name: Build and push Docker images
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
jobs:
|
||||||
|
build-and-push:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
timeout-minutes: 1440
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
attestations: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: docker.io
|
||||||
|
IMAGE_NAME: niccolon/raptor-deps:mlir0c2701f
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
||||||
|
with:
|
||||||
|
github-server-url: https://chef.heaplab.deib.polimi.it/git
|
||||||
|
|
||||||
|
- name: Build Docker image
|
||||||
|
run: |
|
||||||
|
cd ${GITHUB_WORKSPACE}/mlir0c2701f
|
||||||
|
docker build -t ${REGISTRY}/${IMAGE_NAME} -f Dockerfile .
|
||||||
|
|
||||||
|
- name: Log in to the Container registry
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: niccolon
|
||||||
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Push Docker image
|
||||||
|
if: ${{ github.ref == 'refs/heads/main' }}
|
||||||
|
id: push
|
||||||
|
run: |
|
||||||
|
docker push ${REGISTRY}/${IMAGE_NAME}
|
||||||
66
mlir0c2701f/Dockerfile
Normal file
66
mlir0c2701f/Dockerfile
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
FROM ubuntu:24.04 AS builder
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get upgrade -y && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
gcc \
|
||||||
|
g++ \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
python3 \
|
||||||
|
ca-certificates && \
|
||||||
|
# Build MLIR (no install — keep full build tree)
|
||||||
|
cd /opt && \
|
||||||
|
git clone --filter=blob:none --no-checkout https://github.com/llvm/llvm-project.git && \
|
||||||
|
cd llvm-project && \
|
||||||
|
git fetch --depth 1 origin 0c2701fe7fa002e1befc5f86c268a7964f96d286 && \
|
||||||
|
git checkout FETCH_HEAD && \
|
||||||
|
cmake -S llvm -B build \
|
||||||
|
-G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DLLVM_ENABLE_PROJECTS="mlir;clang" \
|
||||||
|
-DLLVM_ENABLE_RUNTIMES="openmp" \
|
||||||
|
-DLLVM_TARGETS_TO_BUILD="host" \
|
||||||
|
-DLLVM_ENABLE_ASSERTIONS=ON \
|
||||||
|
-DLLVM_ENABLE_RTTI=ON \
|
||||||
|
-DENABLE_LIBOMPTARGET=OFF \
|
||||||
|
-DLLVM_ENABLE_LIBEDIT=OFF \
|
||||||
|
-DLLVM_PARALLEL_LINK_JOBS=1 && \
|
||||||
|
cmake --build build -j $(nproc) && \
|
||||||
|
# Build protobuf
|
||||||
|
cd /tmp && \
|
||||||
|
git clone --depth 1 --branch v34.0 https://github.com/protocolbuffers/protobuf && \
|
||||||
|
cd protobuf && \
|
||||||
|
cmake -S . -B build \
|
||||||
|
-G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/opt/protobuf && \
|
||||||
|
cmake --build build -j $(nproc) && \
|
||||||
|
cmake --build build -- install && \
|
||||||
|
# Cleanup only temp files, keep /opt/llvm-project
|
||||||
|
rm -rf /tmp/*
|
||||||
|
|
||||||
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get upgrade -y && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
ca-certificates \
|
||||||
|
cmake \
|
||||||
|
ninja-build \
|
||||||
|
build-essential \
|
||||||
|
python3 \
|
||||||
|
python3-pip && \
|
||||||
|
apt-get autoremove -y && \
|
||||||
|
apt-get clean -y && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=builder /opt/llvm-project /opt/llvm-project
|
||||||
|
COPY --from=builder /opt/protobuf /opt/protobuf
|
||||||
|
|
||||||
|
RUN echo "/opt/protobuf/lib" > /etc/ld.so.conf.d/protobuf.conf && ldconfig
|
||||||
Reference in New Issue
Block a user