Skip to content

Commit 117fc30

Browse files
gman4001ona-agent
andcommitted
devcontainer: add devcontainer.json and automations.yaml
Add a devcontainer configuration for the SOF repository using the mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04 base image with Python 3.12. This provides a reproducible development environment with cmake, ninja, gcc, and gdb pre-installed. The automations.yaml defines three tasks: - installDeps: installs ninja-build, clang, llvm, device-tree-compiler, python3-pyelftools, libasound2-dev, and west on container start. - westUpdate: runs 'west init -l . && west update' to fetch Zephyr and all manifest dependencies, triggered after installDeps completes. - buildTools: manually-triggered task that runs scripts/build-tools.sh to build host-side tools (logger, ctl, probes, topologies). Signed-off-by: gman4001 <gamblecolton4@gmail.com> Co-authored-by: Ona <no-reply@ona.com>
1 parent 69343e1 commit 117fc30

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "SOF",
3+
"image": "mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04",
4+
"features": {
5+
"ghcr.io/devcontainers/features/python": {
6+
"version": "3.12"
7+
}
8+
},
9+
"customizations": {
10+
"vscode": {
11+
"extensions": [
12+
"ms-vscode.cmake-tools",
13+
"ms-vscode.cpptools"
14+
]
15+
}
16+
}
17+
}

.ona/automations.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
tasks:
2+
installDeps:
3+
name: Install SOF build dependencies
4+
description: |
5+
Install system packages required to build SOF firmware and tools:
6+
ninja-build, clang, llvm, device-tree-compiler, python3-pyelftools,
7+
and the west Zephyr meta-tool.
8+
command: |
9+
sudo apt-get update -qq
10+
sudo apt-get install -y \
11+
ninja-build \
12+
clang \
13+
llvm \
14+
device-tree-compiler \
15+
python3-pyelftools \
16+
libasound2-dev \
17+
libglib2.0-dev \
18+
libssl-dev \
19+
pkg-config
20+
pip3 install --user west
21+
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
22+
export PATH="$HOME/.local/bin:$PATH"
23+
west --version
24+
triggeredBy:
25+
- postDevcontainerStart
26+
27+
westUpdate:
28+
name: Initialize west workspace
29+
description: |
30+
Run west init and west update to fetch Zephyr and all SOF manifest
31+
dependencies. This is required before any firmware build.
32+
command: |
33+
export PATH="$HOME/.local/bin:$PATH"
34+
# west init -l uses the local manifest (west.yml) without re-cloning sof
35+
west init -l .
36+
west update --narrow --fetch-opt=--filter=tree:0
37+
triggeredBy:
38+
- postDevcontainerStart
39+
dependsOn:
40+
- installDeps
41+
42+
buildTools:
43+
name: Build SOF host tools
44+
description: |
45+
Build the SOF host-side tools (logger, ctl, probes, topologies) using
46+
CMake + Ninja. Run manually after west workspace is initialized.
47+
command: |
48+
export PATH="$HOME/.local/bin:$PATH"
49+
./scripts/build-tools.sh
50+
triggeredBy:
51+
- manual
52+
dependsOn:
53+
- westUpdate

0 commit comments

Comments
 (0)