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

examples: add jwt example #43

Merged
merged 3 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 8 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: "Build Rabe"
- name: "Build Rabe and JWT"
run: |
export PATH=$PATH:/root/.cargo/env
rustup default stable
rustup target add wasm32-wasip1
./bin/inv_wrapper.sh rabe
./bin/inv_wrapper.sh rabe jwt
- name: "Build FFmpeg"
run: ./bin/inv_wrapper.sh ffmpeg
- name: "Build ImageMagick"
Expand Down Expand Up @@ -292,6 +292,12 @@ jobs:
# if: "contains(env.FAASM_WASM_VM, 'wamr')"
# timeout-minutes: 1
# run: faasmctl invoke rabe test
# TODO(faasm-bump): this is working, but we need to cut a new faasm release, uncomment
# when we do
# - name: "Run Rabe test"
# if: "contains(env.FAASM_WASM_VM, 'wamr')"
# timeout-minutes: 1
# run: faasmctl invoke jwt test
- name: "Print logs in case of failure"
if: failure()
run: faasmctl logs -s worker
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@
path = examples/rabe
url = https://github.com/faasm/rabe.git
branch = faasm
[submodule "examples/tless-jwt"]
path = examples/tless-jwt
url = https://github.com/faasm/tless-jwt.git
5 changes: 4 additions & 1 deletion docker/build.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ RUN mkdir -p code \
&& git submodule update --init -f examples/libpng \
&& git submodule update --init -f examples/polybench \
&& git submodule update --init -f examples/rabe \
&& git submodule update --init -f examples/tensorflow
&& git submodule update --init -f examples/tensorflow \
&& git submodule update --init -f examples/tless-jwt

# Build the examples and demo functions
ENV PATH=${PATH}:/root/.cargo/bin
Expand All @@ -63,6 +64,7 @@ RUN cd /code/examples \
&& inv polybench --native \
# Build the WASM applications
&& inv ffmpeg \
&& inv jwt \
# ImageMagick needs libpng
&& inv libpng imagemagick \
&& inv kernels \
Expand All @@ -75,6 +77,7 @@ RUN cd /code/examples \
&& inv tensorflow \
# These demo functions link with the cross-compiled static libraries
&& inv func ffmpeg check \
&& inv func jwt test \
&& inv func lammps chain \
&& inv func mpi migrate \
&& inv func rabe test \
Expand Down
1 change: 1 addition & 0 deletions examples/tless-jwt
Submodule tless-jwt added at 23fbc9
1 change: 1 addition & 0 deletions func/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function(faasm_example_func func_name file_name)
endfunction(faasm_example_func)

add_subdirectory(ffmpeg)
add_subdirectory(jwt)
add_subdirectory(lammps)
add_subdirectory(mpi)
add_subdirectory(rabe)
Expand Down
4 changes: 4 additions & 0 deletions func/jwt/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set(FAASM_USER jwt)

faasm_example_func(test test.cpp)
target_link_libraries(jwt_test libtless-jwt-cpp.a libtless-jwt.a)
28 changes: 28 additions & 0 deletions func/jwt/test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#include <tless_jwt.h>

#include <iostream>
#include <string>

// g++ main.cpp -L./target/debug -ltless_jwt
// ./a.out
// $ Verified!
// $ Not verified :-(
int main()
{
std::string goodJwt = "eyJhbGciOiJSUzI1NiIsImprdSI6Imh0dHBzOi8vZmFhc21hdHRwcm92LmV1czIuYXR0ZXN0LmF6dXJlLm5ldC9jZXJ0cyIsImtpZCI6IkowcEFQZGZYWEhxV1dpbWdySDg1M3dNSWRoNS9mTGUxejZ1U1hZUFhDYTA9IiwidHlwIjoiSldUIn0.eyJleHAiOjE3MjgwOT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)) {
std::cout << "Verified!" << std::endl;
} else {
std::cerr << "Not verified :-(" << std::endl;
}

if (tless::verify_jwt(badJwt)) {
std::cout << "Verified!" << std::endl;
} else {
std::cerr << "Not verified :-(" << std::endl;
}

return 0;
}
2 changes: 2 additions & 0 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from . import func
from . import git
from . import imagemagick
from . import jwt
from . import kernels
from . import lammps
from . import libpng
Expand All @@ -26,6 +27,7 @@
func,
git,
imagemagick,
jwt,
kernels,
lammps,
libpng,
Expand Down
69 changes: 69 additions & 0 deletions tasks/jwt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from faasmtools.build import CMAKE_TOOLCHAIN_FILE, get_faasm_build_env_dict
from invoke import task
from os import environ, makedirs
from os.path import exists, join
from shutil import copy, rmtree
from subprocess import run
from tasks.env import EXAMPLES_DIR


@task(default=True)
def build(ctx, clean=False):
"""
Compile TLess-JWT library (in Rust) and C++ bindings into a WASM library
"""
jwt_dir = join(EXAMPLES_DIR, "tless-jwt", "jwt-verify")

if clean:
rmtree(join(jwt_dir, "target"))

# First, cross-compile the rust library to WASM
cargo_cmd = "cargo build --release --target=wasm32-wasip1"
run(cargo_cmd, shell=True, check=True, cwd=jwt_dir)

# Install it in the WASM sysroot
build_env = get_faasm_build_env_dict()
src_lib = join(
jwt_dir, "target", "wasm32-wasip1", "release", "libtless_jwt.a"
)
dst_lib = join(build_env["FAASM_WASM_LIB_INSTALL_DIR"], "libtless-jwt.a")
copy(src_lib, dst_lib)

# Build the CPP bindings library, and cross-compile it to WASM
rabe_cpp_dir = join(jwt_dir, "cpp-bindings")
build_dir = join(rabe_cpp_dir, "build")

if clean and exists(build_dir):
rmtree(build_dir)
if not exists(build_dir):
makedirs(build_dir)

cmake_cmd = [
"cmake",
"-GNinja",
"-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_TOOLCHAIN_FILE={}".format(CMAKE_TOOLCHAIN_FILE),
rabe_cpp_dir,
]
cmake_cmd = " ".join(cmake_cmd)
print(cmake_cmd)

work_env = environ.copy()
work_env.update(get_faasm_build_env_dict())
print(build_dir)
run(cmake_cmd, shell=True, check=True, cwd=build_dir, env=work_env)
run("ninja", shell=True, check=True, cwd=build_dir)

# Install the library in the WASM sysroot
src_lib = join(build_dir, "libtless-jwt-cpp.a")
dst_lib = join(
build_env["FAASM_WASM_LIB_INSTALL_DIR"], "libtless-jwt-cpp.a"
)
copy(src_lib, dst_lib)

# Install the header in the WASM sysroot too
src_header = join(rabe_cpp_dir, "tless_jwt.h")
dst_header = join(
build_env["FAASM_WASM_HEADER_INSTALL_DIR"], "tless_jwt.h"
)
copy(src_header, dst_header)
Loading