Skip to content

Conversation

@casaroli
Copy link
Contributor

@casaroli casaroli commented Jan 7, 2026

Description

Happy new year!

This is a major rewrite of Ocre. I am sorry for the massive PR. The main objectives were:

  • Decouple Ocre from the runtime engine
  • Simplify management of container features (capabilities)
  • Simplify the Ocre APIs
  • Fix as many issues as possible

I believe this rework will make Ocre better and safer, and it will also simplify the functionality we will want to add to Ocre in the future.

Some of the changes are listed below:

  • New thread-safe synchronous API (contexts, containers)
  • New interface for defining additional runtime engines
  • New interface for container features (capabilities)
  • Container lifecycle management functionality (exit status, wait)
  • Reworked build system
  • Uses only POSIX APIs available in most RTOS (pthreads, mutex, file, etc)
  • Targets Zephyr 4.3
  • Improvements to ocre-cli (image and container management)
  • Cleaner platform abstraction layer
  • Added tests, leak checks and source code coverage generation

Fixes:

Known issues

There are a few known issues that I plan on fixing in the near future after/if this gets accepted and merged.

  • ocre_gpio and ocre_sensor are probably broken
  • missing documentation
  • missing u585 CI build
  • missing nrf5340

Please, feel free to add any comments or questions. You are welcome to join our Slack server if you are looking for a warmer discussion. 😅

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code cleanup/refactoring
  • This change requires a documentation update
  • CI system update
  • Test Coverage update

How Has This Been Tested?

There are tests in the CI

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@casaroli casaroli requested review from kr-t and srberard as code owners January 7, 2026 09:52
@kr-t
Copy link
Collaborator

kr-t commented Jan 7, 2026

When it's merged, we are going to create issues right away to track missing (and, perhaps, new) features; additionally, legacy branch will be created to keep stable Ocre alive for a while, to give everyone time to get used to this new refactoring.

@kr-t
Copy link
Collaborator

kr-t commented Jan 7, 2026

Legacy branch is now protected (like the main) and can be found here: https://github.com/project-ocre/ocre-runtime/tree/legacy

@casaroli casaroli force-pushed the rework branch 3 times, most recently from fcb5fa9 to 47fbe91 Compare January 7, 2026 10:35
casaroli and others added 23 commits January 7, 2026 12:00
This reverts commit fbce6c2.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
…me slot (#114)"

This reverts commit 90cb917.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 533f2f5.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 314a647.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 0ba75c1.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 4b15a2e.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 7494611.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit cafad42.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit e9d8d04.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 4778e5c.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit f555f1b.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 6c98588.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This reverts commit 734ed5c.

This commit is kept in the legacy branch.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
the user_malloc and user_free functions will be used on platforms
with support for external PSRAM. This way we can differentiate
allocations in the internal or external RAM.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
These functions allocate memory on external PSRAM on boards that
have CONFIG_SHARED_MULTI_HEAP enabled.

Otherwise, they work just like core_malloc and core_free.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
On systems with a single heap, these functions work exactly the
same as malloc and free.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
The user heap is user for large objects.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Use the user heap for wamr and related container memory.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
In favor of the user heap mechanism.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
We now use the user heap mechanism.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Update wamr's hash to support networking DNS changes.

---------

Signed-off-by: Krisztian Szilvasi <34309983+kr-t@users.noreply.github.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
This docker image will be used in the CI and the devcontainer.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@casaroli
Copy link
Contributor Author

casaroli commented Jan 8, 2026

I spent a couple of hours but just reviewed like 25% of this massive PR. Will continue on the following days, just have minor comments for now.

Thank you very much for your inputs. I fixed the typos and answered some of the questions.

Looking forward to your next comments.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

closes #80

@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

Closes #115

@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

Closes #92

@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

Closes #94

@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

Closes #33

# SPDX-License-Identifier: Apache-2.0

# Determine the ISA of the target and set appropriately
if (DEFINED CONFIG_ISA_THUMB2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ISA determination shall be modified as in this commit: 7494611
Without this, Cortex boards won't be configured to THUMBV8M (our U585 board) and AoT won't be working correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done. but I used more robust Zephyr config variables instead.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the future - we might want to rethink how we group files:
earlier we had posix folder for posix build scripts, and zephyr for zephyr ones. Now we still have zephyr folder for zephyr ones, but the posix files are just all around - like here, in system/posix, in main Cmake file. This might be hard to maintain for new users without the repo knowledge.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this directory is for general cmake files (to be included in CMakeLists.txt) not specific for Zephyr or Linux, however with this specific file I still could not get it to work with Zephyr (just requires more work) and I hope in the near future we can have a single cmake (this one) for wamr in both platforms.

Now, we could have this file somewhere else, but we will eventually move it back here when we get the consistent implementation.

I suggest we keep it like this for this merge and then figure out what to in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I accept and agree w your suggestion.

@casaroli
Copy link
Contributor Author

casaroli commented Jan 8, 2026

Closes #33

*** Partially fixes #33

@casaroli
Copy link
Contributor Author

casaroli commented Jan 8, 2026

Closes #92

We did not delete this file. Should I?

@kr-t
Copy link
Collaborator

kr-t commented Jan 8, 2026

Closes #92

We did not delete this file. Should I?

oh. yes, please. this is obsolete.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Fix the selection of the WAMR architecture based on
more robust Zephyr configuration variables.

This enables proper support for ARM M33+ boards.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
```sh
pip install -r zephyr/scripts/requirements.txt
cd ~/zephyrproject
west init -m https://github.com/ocre-project/ocre.git
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong command - proper one:
west init -m https://github.com/project-ocre/ocre-runtime.git

```sh
git clone git@github.com:project-ocre/ocre-runtime.git
cd ocre-runtime
west build -p always -b b_u585i_iot02a ocre-runtime/src/samples/demo/zephyr
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, init command above will clone ocre in the default folder above called /application. We shall either change the path then here, or above init it w the proper dir name

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing info to clone submodules

@kr-t
Copy link
Collaborator

kr-t commented Jan 9, 2026

The PR in its current state look good to be merged; it is hard continuing working on some missing stuff, and the solution is to merge it as it is, and start fixing/adding stuff on the new state. It will give a possibility for other contributors to work on it. As mentioned before, legacy branch still contains the previous, stable Ocre-Runtime. That shall be used in stable environments for next few weeks.

Following PR notes were discussed and found w @casaroli beside his findings above. Proper GitHub issues will be created for anyone to work on these.

Missing or regressed features

  • Build script removed compared to previous releases.
  • U585 sample configs incomplete; samples cannot be built or tested without manual menuconfig work.
  • POSIX demos fail when run outside their directory because containers are not packaged with the app - accepted this way, but documentation shall explain this.
  • POSIX lost the ability to run arbitrary containers passed as arguments - this will be added in "Posix Supervisor" application.
  • Zephyr supervisor demo supports flashing arbitrary containers, but the commands are undocumented.
  • No CI coverage for U585.
  • The samples have not been systematically tested, so we do not know which ones currently work. This should be resolved with proper tests.
  • native_sim 32‑bit target misconfigured and missing from CI.
  • README contains outdated paths, and missing submodule instructions.

Miscellaneous

  • tests_hw should eventually be merged into tests/.
  • CI job names should distinguish between “build” and “build-and-run” to make behavior clear.
  • native_sim64 is not tested beside mini sample. demo is not working due to filesystem merge issues.
    Documentation
  • Add a sample or documentation section on customizing the runtime engine in OCRE.

To be more explicit about the environment, as we will have other
WAMR based non-wasi engines also in the future.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
In case the user passes a NULL runtime engine, we should try to
figure out the correct one, automatically.

In the future, we will read this from the container manifest, and
let the user override it, however for now, we just use wamr/wasip1
as the "default".

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
Copy link
Collaborator

@srberard srberard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just make sure to validate source headers for appropriate copyright and attribution in the README.

@kr-t kr-t merged commit 42243b1 into main Jan 13, 2026
13 checks passed
@kr-t kr-t deleted the rework branch January 13, 2026 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants