{"id":22936022,"url":"https://github.com/project-ocre/ocre-runtime","last_synced_at":"2025-08-12T18:31:37.092Z","repository":{"id":253298198,"uuid":"843043212","full_name":"project-ocre/ocre-runtime","owner":"project-ocre","description":null,"archived":false,"fork":false,"pushed_at":"2024-11-07T21:53:01.000Z","size":453,"stargazers_count":35,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-07T22:35:39.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/project-ocre.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-15T16:54:46.000Z","updated_at":"2024-11-07T21:53:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"65df250e-2e0b-487f-a730-bf089dcf7f11","html_url":"https://github.com/project-ocre/ocre-runtime","commit_stats":null,"previous_names":["project-ocre/ocre-runtime"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-ocre%2Focre-runtime","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-ocre%2Focre-runtime/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-ocre%2Focre-runtime/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/project-ocre%2Focre-runtime/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/project-ocre","download_url":"https://codeload.github.com/project-ocre/ocre-runtime/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229699846,"owners_count":18109854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-14T12:00:49.848Z","updated_at":"2025-08-12T18:31:37.077Z","avatar_url":"https://github.com/project-ocre.png","language":"C","funding_links":[],"categories":["Libraries"],"sub_categories":["Containerization"],"readme":"![Ocre logo](ocre_logo.jpg \"Ocre\")\n\n# Ocre\n\n[![Build](https://github.com/project-ocre/ocre-runtime/actions/workflows/build.yml/badge.svg)](https://github.com/project-ocre/ocre-runtime/actions/workflows/build.yml)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9691/badge)](https://www.bestpractices.dev/projects/9691)\n[![License](https://img.shields.io/github/license/project-ocre/ocre-runtime?color=blue)](LICENSE)\n[![slack](https://img.shields.io/badge/slack-ocre-brightgreen.svg?logo=slack)](https://lfedge.slack.com/archives/C07F190CC3X)\n[![Stars](https://img.shields.io/github/stars/project-ocre/ocre-runtime?style=social)](Stars)\n\nPowered 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.\n\nWith 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.\n\nOur 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.\n\n---\n\n## Features \u0026 Platform Support\n\nOcre supports a range of features depending on the platform. The table below summarizes the current support:\n\n| Feature                | Zephyr (native_sim, b_u585i_iot02a) | Linux x86_64  |\n|------------------------|:-----------------------------------:|:-------------:|\n| Ocre Runtime           | ✅                                  | ✅           |\n| Container Messaging    | ✅                                  | ❌           |\n| GPIO                   | ✅                                  | ❌           |\n| Timers                 | ✅                                  | ❌           |\n| Sensors                | ✅                                  | ❌           |\n| Networking             | ❌                                  | ✅           |\n| Interactive Shell      | ✅                                  | ❌           |\n\n- **Zephyr**: Full feature set, including hardware integration and shell.\n- **Linux x86_64**: Core runtime and networking only; hardware and shell features are not available.\n\n---\n\n## Getting Started\n\nThis guide will help you build and run Ocre on both Zephyr (simulated and hardware) and Linux.\n\n### Prerequisites\n\n- **Zephyr SDK** (for Zephyr targets)\n- **Python 3** (for build tooling)\n- **CMake** and **make** (for Linux builds)\n- **west** (Zephyr meta-tool)\n- **git**\n\n---\n\n### Setup\n\n#### Zephyr\n\nFollow the [Zephyr Getting Started Guide](https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html) for your OS, including:\n- [Install dependencies](https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html#install-dependencies)\n- [Install the Zephyr SDK](https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html#install-the-zephyr-sdk)\n\n#### Python Virtual Environment (Recommended)\n\n```sh\nmkdir runtime \u0026\u0026 cd runtime\npython3 -m venv .venv\nsource .venv/bin/activate\n```\nYou may need to install `python3-venv` on your system.\n\n#### Install West\n\nInstall the [west](https://docs.zephyrproject.org/latest/develop/west/index.html) CLI tool, which is needed to build, run and manage Zephyr applications.\n\n```sh\npip install west\n```\n\n#### Initialize and Update Zephyr Workspace\n\n```sh\nwest init -m git@github.com:project-ocre/ocre-runtime.git\nwest update\n```\n\n#### Install Zephyr Python Requirements\n\n```sh\npip install -r zephyr/scripts/requirements.txt\n```\n\n---\n\n#### Linux\n\n#### Clone the Repository\n\n```sh\ngit clone git@github.com:project-ocre/ocre-runtime.git\ncd ocre-runtime\n```\n\n#### Initialize submodules\n```sh\ngit submodule update --init --recursive\n```\n\n---\n\n## Building and Running\n\n### Using the `build.sh` Script (Recommended)\n\nOcre provides a convenient `build.sh` script to simplify building and running for both Zephyr and Linux targets.\n\n#### Usage\n\n```sh\n./build.sh -t \u003ctarget\u003e [-r] [-f \u003cfile1\u003e [file2 ...]] [-b] [-h]\n```\n\n- `-t \u003ctarget\u003e`: **Required**. `z` for Zephyr, `l` for Linux.\n- `-r`: Run after build (optional).\n- `-f \u003cfile(s)\u003e`: Specify one or more input files (optional).\n- `-b`: (Zephyr only) Build for `b_u585i_iot02a` board instead of `native_sim`.\n- `-h`: Show help.\n\n#### Examples\n\n**Build and run for Zephyr native_sim:**\n```sh\n./build.sh -t z -r\n```\n\n**Build for Zephyr b_u585i_iot02a board:**\n```sh\n./build.sh -t z -b\n```\n\n**Build and run for Linux with a WASM file:**\n```sh\n./build.sh -t l -r -f your_file.wasm\n```\n\n---\n\n### Manual Build Steps\n\n#### Zephyr (native_sim)\n\n```sh\nwest build -b native_sim ./application -d build -- -DMODULE_EXT_ROOT=`pwd`/application\nwest flash\n```\n\n#### Zephyr (b_u585i_iot02a)\n\n```sh\nwest build -b b_u585i_iot02a ./application -d build -- -DMODULE_EXT_ROOT=`pwd`/application\n# Flash to board (requires hardware)\nwest flash\n```\n\n#### Linux x86_64\n\n```sh\nmkdir -p build\ncd build\ncmake .. -DTARGET_PLATFORM_NAME=Linux\nmake\n./app your_file.wasm\n```\n\n---\n\n## Additional Notes\n\n- The `build.sh` script will automatically detect the target and handle build/run steps, including passing input files and selecting the correct Zephyr board.\n- For Zephyr, only the first file specified with `-f` is passed as the input file (see script for details).\n- For Linux, you can pass multiple WASM files as arguments to the built application.\n- The script checks build success and only runs the application if the build completes successfully.\n- The `mini-samples` directory contains a \"Hello World\" container, which is hardcoded as a C array. When Ocre is run without input file arguments, it executes this sample container by default. If an input file is provided, Zephyr will convert that file into a C array at build time and run it as a container. On Linux, this conversion does not occur — instead, Ocre simply opens and reads the provided file(s) directly from the filesystem.\n\n---\n\n## License\n\nDistributed under the Apache License 2.0. See [LICENSE](https://github.com/project-ocre/ocre-runtime/blob/main/LICENSE) for more information.\n\n---\n\n## More Info\n* **[Website](https://lfedge.org/projects/ocre/)**: For a high-level overview of the Ocre project, and its goals, visit our website.\n* **[Docs](https://docs.project-ocre.org/)**: For more detailed information about the Ocre runtime, visit Ocre docs.\n* **[Wiki](https://lf-edge.atlassian.net/wiki/spaces/OCRE/overview?homepageId=14909442)**: For a full project overview, FAQs, project roadmap, and governance information, visit the Ocre Wiki.\n* **[Slack](https://lfedge.slack.com/archives/C07F190CC3X)**: 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.\n* **[Mailing list](https://lists.lfedge.org/g/Ocre-TSC)**: Join the Ocre Technical Steering Committee (TSC) mailing list to stay up to date with important project announcements, discussions, and meetings.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-ocre%2Focre-runtime","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fproject-ocre%2Focre-runtime","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fproject-ocre%2Focre-runtime/lists"}