Ocre is a container runtime for constrained devices. It leverages WebAssembly and Zephyr to support OCI-type application containers in a footprint up to 2,000 times smaller than traditional Linux-based container runtimes. Our mission is to modernize the embedded applications by making it as easy to develop and securely deploy apps on constrained edge devices as it is in the cloud.
This guide walks you through building and running Ocre on a simulated device using Zephyr's native_sim
target. For instructions on building and flashing Ocre to physical hardware, please refer to our documentation.
The application in ./src/main.c
demonstrates basic Ocre runtime usage by writing a hello world application to flash and executing it.
- Install Dependencies and Zephyr SDK
Complete the Install dependencies and the Install the Zephyr SDK sections for your host operating system from the Zephyr (v3.7.0) Getting Started Guide.
- Create a Virtual Python Environment (
venv
)
mkdir runtime && cd runtime
python3 -m venv .venv
source .venv/bin/activate
Note: You may need to install the python3-venv
package (or equivalent) on your host system beforehand.
- Install WEST
Install the west CLI tool, which is needed to build, run and manage Zephyr applications.
pip install west
- Initialize the workspace
This will checkout the Ocre runtime code and initalize the workspace.
west init -m git@github.com:project-ocre/ocre-runtime.git
- Update West
Next, we need to update the workspace with the latest Zephyr and WASM Micro Runtime code.
west update
- Install Additional Zephyr (pip) requirements
In order to build the Ocre runtime properly, you'll need to install a few remaining requirements for Zephyr.
pip install -r zephyr/scripts/requirements.txt
- Build the application
The following will build the firmware for the virtual, native_sim
target which will allow you to run the Ocre runtime on a simulated device, rather than a physical board.
west build -b native_sim ./application -d build -- -DMODULE_EXT_ROOT=`pwd`/application
- Run the application
Run the following command:
./build/zephyr/zephyr.exe
Distributed 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.