Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
47 changes: 44 additions & 3 deletions .github/workflows/build-dev-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
yml: ${{ steps.filter.outputs.yml }}
android: ${{ steps.filter.outputs.android }}
ubuntu: ${{ steps.filter.outputs.ubuntu }}
ubuntu-cross: ${{ steps.filter.outputs.ubuntu-cross }}
steps:
- uses: dorny/paths-filter@v3
id: filter
Expand All @@ -29,9 +30,14 @@ jobs:
- 'infra/docker/android-sdk/**'
ubuntu:
- '.github/**'
- 'infra/docker/focal/**'
- 'infra/docker/jammy/**'
- 'infra/docker/noble/**'
- 'infra/docker/focal/Dockerfile'
- 'infra/docker/jammy/Dockerfile'
- 'infra/docker/noble/Dockerfile'
ubuntu-cross:
- '.github/**'
- 'infra/docker/focal-cross/Dockerfile'
- 'infra/docker/jammy-cross/Dockerfile'
- 'infra/docker/noble-cross/Dockerfile'

# Build on docker CLI for PR test without login
build-ubuntu:
Expand All @@ -56,6 +62,41 @@ jobs:
./nnas docker-run --user make -f Makefile.template
./nnas docker-run --user Product/out/test/onert-test unittest

build-ubuntu-cross:
needs: filtering
if: github.repository_owner == 'Samsung' && needs.filtering.outputs.ubuntu-cross == 'true'
runs-on: one-x64-linux
strategy:
matrix:
version: [ 'focal', 'jammy', 'noble' ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Docker Image
run: |
docker build --file infra/docker/${{ matrix.version }}-cross/Dockerfile --tag one-test .

- name: Download rootfs for cross build
uses: dawidd6/action-download-artifact@v7
with:
workflow: generate-rootfs.yml
branch: master
name: rootfs_arm_${{ matrix.version }}

# Workaround: symlink for rootfs checker in cmake toolchain file
- name: Install rootfs and cross build
env:
DOCKER_IMAGE_NAME: one-test
DOCKER_ENV_VARS: '-e CROSS_BUILD=1 -e TARGET_ARCH=armv7l'
run: |
mkdir -p tools/cross/rootfs
tar -zxf rootfs_arm_${{ matrix.version }}.tar.gz -C tools/cross/rootfs
pushd tools/cross/rootfs/arm
ln -sf usr/lib lib
popd
./nnas docker-run --user make -f Makefile.template

build-android:
needs: filtering
if: github.repository_owner == 'Samsung' && needs.filtering.outputs.android == 'true'
Expand Down
48 changes: 48 additions & 0 deletions infra/docker/focal-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:focal

# Install tzdata without user input
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -qqy install tzdata

# Build tool
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu

# Debian build tool
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python

# Install extra dependencies
RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev

# Additonal tools
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qqy install wget zip unzip python3 python3-pip python3-venv python3-dev curl
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install numpy flatbuffers

# Setup user to match host user, and give superuser permissions
ARG USER_ID=1000
ARG GROUP_ID=${USER_ID}
RUN apt-get update && apt-get -qqy install sudo
RUN addgroup --gid ${GROUP_ID} ubuntu && adduser --disabled-password --gecos '' --uid ${USER_ID} --gid ${GROUP_ID} ubuntu && usermod -aG sudo ubuntu
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Clean archives (to reduce image size)
RUN apt-get clean -y

# Set user to the one we just created
USER ${USER_ID}
48 changes: 48 additions & 0 deletions infra/docker/jammy-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:jammy

# Install tzdata without user input
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -qqy install tzdata

# Build tool
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu

# Debian build tool
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python

# Install extra dependencies
RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev

# Additonal tools
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qqy install wget zip unzip python3 python3-pip python3-venv python3-dev curl
RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install numpy flatbuffers

# Setup user to match host user, and give superuser permissions
ARG USER_ID=1000
ARG GROUP_ID=${USER_ID}
RUN apt-get update && apt-get -qqy install sudo
RUN addgroup --gid ${GROUP_ID} ubuntu && adduser --disabled-password --gecos '' --uid ${USER_ID} --gid ${GROUP_ID} ubuntu && usermod -aG sudo ubuntu
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Clean archives (to reduce image size)
RUN apt-get clean -y

# Set user to the one we just created
USER ${USER_ID}
47 changes: 47 additions & 0 deletions infra/docker/noble-cross/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright (c) 2025 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:noble

# Install tzdata without user input
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get -qqy install tzdata

# Build tool
RUN apt-get update && apt-get -qqy install build-essential cmake scons git lcov g++-arm-linux-gnueabihf g++-aarch64-linux-gnu

# Debian build tool
RUN apt-get update && apt-get -qqy install fakeroot devscripts debhelper python3-all dh-python

# Install extra dependencies
RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoogle-glog-dev libatlas-base-dev libhdf5-dev

# Additonal tools
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive \
apt-get -qqy install wget zip unzip python3 python3-pip python3-venv python3-dev curl
RUN python3 -m pip install numpy flatbuffers --break-system-packages

# Setup user ubuntu: give superuser permissions without password
RUN apt-get update && apt-get -qqy install sudo
RUN usermod -aG sudo ubuntu
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# Clean archives (to reduce image size)
RUN apt-get clean -y

# Set user to ubuntu(1000)
USER ubuntu
WORKDIR /home/ubuntu
RUN python3 -m venv ~/.local
ENV PATH=~/.local/bin:$PATH