Giter Site home page Giter Site logo

djun / open-lambda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from open-lambda/open-lambda

0.0 0.0 0.0 111.38 MB

An open source serverless computing platform

License: Apache License 2.0

Shell 0.33% Python 18.22% C 8.81% Go 58.25% Rust 13.01% Makefile 1.03% Dockerfile 0.35%

open-lambda's Introduction

OpenLambda

CI License

OpenLambda is an Apache-licensed serverless computing project, written (mostly) in Go and based on Linux containers. The primary goal of OpenLambda is to enable exploration of new approaches to serverless computing. Our research agenda is described in more detail in a HotCloud '16 paper.

Build and Test

OpenLambda relies heavily on operations that require root privilege. To simplify this, we suggest that you run all commands as the root user. OpenLambda is only actively tested on Ubuntu 22.04 LTS.

Build and Test

Make sure you have all basic dependencies installed:

apt install docker.io llvm-12-dev libclang-common-12-dev build-essential python3

For a recent version of go, run the following:

wget -q -O /tmp/go.tar.gz https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
tar -C /usr/local -xzf /tmp/go.tar.gz
ln -s /usr/local/go/bin/go /usr/bin/go

Further, you need to have a recent nightly version of Rust, the wasm32 toolchain, and the cross tool installed. The easiest way to do this is.

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=nightly-2022-07-25
source $HOME/.cargo/env
rustup target add wasm32-unknown-unknown
cargo install cross

Finally, add your user to the docker group to enable cross-compilation of native binaries to open-lambda's environment. Do not forget to restart your shell/session afterwards!

sudo gpasswd -a $USER docker

You can build the ol and other resources with just make. Then make sure it passes the tests:

make test-all

Getting Started

You can create a new OL environment with the following comment:

./ol new

This creates a directory named default-ol with various OL resources. You can create an OL environment at another location by passing a -path=DIRNAME to the new command.

Default config settings were saved to ./default-ol/config.json. Modify them if you wish, then start an OL worker (if you used -path above, use it again with the worker command):

./ol worker

In another terminal, make sure the worker is running with ./ol status.

Now save the following to ./default-ol/registry/echo.py:

def f(event):
    return event

Now invoke your lambda (the result should be the same as the POST body):

curl -X POST localhost:5000/run/echo -d '{"hello": "world"}'

When you're done, just kill the worker with ctrl-C. If you want to run the worker in detached mode (i.e., in the background), just start it again with the -d flag:

./ol worker -d

You can shutdown a detached worker like this:

./ol kill

License

This project is licensed under the Apache License - see the LICENSE.md file for details.

open-lambda's People

Contributors

andthedaysgoby avatar benpgel avatar dennisszhou avatar dependabot[bot] avatar edoakes avatar emmabrostrom avatar ethangyoung avatar gaumala avatar gtbai avatar gtotoy avatar hereneric avatar kaimast avatar kevhouck avatar lnyng avatar mkellum avatar nathantp avatar nnadams avatar phonyphonecall avatar stanso avatar sturdevant avatar tylerharter avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.