Powered by WebAssembly, the Ocre runtime is available in both Zephyr and Linux variants and supports OCI-like application containers in a footprint up to 2000x lighter than traditional container runtimes like Docker.
With Ocre, developers can run the exact same application container binaries written in choice of programming language on both the Linux and Zephyr-based runtime versions spanning CPU and MCU-based devices.
Our mission is to make it as easy to develop and securely deploy apps for the billions of embedded devices in the physical world as it is in the cloud.
Ocre supports a range of features depending on the platform. The table below summarizes the current support:
| Feature | Zephyr (native_sim, b_u585i_iot02a) | Linux |
|---|---|---|
| Ocre Runtime | ✅ | ✅ |
| Container Messaging | ✅ | ✅ |
| GPIO | ✅ | ❌ |
| Timers | ✅ | ✅ |
| Sensors | ✅ | ❌ |
| Networking | ✅ | ✅ |
| Filesystem | ✅ | ✅ |
| Interactive Shell | ✅ | ❌ |
- Zephyr: Full feature set, including hardware integration and shell.
- Linux: Core runtime and multiple I/O features; hardware and shell features are not available.
We provide an optional devcontainer for building Zephyr with Ocre. However, we suggest Zephyr development to be done in the host outside docker, because it will be easier to flash and debug the board, the devcontainer is provided as a quick and handy way of reproducing the environment we have in the CI.
Ocre is a collection of a External Zephyr module, a few sample applications and a an optional slim West project for building for a small set of platforms.
More boards are supported in Ocre with a full West Project, however, our optional West project can be used to get started fast and in our CI.
This will very quickly build the images for one of the officially supported boards. Open a terminal in Ubuntu 22.04 or newer and run:
Install Ubuntu dependencies:
sudo apt update
sudo apt upgrade
sudo apt install --no-install-recommends git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget python3-dev python3-venv python3-tk \
xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev libmagic1 curlInstall WASI-SDK:
mkdir /opt/wasi-sdk && \
curl -sSL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-29/wasi-sdk-29.0-$(uname -m | sed s/aarch64/arm64/)-linux.tar.gz | \
sudo tar zxvf - --strip-components=1 -C /opt/wasi-sdkCreate Zephyr project directory, venv and install python dependencies:
mkdir ~/zephyrproject
python3 -m venv ~/zephyrproject/.venv
source ~/zephyrproject/.venv/bin/activate
pip install littlefs-pythonZephyr workspace initialization:
cd ~/zephyrproject
west init -m https://github.com/ocre-project/ocre.git
west update
west zephyr-exportInstall SDK and Python packages:
west packages pip --install
west sdk install -t \
x86_64-zephyr-elf \
aarch64-zephyr-elf \
arm-zephyr-eabiBuild the sample application:
west build -p always -b b_u585i_iot02a ocre-runtime/src/samples/demo/zephyrConnect the board and flash the application:
west flashAlternatively, you can try the mini or supervisor samples.
These instructions work natively for Linux, MacOS and WSL2. If this is used in docker, it might require some special configuration for being able to flash or debug the board.
-
Follow the instructions on the Zephyr Getting Started Guide for your OS, until you can build a sample application from Zephyr.
-
Install
littlefs-python:pip install littlefs-python
-
Install WASI-SDK
WASI-SDK is expected to be installed in /opt/wasi-sdk.
Check-out the ocre-runtime repository alongside the zephyr repositories or anywhere and just build one of our sample applications like:
west build -p always -b <board> ocre-runtime/src/samples/<sample>/zephyrSee below for the available applications and officially supported boards.
You can also change the Kconfig options for Zephyr and ocre with:
west build -t menuconfigFollowed by:
west build
west flashThis will very quickly build the images for one of the officially supported boards. The devcontainer already includes the Zephyr SDK, WASI-SDK the Python venv and all the necessary tools.
Build and open the 'zephyr' devcontainer of this repository.
Open a terminal in the devcontainer and run:
west init .
west update
west build -p always -b <board> ocre-runtime/src/samples/<sample>/zephyrThe build artifacts are in the build/zephyr directory. You might need to set-up some docker mounts and permissions for flashing the board.
See below for the available applications and officially supported boards.
The officially supported boards are listed below:
| Board | Name |
|---|---|
native_sim |
32-bit native simulator |
native_sim/native/64 |
64-bit native simulator |
pico_plus2/rp2350b/m33 |
Pimoroni Pico Plus 2 |
b_u585i_iot02a |
B-U585I-IOT02A |
Other boards might work. Check the Zephyr documentation for a list of supported boards in Zephyr.
The officially supported sample applications are listed below:
| Sample | Description |
|---|---|
mini |
A simple "Hello World" application using minimal resources |
demo |
A more featured sample application |
supervisor |
Interactive shell control |
The intended usage of the samples are:
- Use the
minisample to see how Ocre can work on your board. - Use the
demosample to test some more Ocre features. - Use the
supervisorsample to have full interactive control from the shell command line.
We also provide a devcontainer for Linux. This is the recommended way to get started with Ocre on Linux. However these instructions will work for native Linux builds.
- Ubuntu 22.04 or later
- CMake > 3.20
- git > 2.28
- A working C compiler (gcc or clang)
- WASI-SDK installed under
/opt/wasi-sdk
Other Linux distributions might work, but are not actively tested.
You can get this easily on a new Ubuntu by running:
sudo apt update
sudo apt install -y cmake git build-essentialOr you can use the devcontainer, which already has everything preinstalled.
Clone the repository and the submodules:
git clone https://github.com/project-ocre/ocre-runtime.git
cd ocre-runtime
git submodule update --init --recursiveRun the CMake build, like:
mkdir build && cd build
cmake ..
makeThe relevant binaries are stored in build/src/samples/mini/posix and build/src/samples/demo/posix. You can run them directly:
./build/src/samples/mini/posix/miniDistributed under the Apache License 2.0. See LICENSE for more information.
- Website: For a high-level overview of the Ocre project, and its goals, visit our website.
- Docs: For more detailed information about the Ocre runtime, visit Ocre docs.
- Wiki: For a full project overview, FAQs, project roadmap, and governance information, visit the Ocre Wiki.
- Slack: If you need support or simply want to discuss all things Ocre, head on over to our Slack channel (
#ocre) on LFEdge's Slack org. - Mailing list: Join the Ocre Technical Steering Committee (TSC) mailing list to stay up to date with important project announcements, discussions, and meetings.
