GithubHelp home page GithubHelp logo

enarx / codex Goto Github PK

View Code? Open in Web Editor NEW
21.0 21.0 14.0 578 KB

Code examples that can be compiled to WebAssembly for use with Enarx

License: Apache License 2.0

Nix 93.30% Shell 1.76% Python 4.94%

codex's Introduction



Test Status Bug Status Maintenance Status Coverage Status

Enarx

This crate provides the enarx command-line tool for running applications inside Trusted Execution Environments (TEEs) using technologies such as Intel SGX and AMD SEV-SNP.

For more information about Enarx, please visit the Enarx project website.

For a quick introduction to Enarx and its goals, please see our Getting Started Guide, and for a more in-depth look please see our Technical Overview.

Using Enarx

For instructions on installing the Enarx command-line tool, please see our Quick Installation Guide.

For instructions on how to build an application that can be run within Enarx, please see our WebAssembly Guide.

Contributing to Enarx

For instructions on how to build and contribute to Enarx, please see our Contributing Guide.

For an overview of the codebase, please see our Repo Guide.

codex's People

Contributors

bstrie avatar dependabot[bot] avatar haraldh avatar ishmeals avatar kieranjazy avatar maxgraey avatar muhammad-owais-javed avatar npmccallum avatar platten avatar puiterwijk avatar rjzak avatar rvolosatovs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

codex's Issues

[Feature]: Chat app in Enarx Keep (Rust)

Is there an existing issue for this?

  • I have searched the existing issues

Description

Description: Develop a chat client using a simple custom protocol running in Enarx. The project can be done in a programming language of your choice and a reference implementation in Rust along with a common Web interface will be provided. One of the main case studies for Confidential Computing is the Signal messaging application, which offers end-to-end encryption using Intel SGX. A chat app in Enarx would be cross-platform.
MVP: Terminal chat client
Stretch goal: Connect the client to a provided Web Interface
Language: Rust, C, or C++
Skills/Background: Networking
Mentor: Richard, Roman
Difficulty: Medium/Hard

This project is part of Semester of Code:
https://github.com/jhu-ospo-courses/JHU-EN.601.270/tree/main/Fall_2022#enarx-projects

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Bug]: Examples disregard `FD_COUNT` and `FD_NAMES` env variables

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

FD_COUNT and FD_NAMES env variables are provided to e.g. Rust examples, but they completely disregard them and instead use hard-coded values. Often without even checking FD_COUNT.

Expected Behaviour

Since we want to show the best practices in examples in this repo, the env variables should be respected.

Environment Information

irrelevant

Steps To Reproduce

No response

[Feature]: Extract demo repository

Is there an existing issue for this?

  • I have searched the existing issues

Description

We should extract the demo applications from this repository to a separate one to make sure this one is just a set of code examples

Acceptance Criteria

No response

Suggestions for a technical implementation

I think we should rename this repo to demos, restructure a bit and create proper code examples in a separate repo

[Feature]: Secure notes inside Enarx Keep

Is there an existing issue for this?

  • I have searched the existing issues

Description

Description: Develop a web-based in-memory private text sharing application. Once users connect, they are asked for authentication via an OpenID Connect/OAuth2 provider and have access to either create a new note or read an existing one.
MVP: Notes are private and can only be read by the creator.
Stretch Goal: Sharing notes with a list of users (identified via OIDC subject ID)
Language: Any supported language
Skills/Background: Web development/frameworks
Mentor: Richard, Roman
Difficulty: Easy/Medium
Examples: https://www.pastebin.com/, https://etherpad.org/, https://pad.riseup.net/

This project is part of Semester of Code:
https://github.com/jhu-ospo-courses/JHU-EN.601.270/tree/main/Fall_2022#enarx-projects

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Bug]: C++ chat client outputs numbers to the log

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

$ enarx deploy file://$(pwd)/cpp
hello
6
test
5
hy
3
hmm weird output
4
6
7

Expected Behaviour

$ enarx deploy file://$(pwd)/cpp
hello
test
hy
hmm weird output

Environment Information

irrelevant

Steps To Reproduce

  1. Start the Rust chat-server
  2. Start the C++ chat-client
  3. Type messages
  4. Observe numbers being printed to the log

[Feature]: Document C, C++, Rust chat clients and server

Is there an existing issue for this?

  • I have searched the existing issues

Description

For the Semester of Code, we would like to ask the students Kieran and UD to document how to the C, C++, and Rust chat clients and server work.

Acceptance Criteria

This documentation would be part of the Codex README for each implementation and also one or more tutorials over at Wasm.Builders.

Suggestions for a technical implementation

No response

[Bug]: Zig fails to run on Enarx

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

fibonacci of 7 is: 13 
 Error: Exited with i32 exit status 0
wasm backtrace:
    0:  0xd89 - <unknown>!<wasm function 7>

This fails only on Enarx

Enarx tracking issue enarx/enarx#2090 (and another one to be filed)

Expected Behaviour

Success.

Environment Information

enarx 0.6.1

Steps To Reproduce

No response

[Feature]: `nim` support

Is there an existing issue for this?

  • I have searched the existing issues

Description

Some work has been done in #40, but it's not complete.
That PR can (or not) be used as a starting point for this issue

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

HTTP client example

We have server examples, we should also have client examples. Ideally, the client examples would be able to connect to the server examples.

[Bug]: Enarx.toml is missing field `prot` for key `files` at line 12 column 1

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

The example on try.enarx.dev for http-rust-tokio is failing with:

Starting workload...
Error: failed to fetch package

Caused by:
0: failed to parse config
1: missing field prot for key files at line 12 column 1

Expected Behaviour

It is not failing.

Environment Information

N/A

Steps To Reproduce

  1. Got to try.enarx.dev
  2. Try to start http-rust-tokio example. It fails with the message.

Webassembly feature matrix

The readme should contain a feature matrix giving an overview of webassembly support for each language. A very basic matrix can currently be found at, but we should flesh it out with information like wasi support, I/O support, socket support, etc.

[Bug]: C++ chat client does not print server output to the log

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

C++ chat client can only be killed by ^C

Expected Behaviour

Once the user is done sending messages, ^D should close the stdin and trigger messages to be read from the socket and printed to the log (just like the Rust client)

Environment Information

irrelevant

Steps To Reproduce

No response

[Bug]: tokio-http example fails to compile

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct

Current Behaviour

Follow instructions here: https://enarx.dev/docs/webassembly/rust
rustup target install wasm32-wasi
Attempt to build https://github.com/enarx/codex/tree/main/Rust/tokio-http

[mike@gelid tokio-http]$ cargo build
   Compiling proc-macro2 v1.0.40
   Compiling unicode-ident v1.0.1
   Compiling autocfg v1.1.0
   Compiling quote v1.0.20
   Compiling syn v1.0.98
   Compiling libc v0.2.126
   Compiling futures-core v0.3.21
   Compiling pin-project-lite v0.2.9
   Compiling cfg-if v1.0.0
   Compiling log v0.4.17
   Compiling once_cell v1.12.0
   Compiling memchr v2.5.0
   Compiling futures-sink v0.3.21
   Compiling futures-channel v0.3.21
   Compiling futures-task v0.3.21
   Compiling wasi v0.11.0+wasi-snapshot-preview1
   Compiling futures-util v0.3.21
   Compiling futures-io v0.3.21
   Compiling pin-utils v0.1.0
   Compiling httparse v1.7.1
   Compiling bytes v1.1.0
   Compiling fnv v1.0.7
   Compiling itoa v1.0.2
   Compiling httpdate v1.0.2
   Compiling tracing-core v0.1.27
   Compiling slab v0.4.7
   Compiling tokio v1.20.0 (https://github.com/tokio-rs/tokio?rev=56be5286ee9548c483b91b7593ededcd34c5da0b#56be5286)
   Compiling http v0.2.8
   Compiling mio v0.8.4
error[E0658]: use of unstable library feature 'wasi_ext'
 --> /home/mike/.cargo/registry/src/github.com-1ecc6299db9ec823/mio-0.8.4/src/io_source.rs:5:5
  |
5 | use std::os::wasi::io::AsRawFd;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #71213 <https://github.com/rust-lang/rust/issues/71213> for more information
  = help: add `#![feature(wasi_ext)]` to the crate attributes to enable

For more information about this error, try `rustc --explain E0658`.
error: could not compile `mio` due to previous error
warning: build failed, waiting for other jobs to finish...

Expected Behaviour

Compile should complete with no errors.

Environment Information

[mike@gelid tokio-http]$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home:  /home/mike/.rustup

installed toolchains
--------------------

stable-x86_64-unknown-linux-gnu
nightly-x86_64-unknown-linux-gnu (default)
1.57-x86_64-unknown-linux-gnu

installed targets for active toolchain
--------------------------------------

wasm32-wasi
x86_64-unknown-linux-gnu
x86_64-unknown-linux-musl

active toolchain
----------------

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.64.0-nightly (4d6d601c8 2022-07-26)

Steps To Reproduce

See above.

[Feature]: Add Cryptle demo

Is there an existing issue for this?

  • I have searched the existing issues

Description

https://github.com/enarx/cryptle should be added to this repo, I'd suggest using a submodule at least to start with.
That'd also be consistent with e.g. #4, where we are going to use submodules anyway

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Feature]: Benchmarking of WebAssembly/WASI

Is there an existing issue for this?

  • I have searched the existing issues

Description

Description: WebAssembly/WASI support varies widely across different programming languages. The goal is to create a testing framework that will automatically generate a matrix showing information like I/O support, socket support, file size, execution time, etc. This framework will run code samples from our Codex repository (https://github.com/enarx/codex/).
Language: Bash
Skills/Background: GitHub Actions
Mentor: Roman
Difficulty: Medium/Hard

This project is part of Semester of Code:
https://github.com/jhu-ospo-courses/JHU-EN.601.270/tree/main/Fall_2022#enarx-projects

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Feature]: Create a web interface for the chat client

Is there an existing issue for this?

  • I have searched the existing issues

Description

The existing chat client should be extended to provide a web interface to send and receive messages.

This would allow to overcome the inability to use threads to simultaneously receive and send messages.

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Feature]: Restructure `examples` directory

Is there an existing issue for this?

  • I have searched the existing issues

Description

This is the current structure:

git ls-files examples
examples/README.md
examples/assemblyscript/README.md
examples/c#/README.md
examples/c++/README.md
examples/c/README.md
examples/go/README.md
examples/grain/README.md
examples/javascript/README.md
examples/ruby/README.md
examples/rust/README.md
examples/rust/mio/echo-tcp/Cargo.lock
examples/rust/mio/echo-tcp/Cargo.toml
examples/rust/mio/echo-tcp/Enarx.toml
examples/rust/mio/echo-tcp/LICENSE
examples/rust/mio/echo-tcp/README.md
examples/rust/mio/echo-tcp/src/main.rs
examples/rust/std/tcp-client/Cargo.lock
examples/rust/std/tcp-client/Cargo.toml
examples/rust/std/tcp-client/Enarx.toml
examples/rust/std/tcp-client/LICENSE
examples/rust/std/tcp-client/README.md
examples/rust/std/tcp-client/src/main.rs
examples/rust/tokio/echo-tcp/.cargo/config
examples/rust/tokio/echo-tcp/Cargo.lock
examples/rust/tokio/echo-tcp/Cargo.toml
examples/rust/tokio/echo-tcp/Enarx.toml
examples/rust/tokio/echo-tcp/README.md
examples/rust/tokio/echo-tcp/src/main.rs
examples/rust/tokio/http/.cargo/config
examples/rust/tokio/http/Cargo.lock
examples/rust/tokio/http/Cargo.toml
examples/rust/tokio/http/Enarx.toml
examples/rust/tokio/http/LICENSE
examples/rust/tokio/http/README.md
examples/rust/tokio/http/src/date.rs
examples/rust/tokio/http/src/enarx-white.svg
examples/rust/tokio/http/src/fireworks.gif
examples/rust/tokio/http/src/index.html
examples/rust/tokio/http/src/main.rs
examples/rust/tokio/http/src/protocol.rs
examples/swift/README.md
examples/typescript/README.md
examples/zig/README.md

(introduced in #55 )

I believe a much more useful structure would look like:

...
examples/http-client/c
examples/http-server/c
examples/http-server/rust/std
examples/http-server/rust/tokio
...

This way developers can immediately look for the exact functionality they want to implement, and, if an example for the language of their choice is missing - look for examples in different languages they're familiar with. Currently, developers are presented with an empty directory for the language of their choice and then either assume that the language is not supported or have to search through the repository.

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Feature]: Add Microsoft demo as a submodule

Is there an existing issue for this?

  • I have searched the existing issues

Description

Microsoft demo should be added to this repo as a submodule

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

[Feature]: Go echo server example

Is there an existing issue for this?

  • I have searched the existing issues

Description

We should add Go echo server example from enarx/enarx#1639 with set up instructions. We should probably provide 2 examples here TLS and TCP.

Acceptance Criteria

No response

Suggestions for a technical implementation

No response

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.