Skip to content

Commit 432e0c8

Browse files
Edge Virtualization Platform v1.43.0
1 parent e6c0db8 commit 432e0c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+3731
-1580
lines changed

.devcontainer/raspi/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5858
&& apt-get clean -y\
5959
&& update-alternatives --install /usr/bin/python python /usr/bin/python3 50
6060

61-
RUN echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \
61+
RUN echo "deb https://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \
6262
curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
6363
apt-get update && apt-get install -y --no-install-recommends \
6464
clang-format-${LLVM_VERSION} \

.devcontainer/ubuntu/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
6262
# Remove this once stdeb is fully released for ubuntu:24.04 (python3.12)
6363
RUN pip3 install git+https://github.com/astraw/stdeb.git --break-system-packages
6464

65-
RUN echo "deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \
65+
RUN echo "deb https://apt.llvm.org/noble/ llvm-toolchain-noble-${LLVM_VERSION} main" > /etc/apt/sources.list.d/apt.llvm.org.list && \
6666
curl -sL https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc && \
6767
apt-get update && apt-get install -y --no-install-recommends \
6868
clang-format-${LLVM_VERSION} \

.github/CODEOWNERS

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
# The sole reason of this file is to make github assign reviews to
6+
# all team members explicitly.
7+
# Every member in https://github.com/orgs/midokura/teams/device/members
8+
# is responsible for review of any PRs in this repo.
9+
# The each members are intentionally listed here instead of @midokura/device
10+
# team because we want to assign reviews to individuals, not the team.
11+
#
12+
# https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-code-owners
13+
14+
* @midokura/device
15+
16+
# We need to ensure documentation is validated at PR time.
17+
# The validation must be done before merging to ensure we can do a release and
18+
# generate the documentation artifacts safely
19+
*.md @jimken-mido @midokura/device
20+
*.rst @jimken-mido @midokura/device

.github/pull_request_template.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
-->
6+
7+
<!-- Start badge -->
8+
<!-- End badge -->
9+
10+
## What?
11+
12+
Include an explanation of what are the changes about.
13+
14+
## Why?
15+
16+
Include an explanation of why we need the changes.

.github/workflows/build.yml

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
builder-tag:
9+
description: The builder tag to be used
10+
default: latest
11+
required: false
12+
type: string
13+
ref:
14+
type: string
15+
required: true
16+
17+
jobs:
18+
build-agent:
19+
name: Agent (${{ matrix.name }}, ${{ matrix.platform }})
20+
runs-on: ${{ matrix.runner }}
21+
container:
22+
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
23+
credentials:
24+
username: ${{ github.actor }}
25+
password: ${{ github.token }}
26+
options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }}
27+
timeout-minutes: 8 # the worst case is 3 minutes
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
include:
32+
- name: raspios-bookworm
33+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
34+
platform: arm64
35+
- name: ubuntu-noble
36+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
37+
platform: arm64
38+
- name: ubuntu-noble
39+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
40+
platform: amd64
41+
steps:
42+
- name: Checkout source
43+
uses: actions/checkout@v4
44+
with:
45+
ref: ${{ inputs.ref }}
46+
47+
- name: Build
48+
run: bear -- make -j$((`nproc` * 2)) CFLAGS="-g -Werror"
49+
50+
- name: Generate SBOM
51+
run: |
52+
./scripts/sources bin/evp_agent > sources.lst
53+
./scripts/mk-sbom -d -c `dpkg -l libc6 | awk '/libc6/ {print $3}'` sources.lst
54+
55+
- name: Agent Debian Package
56+
run: make dist
57+
58+
- name: Upload agent debian package
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: agent-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
62+
path: evp-agent*.deb
63+
64+
- name: Upload sdk debian package
65+
uses: actions/upload-artifact@v4
66+
with:
67+
name: libevp-app-sdk-dev-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
68+
path: libevp-app-sdk-dev*.deb
69+
70+
- name: Upload SBOM
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: sbom-agent-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
74+
path: |
75+
compile_commands.json
76+
sources.lst
77+
sbom.tsv
78+
sbom-files.txt
79+
sbom-tmp.txt
80+
81+
build-sdk:
82+
name: SDK (${{ matrix.name }}, ${{ matrix.platform }})
83+
runs-on: ${{ matrix.runner }}
84+
container:
85+
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
86+
credentials:
87+
username: ${{ github.actor }}
88+
password: ${{ github.token }}
89+
options: ${{ startsWith(matrix.runner, 'buildjet') && '--user 1000:1001' || '--user 1001:127' }}
90+
timeout-minutes: 8 # the worst case is 3 minutes
91+
strategy:
92+
fail-fast: false
93+
matrix:
94+
include:
95+
- name: raspios-bookworm
96+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
97+
platform: arm64
98+
- name: ubuntu-noble
99+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
100+
platform: arm64
101+
- name: ubuntu-noble
102+
runner: ${{ github.event.repository.private && 'buildjet-4vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
103+
platform: amd64
104+
105+
steps:
106+
- name: Checkout source
107+
uses: actions/checkout@v4
108+
with:
109+
ref: ${{ inputs.ref }}
110+
111+
- name: Build SDK
112+
run: make -j$((`nproc` * 2)) sdk \
113+
CFLAGS="-O2 -Werror" \
114+
KBUILD_DEFCONFIG=configs/linux-docker.config
115+
116+
- name: Install python test dependencies
117+
working-directory: src/python-evp-app-sdk
118+
run: |
119+
python3 -m venv .venv
120+
. .venv/bin/activate
121+
pip install \
122+
-e . \
123+
-r requirements.test.txt
124+
125+
- name: Run python SDK tests
126+
working-directory: src/python-evp-app-sdk
127+
run: |
128+
. .venv/bin/activate
129+
python -m pytest \
130+
--cov=evp.app \
131+
--cov-report="xml:pysdk-cov.xml" \
132+
--junit-xml="pysdk-test-res.xml" \
133+
-v
134+
135+
- name: Publish pytest coverage
136+
id: pysdk-cov
137+
uses: MishaKav/pytest-coverage-comment@main
138+
if: always()
139+
with:
140+
title: EVP Python Application SDK coverage report
141+
badge-title: Python Application SDK
142+
coverage-path-prefix: src/python-evp-app-sdk/evp/app/
143+
pytest-xml-coverage-path: src/python-evp-app-sdk/pysdk-cov.xml
144+
junitxml-path: src/python-evp-app-sdk/pysdk-test-res.xml
145+
junitxml-title: Python Application SDK test report
146+
147+
- name: Publish pytest results to summary
148+
if: steps.pysdk-cov.outputs.summaryReport
149+
run: echo ${{ steps.pysdk-cov.outputs.summaryReport }} >> $GITHUB_STEP_SUMMARY
150+
151+
- name: Build Python package
152+
working-directory: src/python-evp-app-sdk
153+
run: python3 -m build
154+
155+
- name: SDK Debian package
156+
working-directory: src/python-evp-app-sdk
157+
run: python setup.py --command-packages=stdeb.command bdist_deb
158+
159+
- uses: actions/upload-artifact@v4
160+
with:
161+
name: python-sdk-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
162+
path: src/python-evp-app-sdk/dist/*
163+
164+
- uses: actions/upload-artifact@v4
165+
with:
166+
name: python-sdk-deb-${{ matrix.name }}-${{ matrix.platform }}-${{ github.run_id }}
167+
path: src/python-evp-app-sdk/deb_dist/*.deb
168+
169+
run-static-analysis:
170+
name: Static Code Analysis
171+
runs-on: ubuntu-24.04
172+
container:
173+
image: ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ inputs.builder-tag }}
174+
options: --user 1001:127
175+
timeout-minutes: 8 # the worst case is 3 minutes
176+
177+
steps:
178+
- name: Checkout source
179+
uses: actions/checkout@v4
180+
with:
181+
ref: ${{ inputs.ref }}
182+
183+
- name: Run cppcheck analysis
184+
run: make -j$((`nproc` * 2)) CFLAGS="-Werror" TOOL=cppcheck analysis

.github/workflows/builder.yml

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
# SPDX-FileCopyrightText: 2023-2024 Sony Semiconductor Solutions Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
name: Build and push builders (if necessary)
6+
7+
on:
8+
workflow_dispatch:
9+
inputs:
10+
ref:
11+
description: The ref sha to checkout evp-agent
12+
type: string
13+
required: false
14+
default: main
15+
workflow_call:
16+
inputs:
17+
ref:
18+
type: string
19+
required: false
20+
outputs:
21+
builder-tag:
22+
description: tag
23+
value: ${{ jobs.builder-necessary.outputs.builder-tag }}
24+
25+
concurrency:
26+
group: ${{ github.workflow }} @ build-builders-${{ github.ref }}
27+
cancel-in-progress: true
28+
29+
jobs:
30+
builder-necessary:
31+
name: Is builder necessary?
32+
runs-on: ubuntu-24.04
33+
outputs:
34+
build: ${{ steps.changed-files.outputs.all_changed_and_modified_files != '' }}
35+
builder-tag: ${{ steps.builder-tag.outputs.tag }}
36+
steps:
37+
- uses: actions/checkout@v4
38+
with:
39+
fetch-depth: 0
40+
ref: ${{ inputs.ref }}
41+
42+
- uses: tj-actions/changed-files@v41
43+
id: changed-files
44+
with:
45+
files: |
46+
.devcontainer/ubuntu/Dockerfile
47+
.devcontainer/raspi/Dockerfile
48+
.github/workflows/builder.yml
49+
50+
- name: Set builder tag
51+
id: builder-tag
52+
run: |
53+
echo "Modified: ${{ steps.changed-files.outputs.all_changed_and_modified_files != '' }}"
54+
tag=${{ steps.changed-files.outputs.all_changed_and_modified_files != '' && github.ref != 'refs/heads/main' && github.sha || 'latest' }}
55+
echo "github.ref is: ${{ github.ref }}"
56+
echo "Is not main branch? ${{ github.ref != 'refs/heads/main' }}"
57+
echo "github.sha is: ${{ github.sha }}"
58+
echo "Tag: $tag"
59+
echo "tag=$tag" >> $GITHUB_OUTPUT
60+
echo Modified file list:
61+
for file in ${{ steps.changed-files.outputs.all_changed_and_modified_files }}; do
62+
echo "$file"
63+
done
64+
65+
build-push-raspi:
66+
name: Build and push raspios bookworm builder
67+
if: ${{ needs.builder-necessary.outputs.build == 'true' }}
68+
needs:
69+
- builder-necessary
70+
runs-on: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
71+
72+
steps:
73+
- name: Checkout the code
74+
uses: actions/checkout@v4
75+
76+
- name: Set up Docker Buildx
77+
uses: docker/setup-buildx-action@v3
78+
79+
- name: Login to Github Registry
80+
uses: docker/login-action@v3
81+
with:
82+
username: ${{ github.actor }}
83+
password: ${{ github.token }}
84+
registry: ghcr.io
85+
86+
- name: Build and push raspios bookworm builder
87+
uses: docker/build-push-action@v5
88+
with:
89+
context: .devcontainer/raspi
90+
file: .devcontainer/raspi/Dockerfile
91+
push: true
92+
tags: ghcr.io/${{ github.repository }}/builder-raspios-bookworm:${{ needs.builder-necessary.outputs.builder-tag }}
93+
94+
build-push-ubuntu:
95+
name: Build and push ubuntu noble (${{ matrix.platform }})
96+
if: ${{ needs.builder-necessary.outputs.build == 'true' }}
97+
needs:
98+
- builder-necessary
99+
runs-on: ${{ matrix.runner }}
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
include:
104+
- platform: amd64
105+
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-24.04' }}
106+
- platform: arm64
107+
runner: ${{ github.event.repository.private && 'buildjet-8vcpu-ubuntu-2204-arm' || 'ubuntu-24.04-arm' }}
108+
109+
steps:
110+
- name: Checkout the code
111+
uses: actions/checkout@v4
112+
113+
- name: Set up Docker Buildx
114+
uses: docker/setup-buildx-action@v3
115+
116+
- name: Login to Github Registry
117+
uses: docker/login-action@v3
118+
with:
119+
username: ${{ github.actor }}
120+
password: ${{ github.token }}
121+
registry: ghcr.io
122+
123+
- name: Build and push ubuntu builder
124+
uses: docker/build-push-action@v5
125+
with:
126+
context: .devcontainer/ubuntu
127+
file: .devcontainer/ubuntu/Dockerfile
128+
push: true
129+
provenance: false
130+
tags: ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-${{ matrix.platform }}
131+
132+
manifest-ubuntu:
133+
if: ${{ needs.builder-necessary.outputs.build == 'true' }}
134+
needs:
135+
- builder-necessary
136+
- build-push-ubuntu
137+
name: Docker manifest
138+
runs-on: ubuntu-24.04
139+
140+
steps:
141+
- name: Login to Github Registry
142+
uses: docker/login-action@v3
143+
with:
144+
username: ${{ github.actor }}
145+
password: ${{ github.token }}
146+
registry: ghcr.io
147+
148+
- name: Create and push multiarch manifests
149+
run: |
150+
docker manifest create \
151+
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }} \
152+
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-amd64 \
153+
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-arm64
154+
docker manifest push ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}

0 commit comments

Comments
 (0)