Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
234 commits
Select commit Hold shift + click to select a range
5bc126e
Revert "Minor fix on GPIO initialization (#113)"
casaroli Jan 7, 2026
c274807
Revert "Prevent slow-to-start containers from trying to run in the sa…
casaroli Jan 7, 2026
7e1b206
Revert "tests: Add initial test case for Modbus Server Container (#108)"
casaroli Jan 7, 2026
e2e8d31
Revert "tests: add external memory erase step for b_u585 board (#109)"
casaroli Jan 7, 2026
5a3ea62
Revert "Improve formatting (#107)"
casaroli Jan 7, 2026
512e1fe
Revert "Add lint support (#106)"
casaroli Jan 7, 2026
933d2b2
Revert "Enable AoT and fix ISA guess (#105)"
casaroli Jan 7, 2026
6d88562
Revert "Add exception handling (#104)"
casaroli Jan 7, 2026
d2731a2
Revert "Add RT1064 GPIO config (#103)"
casaroli Jan 7, 2026
b9a32d7
Revert "Ocre containers: Adding support for NRF5340-DK board (#93)"
casaroli Jan 7, 2026
c1c76ad
Revert "Add shared memory and DNS resolution support (#99)"
casaroli Jan 7, 2026
2aa1af0
Revert "const sample container (#101)"
casaroli Jan 7, 2026
79cf1cf
Revert "fix(sample_container): truncate file (#100)"
casaroli Jan 7, 2026
5f96834
feat(ocre): introduce user heap
casaroli Nov 17, 2025
9719d84
feat(zephyr): use shared multi heap for user heap
casaroli Nov 17, 2025
85906d0
feat(posix): dummy user heap wrapper
casaroli Nov 17, 2025
2d84046
feat(fs): load wasm module in user heap
casaroli Nov 17, 2025
7d22e78
feat(zephyr): realloc stub
casaroli Nov 17, 2025
7b96301
feat(wamr): use user heap
casaroli Nov 17, 2025
4b1ee95
ocre_mem: remove storage allocator
casaroli Nov 17, 2025
5125233
wamr: remove OCRE_WAMR_HEAP_BUFFER_SIZE
casaroli Nov 17, 2025
a788d12
Add shared memory and DNS resolution support (#99)
kr-t Nov 19, 2025
96e6456
build(devcontainer): Dockerfile
casaroli Dec 15, 2025
c38be2b
ci: build devcontainer
casaroli Dec 15, 2025
aa7ad4d
ci(devcontainer): add permission to write packages
casaroli Dec 15, 2025
fdc69f5
ci: build devcontainer
casaroli Dec 15, 2025
34f659e
chore(west): update manifest
casaroli Dec 16, 2025
81012a2
build(devcontainer): add Zephyr
casaroli Dec 16, 2025
9d5d506
ci(devcontainer): Zephyr
casaroli Dec 16, 2025
c9f93d1
build(devcontainer/linux): add clang-format
casaroli Dec 16, 2025
90ce00c
ci(devcontainer/zephyr): bump timeout
casaroli Dec 16, 2025
b943f07
ci(devontainer): do not build multiplatform
casaroli Dec 16, 2025
eb18115
ci: pass github UID and GID
casaroli Dec 16, 2025
20c3f79
chore: west.yml license banner
casaroli Dec 19, 2025
e759c28
big refactor
casaroli Dec 8, 2025
879775b
zephyr: rename user_data to storage_partition
casaroli Dec 8, 2025
904d83f
fix(ocre_timer): memory leak
casaroli Dec 8, 2025
462cf24
fix(container): remove
casaroli Dec 8, 2025
4a0c89d
fix(wamr): improve handling of ocre_api
casaroli Dec 8, 2025
11fe56b
fix(wamr): improve handling of main exit
casaroli Dec 8, 2025
c682845
fix(zephyr): bump number of threads and reserved heap
casaroli Dec 8, 2025
8cc33ab
build: do not build supervisor posix
casaroli Dec 8, 2025
6f47454
fix(shared_heap): use correct symbol
casaroli Dec 8, 2025
fae7c1d
fix(container): stack use after scope
casaroli Dec 8, 2025
cb3fb61
Remove spurious log message
casaroli Dec 8, 2025
30754c5
fix(posix): remove shell
casaroli Dec 8, 2025
8c8267e
feat(samples): demo
casaroli Dec 8, 2025
86041ed
add uthash LICENSE
casaroli Dec 9, 2025
d6b9f26
feat(context): add rm_rf function
casaroli Dec 9, 2025
a628320
feat(string_array): add function to search for an item
casaroli Dec 9, 2025
292cb7f
feat(context): manage working directory
casaroli Dec 9, 2025
db84c07
fix(context): improve cleanup of containers on termination
casaroli Dec 9, 2025
481a5d8
feat(runner_vtable): use workdir
casaroli Dec 9, 2025
41dca3c
feat(context): pass workdir to container
casaroli Dec 9, 2025
9ad2de1
fix(wamr): pause, unpause stubs and formatting fixes
casaroli Dec 9, 2025
c170854
fix(container): img path
casaroli Dec 9, 2025
54c86fd
fix(ocre): remove unused functions
casaroli Dec 9, 2025
7ebed6e
fix(samples/demo): improve logging
casaroli Dec 9, 2025
081b7e2
chore: remove .zed dir
casaroli Dec 9, 2025
372f654
feat(shell/create): process mount points
casaroli Dec 9, 2025
7f2c093
feat(container): process mount parameters
casaroli Dec 9, 2025
f1f99f4
feat(context): cleanup container workdirs
casaroli Dec 9, 2025
576a914
feat(runner/wamr): handle dir mounts and filesystem
casaroli Dec 9, 2025
e34c7e3
feat(file_mmap): silently handle NULL pointer
casaroli Dec 9, 2025
9b89a4a
feat(container): handle pause/unpause
casaroli Dec 10, 2025
492b67d
feat(shell): pause/unpause
casaroli Dec 10, 2025
d7407f0
fix(shell/create): clean up properly on error
casaroli Dec 10, 2025
02efd8e
feat(container): handle stop
casaroli Dec 10, 2025
fce1b2f
feat(shell): container stop
casaroli Dec 10, 2025
62b70f9
fix(shell): disable unsupported commands.
casaroli Dec 10, 2025
4772f9d
fix(shell): remove inspect
casaroli Dec 10, 2025
e414dd8
build: handle SDK sample containters in state information
casaroli Dec 10, 2025
9015d70
feat(samples/demo): add sample containers to build
casaroli Dec 10, 2025
c8c9244
build: handle sample images and state information
casaroli Dec 10, 2025
1f8c38c
chore(gitignore): handle hidden files
casaroli Dec 10, 2025
d0e8d05
chore: remove .vscode
casaroli Dec 10, 2025
7db11ba
build: improve handling of sample images and state info
casaroli Dec 10, 2025
8957fca
fix(context): only parse if arguments are provided
casaroli Dec 10, 2025
9dd45e0
fix(container): do not remove . or ..
casaroli Dec 10, 2025
1e63f95
remove spurious readline example
casaroli Dec 11, 2025
5847dad
build(wamr): enable WASI-Threads and disable libpthread
casaroli Dec 11, 2025
da369ff
feat(wamr): enable AOT
casaroli Dec 11, 2025
ec68f3b
feat(wamr): disable global heap pool
casaroli Dec 11, 2025
0c42494
fix(samples/supervisor): harmonize configurations
casaroli Dec 11, 2025
28b5cdb
fix(state_information): remove volumes
casaroli Dec 11, 2025
883a1b9
fix(.gitignore): typo
casaroli Dec 11, 2025
4cb406f
fix(log): fix loggin for POSIX and harmonize with zephyr
casaroli Dec 11, 2025
326c4ee
chore: remove libwebsockets
casaroli Dec 11, 2025
88b82be
chore: remove unused files
casaroli Dec 11, 2025
156545d
chore(util/rm_rf): remove verbose function
casaroli Dec 11, 2025
e5dfcb5
chore(util/string_array): use C comments
casaroli Dec 11, 2025
9204ce3
chore(platform/posix): file map cleanup
casaroli Dec 11, 2025
a75a15a
chore: formatting and remove spurious comments
casaroli Dec 11, 2025
3dba5c6
chore: remove spurious
casaroli Dec 11, 2025
af00831
chore(zephyr/kconfig): cleanup unused log config
casaroli Dec 11, 2025
4323197
fix(shell): handle getopt properly
casaroli Dec 11, 2025
ef23001
feat(shell/container): outputs
casaroli Dec 11, 2025
6a42925
fix(container): typo
casaroli Dec 11, 2025
06b015a
feat(supervisor): use startup function
casaroli Dec 11, 2025
a21a2db
feat(samples/mini): handle sample file
casaroli Dec 12, 2025
d2b3812
fix: honor FILESYSTEM and NETWORKING config options
casaroli Dec 12, 2025
083de6f
feat(context): create working directory structure on startup
casaroli Dec 15, 2025
228376a
feat(supervisor/zephyr): download file functionality
casaroli Dec 15, 2025
b9d0599
fix(shell/image/ls): additional error checks
casaroli Dec 15, 2025
6f6958a
fix(kconfig): enable HTTP and DNS client for shell
casaroli Dec 15, 2025
922dc2d
fix(download_file): initialize variables sock and fd
casaroli Dec 15, 2025
4f41e7c
feat(shell): move sha256_file out of ls
casaroli Dec 15, 2025
6ee6373
feat(shell): ocre image pull
casaroli Dec 15, 2025
10d1bd2
feat(samples/supervisor/zephyr): native sim overlay and config
casaroli Dec 15, 2025
4d8a6ee
fix(shell/ls): add missing import
casaroli Dec 15, 2025
653ec13
ci(zephyr): build
casaroli Dec 15, 2025
0dbebd9
chore(.gitignore): add .git
casaroli Dec 15, 2025
808cb8d
ci: build devcontainer
casaroli Dec 15, 2025
0d550f1
ci: linux workflow
casaroli Dec 15, 2025
48f30cd
build: remove invalid samples and modules
casaroli Dec 15, 2025
df99533
ci(linux): run mini and demo
casaroli Dec 15, 2025
4b168ab
chore(devcontainer/linux): add configuration
casaroli Dec 15, 2025
661641d
build: move uthash to ocre core
casaroli Dec 16, 2025
1948b9c
fix(context): use ocre_context_destroy
casaroli Dec 16, 2025
ee91c4d
fix(samples/demo): increase timeouts
casaroli Dec 16, 2025
481786c
feat(container): get image and id returns pointer to const
casaroli Dec 16, 2025
85431ab
feat(context): get workdir returns pointer to const
casaroli Dec 16, 2025
cd64a03
docs(doxygen): document public API
casaroli Dec 16, 2025
3b00c10
chore: remove unused VERSION file
casaroli Dec 16, 2025
2ac63fc
ci(devcontainer): Zephyr
casaroli Dec 16, 2025
ee4ed2f
fix(zephyr/wamr): support aarch64 and proper native posix
casaroli Dec 16, 2025
0f2e6e8
chore(devcontainer): remove old file
casaroli Dec 16, 2025
a65f7f3
fix(context): use mutex when removing container
casaroli Dec 16, 2025
d6ac58b
chore: fix formatting and comments
casaroli Dec 16, 2025
658ad6a
ci(zephyr): add build workflow
casaroli Dec 16, 2025
af743b1
ci(zephyr): remove user override
casaroli Dec 16, 2025
7721391
ci(zephyr): fix .venv path
casaroli Dec 16, 2025
def42ef
ci(zephyr): add build matrix
casaroli Dec 16, 2025
88f1b39
ci(zephyr): build zephyr samples
casaroli Dec 16, 2025
f46f91c
fix(samples/demo): remove spurious include
casaroli Dec 16, 2025
1a0a6f5
fix(samples/zephyr): add pico_plus2 conf and overlay
casaroli Dec 16, 2025
9208e29
ci(linux): do not specify user
casaroli Dec 16, 2025
b64b86b
ci(zephyr): upload build artifacts
casaroli Dec 16, 2025
258dca7
ci(zephir): add native_sim target
casaroli Dec 17, 2025
99bcf53
ci(zephyr): test native_sim mini and demo
casaroli Dec 17, 2025
5b11de7
fix(samples/zephyr/demo): do not build hex by default
casaroli Dec 17, 2025
db5b168
fix(samples/mini/zephyr): exit simulator when native_sim
casaroli Dec 17, 2025
ee81233
fix(random_id): include missing include
casaroli Dec 17, 2025
2864099
chore: cleanup and formatting
casaroli Dec 17, 2025
9c1331d
fix(pico_plus2): do not enable wifi
casaroli Dec 17, 2025
3e1a976
fix(zephyr/wamr): handle AOT configuration
casaroli Dec 17, 2025
a79a53d
build: honor WAMR log level configuration
casaroli Dec 17, 2025
0ed2f96
fix(kconfig): fix filesystem configuration
casaroli Dec 17, 2025
f59131b
chore(kconfig): removed unused configuration
casaroli Dec 17, 2025
d6c9423
build(samples/posix): handle pthread properly
casaroli Dec 17, 2025
103e7fd
fix(container): remove ocre_container_id_compare
casaroli Dec 17, 2025
2d34d85
doc(context): returns number of written containers
casaroli Dec 17, 2025
09b1c69
feat(ocre): remove ocre_initialize() function
casaroli Dec 17, 2025
bf4f8e4
build: handle build date separately
casaroli Dec 17, 2025
b8ee670
chore(devcontainer): formatting
casaroli Dec 17, 2025
643ed61
feat(ocre): enforce lowercase alphanumeric IDs
casaroli Dec 17, 2025
4b48aa5
chore: remove spurious sample
casaroli Dec 17, 2025
82533da
fix(shell/create): fix some error print line endings
casaroli Dec 17, 2025
cd77bd0
chore: clang-format
casaroli Dec 17, 2025
8d1f08e
chore(ocre_api): remove unused functions
casaroli Dec 17, 2025
b069590
fix: cppcheck warnings
casaroli Dec 17, 2025
be670af
chore(string_array): remove unused function
casaroli Dec 17, 2025
cf92be1
chore(memory): remove unused calloc function
casaroli Dec 17, 2025
e7a9254
fix(ocre_api): output formatting
casaroli Dec 17, 2025
bcbbed7
chore(sha256): remove unused functions
casaroli Dec 17, 2025
58492af
fix(shell/pull): remove useless check
casaroli Dec 17, 2025
5dfe6f8
fix(ocre_api): remove unnecessary check
casaroli Dec 17, 2025
01133c6
feat(samples): add posix static_check demo
casaroli Dec 17, 2025
394e1bd
doc(README): update
casaroli Dec 17, 2025
81504dd
fix(container): return error code if failed on EXITED
casaroli Dec 17, 2025
1e0964e
fix(context): handle invalid id correctly
casaroli Dec 17, 2025
1562a0f
chore(shell): add cppcheck suppression
casaroli Dec 17, 2025
177cc2d
chore(rm_rf): remove AI comment
casaroli Dec 17, 2025
4d634ce
chore: move unique_random_id to util
casaroli Dec 17, 2025
b70ab83
chore: move fstab overlay to its own file
casaroli Dec 17, 2025
c3d0aa8
feat(shell): ocre version command
casaroli Dec 17, 2025
beb3a24
fix ocre gpio
SorinOlari Dec 18, 2025
5164aaa
fix(ocre): remove undefined behavior on cleanup
casaroli Dec 18, 2025
6f8ab94
feat(ocre): do not accept two contexts with same workdir
casaroli Dec 18, 2025
f011548
feat(ocre): refuse to registers runtimes with same name
casaroli Dec 19, 2025
b4542f2
fix(context,ocre): use safe iterator for cleanup
casaroli Dec 19, 2025
bd71979
fix(context): improve error handling
casaroli Dec 19, 2025
3c34d56
fix(wamr): dir_map_list memory leak
casaroli Dec 19, 2025
8015413
fix(container, wamr): race condition on container_kill
casaroli Dec 19, 2025
4612f17
chore: add license banners
casaroli Dec 19, 2025
e256c05
ci: remove unused ref parameter
casaroli Dec 19, 2025
764b220
ci: add C formatting checks
casaroli Dec 19, 2025
50aaacc
chore: C formatting
casaroli Dec 19, 2025
4fd7869
chore: license banners
casaroli Dec 19, 2025
2de10b7
fix(ocre): print error message
casaroli Dec 19, 2025
28e538b
chore: fix format
casaroli Dec 19, 2025
c159d89
build(ocre_api): include GPIO selectively
casaroli Dec 19, 2025
360f9af
fix(ocre): rename functions
casaroli Dec 19, 2025
433c5e9
chore(samples/demo): formatting
casaroli Dec 19, 2025
868b811
fix(context): return error when not found
casaroli Dec 19, 2025
6db0460
chore: c formatting
casaroli Dec 22, 2025
561c63f
fix(container): restart
casaroli Dec 22, 2025
abf7588
feat(public_api): separate include files
casaroli Dec 22, 2025
3109fee
fix(wamr): do not free dir_map_list on create
casaroli Dec 22, 2025
b6b5f48
chore(test): move hw tests to its own directory
casaroli Dec 22, 2025
6102907
fix(container): stop: check for NULL before calling
casaroli Dec 22, 2025
c48aaec
fix(demo): reduce wait
casaroli Dec 22, 2025
289769a
build(demo): add run-demo make target
casaroli Dec 22, 2025
9cbe4ee
build(mini): add run-mini command
casaroli Dec 22, 2025
bd82cc9
build: cleanup main makefile
casaroli Dec 22, 2025
33ab86e
tests: add system tests
casaroli Dec 22, 2025
de251e2
build: memory leaks checker
casaroli Dec 22, 2025
dab66db
build: source code test coverage
casaroli Dec 22, 2025
b658dff
ci: run tests in CI
casaroli Dec 22, 2025
221ed57
test: add Unity test system
casaroli Dec 22, 2025
e1316e6
build(unity): typo
casaroli Dec 22, 2025
f36334f
ci: use self-hosted runners
casaroli Dec 22, 2025
b231009
ci(decontaier): add clang address sanitizer libs
casaroli Dec 22, 2025
1b20d4c
ci: improve devcontainer
casaroli Dec 22, 2025
22bba56
fix(ocre): remove spurious destruction of mutex
casaroli Dec 26, 2025
bfdebed
feat(container): use semaphore for start signalling
casaroli Dec 26, 2025
59915dd
ci(zephyr): use correct location for venv
casaroli Jan 5, 2026
de528ec
ci: pass user to container
casaroli Jan 5, 2026
508c53b
ci(zephyr): delete build directory before build
casaroli Jan 6, 2026
a8c8750
ci(zephyr): remove .west before init
casaroli Jan 6, 2026
33d5420
chore: delete unused file
casaroli Jan 7, 2026
2f5d1d4
chore: delete unused file
casaroli Jan 7, 2026
f544c62
chore: add license banners
casaroli Jan 7, 2026
611616c
chore: remove workspace file
casaroli Jan 7, 2026
8c14191
chore: remove spurious file
casaroli Jan 7, 2026
f760634
chore(gitignore): add .DS_Store
casaroli Jan 7, 2026
ec08a35
ci: use build server
casaroli Jan 7, 2026
b0063e3
chore: fix format
casaroli Jan 7, 2026
cd12c6a
chore: remove build.sh
casaroli Jan 8, 2026
860c94b
chore: remove spurious file
casaroli Jan 8, 2026
a1c5ffe
chore(ocre_api): remove obsolete file
casaroli Jan 8, 2026
1d06b9f
fix(zephyr): selection of WAMR architecture
casaroli Jan 8, 2026
0628ac3
feat(wamr): rename to wamr/wasip1
casaroli Jan 9, 2026
42243b1
feat(container): allow NULL runtime engine
casaroli Jan 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .devcontainer/devcontainer.json

This file was deleted.

58 changes: 58 additions & 0 deletions .devcontainer/linux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

FROM ubuntu:24.04 AS ocre-ci

ARG USERNAME=ocre-dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ARG NODE_MAJOR=20
ARG WASI_SDK_VERSION=29

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
gcc \
git \
gpg \
make \
build-essential \
cmake \
cppcheck \
clang \
clang-format \
clang-tools \
libclang-rt-dev \
llvm \
net-tools \
sudo \
jq \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y --no-install-recommends \
nodejs \
&& apt-get clean -y\
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 50

# Install wasi-sdk
Copy link
Contributor

Choose a reason for hiding this comment

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

there's also a wasi-sdk container that could be used as a base:

ghcr.io/webassembly/wasi-sdk

Copy link
Collaborator

Choose a reason for hiding this comment

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

The WASI SDK container is the SDK for building Wasm binaries not for building native binaries (though the compiler can output native code as well). It also changes fairly regularly. IMHO, we need to control the version of the toolchain we're using for builds more explicitly.

RUN mkdir /opt/wasi-sdk && \
curl -sSL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sdk-$WASI_SDK_VERSION.0-$(uname -m | sed s/aarch64/arm64/)-linux.tar.gz | \
tar zxvf - --strip-components=1 -C /opt/wasi-sdk

FROM ocre-ci AS ocre-dev

# Accomodate the user for devcontainer
RUN (userdel -r $USERNAME ; userdel -r `id -nu $USER_UID` ; groupdel `id -ng $USER_GID`) || true \
&& groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME

WORKDIR /home/$USERNAME
11 changes: 11 additions & 0 deletions .devcontainer/linux/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"build": {
"dockerfile": "Dockerfile",
"args": {
"USERNAME": "${localEnv:USER}",
"USER_UID": "${localEnv:REMOTE_UID:1000}",
"USER_GID": "${localEnv:REMOTE_GID:1000}"
}
},
"remoteUser": "${localEnv:USER}"
}
100 changes: 100 additions & 0 deletions .devcontainer/zephyr/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# @copyright Copyright (c) contributors to Project Ocre,
# which has been established as Project Ocre a Series of LF Projects, LLC
#
# SPDX-License-Identifier: Apache-2.0

FROM ubuntu:24.04 AS base

ARG USERNAME=ocre-dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID

ARG NODE_MAJOR=20
ARG WASI_SDK_VERSION=29

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
ca-certificates \
ccache \
clang \
clang-format \
clang-tools \
cmake \
cppcheck \
curl \
device-tree-compiler \
dfu-util \
file \
gcc \
git \
gperf \
gpg \
jq \
libmagic1 \
libsdl2-dev \
llvm \
make \
net-tools \
ninja-build \
python3-dev \
python3-venv \
python3-tk \
sudo \
wget \
xz-utils \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y --no-install-recommends \
nodejs \
&& apt-get clean -y\
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 50

# Install wasi-sdk
RUN mkdir /opt/wasi-sdk && \
curl -sSL https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-$WASI_SDK_VERSION/wasi-sdk-$WASI_SDK_VERSION.0-$(uname -m | sed s/aarch64/arm64/)-linux.tar.gz | \
tar zxvf - --strip-components=1 -C /opt/wasi-sdk

RUN python -m venv /opt/zephyr-venv && \
. /opt/zephyr-venv/bin/activate && \
pip install \
west \
littlefs-python

# Install the SDK on a separate stage to avoid layer cluttering

FROM base AS zephyr-sdk
Copy link
Contributor

Choose a reason for hiding this comment

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

probably you need many things in the same container, but you could use some of the zephyr's container images like

ghcr.io/zephyrproject-rtos/zephyr-build

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The zephyr containers are massive as they include all other toolchains and even more unnecessary stuff.

I tried to keep this container as thin as possible, unfortunately it is still very big (but small enough to work on GH public runners).

So this worked as a solution to use very similar images in devcontainer and GH workflows.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ideally, I would agree with @fgr-17 but @casaroli is correct, the Zephyr images are very large. On the GitHub hosted runners, you often very quickly run out of space when using these as the GH hosted runners have limited free storage space.


RUN mkdir -p /tmp/zephyrproject/ocre-runtime

COPY west.yml /tmp/zephyrproject/ocre-runtime/west.yml

RUN . /opt/zephyr-venv/bin/activate && \
cd /tmp/zephyrproject && \
west init -l ocre-runtime && \
west update -n zephyr && \
west packages pip --install && \
west sdk install --install-base /opt -t \
x86_64-zephyr-elf \
aarch64-zephyr-elf \
arm-zephyr-eabi

FROM base AS ocre-ci

COPY --from=zephyr-sdk /opt/. /opt

RUN printf "\n%s\n" '. /opt/zephyr-venv/bin/activate' >> /etc/skel/.bashrc

FROM ocre-ci AS ocre-dev

# Accomodate the user for devcontainer
RUN (userdel -r $USERNAME ; userdel -r `id -nu $USER_UID` ; groupdel `id -ng $USER_GID`) || true \
&& groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

USER $USERNAME

WORKDIR /home/$USERNAME
14 changes: 14 additions & 0 deletions .devcontainer/zephyr/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"build": {
"dockerfile": "Dockerfile",
"context": "../..",
"args": {
"USERNAME": "${localEnv:USER}",
"USER_UID": "${localEnv:REMOTE_UID:1000}",
"USER_GID": "${localEnv:REMOTE_GID:1000}"
}
},
"remoteUser": "${localEnv:USER}",
"postCreateCommand": "sudo chown ${localEnv:USER} .."

}
Loading