Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Add GitHub actions for runtime tests #1

Merged
merged 29 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6327b13
[WIP] Add GitHub actions doing basic compile test for now
zero9178 May 1, 2024
50b2bbb
make checkout recurse into submodules
zero9178 May 1, 2024
7b3ab86
fix cmake version
zero9178 May 1, 2024
21b6e5c
bump minimum cmake to match IREE
zero9178 May 1, 2024
7c5201c
fix cmake build command
zero9178 May 1, 2024
8f943a5
don't forget about installing bender
zero9178 May 2, 2024
77be1fb
make the iree-compile build leaner, test out newer ubuntu
zero9178 May 2, 2024
7b3bd97
actually properly delete object files
zero9178 May 2, 2024
d97f580
actually perform runtime build as well, increase ccache size
zero9178 May 2, 2024
f9b405a
correct path where iree-compile should be downloaded
zero9178 May 2, 2024
e0b0ad2
try using `tar` to preserve permissions as recommended in https://git…
zero9178 May 2, 2024
e5a08a7
fix tar typo
zero9178 May 2, 2024
8890f63
test without path in download
zero9178 May 2, 2024
3d73319
don't attempt to untar with gzip
zero9178 May 2, 2024
c28facb
I really should have used `tar --help` earlier
zero9178 May 2, 2024
c189856
adjust path used to invoke tar to avoid absolute paths in artifact
zero9178 May 2, 2024
231bbf6
undo typo
zero9178 May 2, 2024
b61586a
test out using a custom toolchain in a docker image, add cmake emulat…
zero9178 May 9, 2024
10f7c3c
upgrade action versions
zero9178 May 9, 2024
6ad2386
also run docker build on workflow file changes
zero9178 May 9, 2024
6fe2eca
fix version typo
zero9178 May 9, 2024
80467df
reduce image size, update github actions version, fix ref for runtime…
zero9178 May 9, 2024
344e292
use multistage build which drastically reduces image size
zero9178 May 9, 2024
8f73a77
remove redundant command, add toolchain file to the toolchain
zero9178 May 9, 2024
528eb47
minor fixes, use runtime as context
zero9178 May 9, 2024
2c38d88
Merge branch 'refs/heads/main' into runtime-github-actions
zero9178 May 10, 2024
a37e589
Merge branch 'refs/heads/main' into runtime-github-actions
zero9178 May 10, 2024
90aece4
revert local sync baseline changes for now
zero9178 May 10, 2024
ab7b4eb
change docker toolchain tag to main
zero9178 May 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 139 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: Builds

permissions:
contents: read
actions: write

on:
push:
branches: [ "main" ]
pull_request:

jobs:
build-compiler:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install minimum required cmake and ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.21.0"

- name: Install CCache
uses: Chocobo1/setup-ccache-action@v1
with:
ccache_options: |
max_size=400M
compiler_check=none

- name: Install Compiler
run: |
sudo apt-get update
sudo apt-get install lld clang

- name: Configure
run: |
cmake -G Ninja -Bquidditch-compiler-build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DIREE_ENABLE_ASSERTIONS=ON \
-DIREE_ENABLE_LLD=ON \
-DIREE_ENABLE_THIN_ARCHIVES=ON \
-DIREE_HAL_DRIVER_DEFAULTS=OFF \
-DIREE_TARGET_BACKEND_DEFAULTS=OFF \
-DIREE_TARGET_BACKEND_LLVM_CPU=ON \
-DPython3_ROOT_DIR="$pythonLocation" \
-DPython3_FIND_STRATEGY=LOCATION \
-S ${{github.workspace}}/codegen

- name: Build
run: cmake --build quidditch-compiler-build --target iree-compile

# TODO: Test?

- name: Remove object files prior to upload
working-directory: ${{github.workspace}}/quidditch-compiler-build
run: |
find . -name "*.o" -type f -delete

- name: Tar build directory
working-directory: ${{github.workspace}}
run: |
tar -cvf quidditch-compiler-build.tar quidditch-compiler-build

- name: Upload iree-compile
uses: actions/upload-artifact@v4
with:
name: quidditch-compiler-build-dir
path: quidditch-compiler-build.tar

build-runtime:
runs-on: ubuntu-22.04
needs: [ build-compiler ]

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
path: 'Quidditch'

- name: Download Quidditch Toolchain
run: |
mkdir ./toolchain
docker run --rm ghcr.io/opencompl/quidditch/toolchain:main tar -cC /opt/quidditch-toolchain . \
| tar -xC ./toolchain

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11

- name: Install Python dependencies
run: python -m pip install -r Quidditch/runtime/requirements.txt

- name: Install minimum required cmake and ninja
uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.21.0"

- name: Install bender
uses: baptiste0928/cargo-install@v3
with:
crate: bender
version: '~0.28.0'

- name: Download iree-compile
uses: actions/download-artifact@v4
with:
name: quidditch-compiler-build-dir

- name: Untar iree-compile
run: |
tar -xf quidditch-compiler-build.tar

- name: Configure build
run: |
cmake -GNinja -Bquidditch-runtime-build \
-DQUIDDITCH_CODEGEN_BUILD_DIR=${{github.workspace}}/quidditch-compiler-build \
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/toolchain/ToolchainFile.cmake \
-S ${{github.workspace}}/Quidditch/runtime

- name: Build
run: cmake --build quidditch-runtime-build

- name: Test
working-directory: ${{github.workspace}}/quidditch-runtime-build
# TODO: This should run a proper test suite once we are no longer using verilator.
run: ctest --extra-verbose -j$(nproc) -R HelloWorld
2 changes: 1 addition & 1 deletion codegen/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.20)
cmake_minimum_required(VERSION 3.21)
project(QuidditchCompiler LANGUAGES CXX C)

set(IREE_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../iree" CACHE STRING "IREE source code path")
Expand Down
1 change: 1 addition & 0 deletions runtime/iree-configuration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set(IREE_ENABLE_THREADING OFF)
set(IREE_BUILD_TESTS OFF)
set(IREE_HAL_EXECUTABLE_LOADER_DEFAULTS OFF CACHE BOOL "" FORCE)
set(IREE_HAL_DRIVER_DEFAULTS OFF CACHE BOOL "" FORCE)
set(IREE_ENABLE_WERROR_FLAG OFF)

# Include the IREE runtime as part of this build.
set(IREE_CMAKE_PLUGIN_PATHS "${CMAKE_CURRENT_LIST_DIR}/../runtime")
Expand Down
2 changes: 1 addition & 1 deletion runtime/runtime/src/Quidditch/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static iree_status_t create_pipeline_layout(
static iree_status_t create_semaphore(iree_hal_device_t *base_device,
uint64_t initial_value,
iree_hal_semaphore_t **out_semaphore) {
[[maybe_unused]] quidditch_device_t *device = cast_device(base_device);
IREE_ATTRIBUTE_UNUSED quidditch_device_t *device = cast_device(base_device);

return iree_make_status(IREE_STATUS_UNIMPLEMENTED);
}
Expand Down