Skip to content

Commit 9bfabda

Browse files
authored
Merge pull request #1 from SonySemiconductorSolutions/test-ci
Edge Virtualization Platform v1.43.0
2 parents e6c0db8 + 4f5ca1c commit 9bfabda

File tree

92 files changed

+3312
-7872
lines changed

Some content is hidden

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

92 files changed

+3312
-7872
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/workflows/build.yml

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

.github/workflows/builder.yml

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

0 commit comments

Comments
 (0)