Skip to content

Latest commit

 

History

History
76 lines (50 loc) · 1.96 KB

File metadata and controls

76 lines (50 loc) · 1.96 KB

OpenFaaS Rust Hasura Action function

An OpenFaaS Hasura Action written in Rust actix-web.

Installation

faas template pull https://github.com/austinrivas/rust-hasura-action-template

Create Function

faas new <name> --lang rust-hasura-action

Testing

cargo test --manifest-path ./function/Cargo.toml

Format

cargo fmt --manifest-path ./function/Cargo.toml

Linting

cargo clippy --manifest-path ./function/Cargo.toml

Deployment

faas up -f function.yml --gateway $GATEWAY_URL

Remote Dev

This function includes an okteto.yml function to facilitate remote dev and debugging.

cd function
okteto up
 ✓  Development environment activated
 ✓  Files synchronized
    Namespace: austinrivas
    Name:      rust-hasura-action-hello
    Forward:   8080 -> 8080
               9229 -> 9229
okteto> fwatchdog

This will compile the function in the remote dev environment. Rust is fast code that compiles slow, so patience is a virtue here. Okteto will cache the build so that later compilations will be much faster.

Okteto will syncronize local changes with the remote environment.

Currently remote debugging is not implemented, however it is a future goal of this project.

This function is based on the OpenFaaS rust-hasura-action-template.

This template provides a thin wrapper around the actix-web Server.

Extras

This repo also contains an Okteto Remote Development Configuration for use on the Okteto Platform.

A github action is included that will trigger on pull request. This action runs the rust tests / lint / check / format.