-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
31 changed files
with
887 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Ignore local builds | ||
third-party/llvm-project/build | ||
third-party/wasi-libc/build | ||
.git | ||
|
||
build/ | ||
|
||
# Ignore big third party deps | ||
third-party/llvm-project/ | ||
third-party/wasi-libc/build/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
formatting: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: "Get the latest code" | ||
uses: actions/checkout@v2 | ||
- name: "Install requirements" | ||
run: "pip3 install -r requirements.txt" | ||
- name: "Run Black" | ||
run: "python3 -m black --check $(git ls-files '*.py')" | ||
- name: "Run C/C++ formatting" | ||
run: ./bin/run_clang_format.sh | ||
- name: "Check no formatting changes" | ||
run: git diff --exit-code | ||
|
||
tests: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-20.04 | ||
env: | ||
HOST_TYPE: ci | ||
REDIS_QUEUE_HOST: redis | ||
REDIS_STATE_HOST: redis | ||
container: | ||
image: faasm/cpp-sysroot:0.0.11 | ||
defaults: | ||
run: | ||
working-directory: /code/faasm-toolchain | ||
services: | ||
redis: | ||
image: redis | ||
steps: | ||
- name: "Fetch ref" | ||
run: git fetch origin ${GITHUB_REF}:ci-branch | ||
- name: "Check out branch" | ||
run: git checkout --force ci-branch | ||
- name: "Update Faabric submodule" | ||
run: "git submodule update --init -f third-party/faabric" | ||
- name: "Update CMake build" | ||
run: "inv dev.cmake" | ||
- name: "Build the tests" | ||
run: "inv dev.cc tests" | ||
- name: "Run the tests" | ||
run: "/build/faasm-toolchain/bin/tests" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cmake_minimum_required(VERSION 3.13.0) | ||
project(faasm-cpp) | ||
|
||
# Top-level CMake config | ||
set(CMAKE_CXX_FLAGS "-Wall") | ||
set(CMAKE_CXX_FLAGS_DEBUG "-g") | ||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | ||
|
||
# Add Faabric dependency | ||
add_subdirectory(third-party/faabric) | ||
|
||
# Generated protobuf headers | ||
include_directories(${CMAKE_CURRENT_BINARY_DIR}/third-party/faabric/src) | ||
|
||
add_subdirectory(libfaasm) | ||
add_subdirectory(emulator) | ||
add_subdirectory(tests) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
THIS_DIR=$(dirname $(readlink -f $0)) | ||
PROJ_ROOT=${THIS_DIR}/.. | ||
|
||
pushd ${PROJ_ROOT} > /dev/null | ||
|
||
if [[ -z "${SYSROOT_CLI_IMAGE}" ]]; then | ||
VERSION=$(cat VERSION) | ||
SYSROOT_CLI_IMAGE=faasm/cpp-sysroot:${VERSION} | ||
fi | ||
|
||
INNER_SHELL=${SHELL:-"/bin/bash"} | ||
|
||
docker-compose \ | ||
up \ | ||
--no-recreate \ | ||
-d \ | ||
cli | ||
|
||
docker-compose \ | ||
exec \ | ||
cli \ | ||
${INNER_SHELL} | ||
|
||
popd > /dev/null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
version: "3" | ||
|
||
services: | ||
redis: | ||
image: redis | ||
|
||
cli: | ||
image: ${SYSROOT_CLI_IMAGE} | ||
volumes: | ||
- .:/code/faasm-toolchain | ||
- ./build:/build/faasm-toolchain | ||
working_dir: /code/faasm-toolchain | ||
stdin_open: true | ||
tty: true | ||
privileged: true | ||
environment: | ||
- LOG_LEVEL=debug | ||
- REDIS_STATE_HOST=redis | ||
- REDIS_QUEUE_HOST=redis | ||
depends_on: | ||
- redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
FROM faasm/llvm:10.0.1 as llvm | ||
|
||
FROM faasm/grpc-root:0.0.12 | ||
ARG SYSROOT_VERSION | ||
|
||
# Copy the toolchain in from the LLVM container | ||
COPY --from=llvm /usr/local/faasm /usr/local/faasm | ||
|
||
RUN apt install -y \ | ||
autoconf \ | ||
autotools-dev \ | ||
libtool \ | ||
python3-dev \ | ||
python3-pip | ||
|
||
# Get the code | ||
WORKDIR /code | ||
RUN git clone -b v${SYSROOT_VERSION} https://github.com/faasm/faasm-toolchain | ||
WORKDIR /code/faasm-toolchain | ||
|
||
# Update submodules (not LLVM) | ||
RUN git submodule update --init -f third-party/eigen | ||
RUN git submodule update --init -f third-party/faabric | ||
RUN git submodule update --init -f third-party/faasm-clapack | ||
RUN git submodule update --init -f third-party/libffi | ||
RUN git submodule update --init -f third-party/wasi-libc | ||
|
||
RUN pip3 install -r requirements.txt | ||
|
||
# Install the faasmtools lib | ||
RUN pip3 install . | ||
|
||
# ----------------------------- | ||
# CPP EMULATOR | ||
# ----------------------------- | ||
|
||
RUN inv eigen --native | ||
|
||
RUN inv dev.cmake | ||
RUN inv dev.cc emulator | ||
|
||
# ----------------------------- | ||
# WASM LIBRARIES | ||
# ----------------------------- | ||
|
||
# Install files | ||
RUN inv install | ||
|
||
# Build libraries | ||
RUN inv libc | ||
|
||
# Install eigen to wasm | ||
RUN inv eigen | ||
|
||
# Install libffi | ||
RUN inv libffi | ||
|
||
# Both static and shared clapack | ||
RUN inv clapack | ||
RUN inv clapack --clean --shared | ||
|
||
# Install Faasm CPP wasm lib | ||
RUN inv libfaasm |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.