Skip to content

Commit 456bd5b

Browse files
tom-kuchleryazhuorichardlee159
authored
Dev/hybrid (#13)
* Implemented middleware app as a hybrid function (mix compute and i/o) * Switch to using the SDK provided CMake definitions of dlibc dlibcxx * Prepare for open sourcing --------- Co-authored-by: Yazhuo Zhang <[email protected]> Co-authored-by: richardlee <[email protected]>
1 parent 39d99c0 commit 456bd5b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1460
-1576
lines changed

.github/workflows/file_checks.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Format checks
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
7+
pull_request:
8+
branches: [ "main" ]
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: C format check
18+
run: find functions/ -iname '*.h' -o -iname '*.c' | clang-format --dry-run -Werror --files=/dev/stdin --style=LLVM

LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2025 ETH Zurich EASL
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the " Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

LICENSES/MIT.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../LICENSE

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Overview
2+
3+
This repository contains examples of how to write functions to run on [Dandelion](https://github.com/eth-easl/dandelion)
4+
5+
The different folders contain examples and more information for the supported languages.
6+
7+
Curretly we only have full support for C and C++.
8+
Examples for how to write functions, setup builds and other details can be found in the `c_functons` folder.
9+
10+
There is also support for functions compiled to Wasm.
11+
The tooling to compile functions this way is in the `wasm-compiler` folder.

c_functions/README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Functions
2+
3+
This folder contains a series of functions used for basic functionality tests or as example applications.
4+
The functions are split into multiple executables that can be built individually.
5+
6+
All C and C++ functions depend on the [dandelion SDK](https://github.com/eth-easl/dandelion).
7+
Functions can either only use the lowest level interface `dandelion_runtime` or the `dlibc`/`dlibcxx`.
8+
The runtime provides basic wrapper to start a function and interact directly with input and output sets and buffers.
9+
The libc variants also support reading and writing inputs and outputs to a filesystem abstraction, which is further explained in the SDK documentation.
10+
11+
# Building
12+
13+
The build for this repository is set up to allow building functions for all backends and architectures supported by the SDK.
14+
To set this up use the following commands:
15+
16+
```
17+
mkdir build
18+
cd build
19+
cmake -DPLATFORM=<platform> -DARCHITECTURE=<target arch> -DCMAKE_BUILD_TYPE-<type> .
20+
```
21+
22+
The platforms supported are `CHERI`, `MMU_FREEBSD`, `MMU_LINUX`, `KVM`, `WASM`, `DEBUG`. \
23+
We support `x86_64` and `aarch64` architectures. \
24+
The build type can be either `Debug` or `Release`.
25+
26+
When one of the parameters is not given, it defaults to the `DEBUG` platform, the build system architecture and `Debug` build type.
27+
28+
The CMake in this project is set up to automatically download the latest version of the dandelion SDK when it is initially set up.
29+
The easiest way to use a different version, is to replace the `dandelion_sdk` folder in the build folder with a symlink to the version to be used.

0 commit comments

Comments
 (0)