Skip to content

Commit

Permalink
rework CI and Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej committed Nov 5, 2024
1 parent 40ba7d7 commit 3a97fb8
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 75 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build LLVM and LLVM-MCAD inside Docker
on:
push:
#schedule:
# # Run nightly at 08:00 UTC (aka 00:00 Pacific, aka 03:00 Eastern)
# - cron: '0 8 * * *'

permissions:
contents: read # Default everything to read-only

env:
WORKSPACE_PATH: ${{ github.workspace }}

jobs:
build:
# We need to run self-hosted because the GitHub runners run out of disk space.
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
with:
path: 'LLVM-MCA-Daemon'
- name: setup and build inside Docker
run: cd LLVM-MCA-Daemon/docker && ./up
#- name: install dependencies
# run: sudo ./docker/setup-deps.sh
#- name: build LLVM
# run: ./docker/setup-llvm.sh
#- name: build LLVM-MCA-Daemon
# run: ./docker/setup-build.sh

62 changes: 0 additions & 62 deletions .github/workflows/test.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ RUN setup/setup-llvm.sh
COPY docker/setup-build.sh ./setup/
RUN setup/setup-build.sh

ENV PATH="/work/LLVM-MCA-Daemon/build:/opt/llvm-14/bin:$PATH"
ENV PATH="/work/mcad-build:/opt/llvm-14/bin:$PATH"
RUN rm /etc/apt/apt.conf.d/docker-clean

ENTRYPOINT ["llvm-mcad"]
Expand Down
13 changes: 7 additions & 6 deletions docker/setup-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ set -e
export DEBIAN_FRONTEND=noninteractive

if [ -z "${WORKSPACE_PATH}" ]; then
WORKSPACE_PATH=/work/LLVM-MCA-Daemon
WORKSPACE_PATH=/work
fi

mkdir -p ${WORKSPACE_PATH}/build
cd ${WORKSPACE_PATH}/build
mkdir -p ${WORKSPACE_PATH}/mcad-build
mkdir -p ${WORKSPACE_PATH}/mcad-install
cd ${WORKSPACE_PATH}/mcad-build

cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/LLVM-MCA-Daemon \
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=${WORKSPACE_PATH}/mcad-install \
-DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 \
-DLLVM_DIR=/opt/llvm-main/lib/cmake/llvm \
-DLLVM_DIR=${WORKSPACE_PATH}/llvm-install/lib/cmake/llvm \
-DLLVM_MCAD_ENABLE_PLUGINS="tracer;binja;vivisect" \
../
${WORKSPACE_PATH}/LLVM-MCA-Daemon
ninja
9 changes: 3 additions & 6 deletions docker/setup-llvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,19 @@ set -e
export DEBIAN_FRONTEND=noninteractive

if [ -z "${WORKSPACE_PATH}" ]; then
WORKSPACE_PATH=/work/LLVM-MCA-Daemon
WORKSPACE_PATH=/work
fi

# Run ./setup-deps.sh before this to install dependencies needed to build LLVM

# Applying the patches requires that our git user has an identity.
git config --global user.email "[email protected]"
git config --global user.name "Workflow"

git clone https://github.com/llvm/llvm-project.git llvm
cd llvm
git am < ${WORKSPACE_PATH}/patches/add-identifier-to-mca-instruction.patch
git am < ${WORKSPACE_PATH}/patches/start-mapping-e500-itenerary-model-to-new-schedule.patch
git am < ${WORKSPACE_PATH}/patches/abstract-memory-group.patch
git am ${WORKSPACE_PATH}/LLVM-MCA-Daemon/patches/*.patch
mkdir build && cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/opt/llvm-main \
cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=${WORKSPACE_PATH}/llvm-install \
-DCMAKE_C_COMPILER=clang-14 -DCMAKE_CXX_COMPILER=clang++-14 \
-DLLVM_USE_LINKER=lld-14 -DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_TOOL_LLVM_MCA_BUILD=ON \
Expand Down

0 comments on commit 3a97fb8

Please sign in to comment.