Skip to content

Commit

Permalink
[infra/github] Intrdocue docker build workflow (Samsung#14536)
Browse files Browse the repository at this point in the history
This commit introduces a GitHub Actions workflow to build docker image and test, and push it to the docker hub.
Fix docker build fail

ONE-DCO-1.0-Signed-off-by: Hyeongseok Oh <[email protected]>
  • Loading branch information
hseok-oh authored Jan 10, 2025
1 parent 17453b5 commit b5bb382
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .github/workflows/build-dev-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build docker image for CI/CD infra
on:
push:
branches:
- master
- release/*
paths:
- '.github/workflows/build-dev-docker.yml'
- 'infra/docker/**'
pull_request:
branches:
- master
- release/*
paths:
- '.github/workflows/build-dev-docker.yml'
- 'infra/docker/**'

jobs:
# Build on docker CLI for PR test without login
build-pr-test:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'android-sdk', 'focal', 'jammy', 'noble' ]
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build Docker Image
run: |
./nnas build-docker-image --codename ${{ matrix.version }} --tag one-test
- name: Test onert build
if: matrix.version != 'android-sdk'
env:
DOCKER_IMAGE_NAME: one-test
run: |
./nnas docker-run --user make -f Makefile.template
./nnas docker-run --user Product/out/test/onert-test unittest
# Use github action for build and push to docker hub
build-docker-image:
if: github.event_name == 'push' && github.repository_owner == 'Samsung'
runs-on: ubuntu-latest
strategy:
matrix:
version: [ 'android-sdk', 'focal', 'jammy', 'noble' ]
steps:
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Install Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Docker Image
uses: docker/build-push-action@v6
with:
file: ./infra/docker/${{ matrix.version }}/Dockerfile
push: true
tags: nnfw/one-devtools:${{ matrix.version }}
3 changes: 3 additions & 0 deletions infra/docker/focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ FROM ubuntu:20.04
# Install 'add-apt-repository'
RUN apt-get update && apt-get -qqy install software-properties-common

# 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

Expand Down
3 changes: 3 additions & 0 deletions infra/docker/jammy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ FROM ubuntu:jammy
# Install 'add-apt-repository'
RUN apt-get update && apt-get -qqy install software-properties-common

# 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

Expand Down
2 changes: 1 addition & 1 deletion infra/docker/noble/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN apt-get update && apt-get -qqy install libboost-all-dev libgflags-dev libgoo
# Additonal tools
RUN apt-get update && \
apt-get -qqy install doxygen graphviz wget zip unzip python3 python3-pip python3-venv python3-dev hdf5-tools curl
RUN python3 -m pip install yapf==0.40.2 pylint --break-system-packages
RUN python3 -m pip install yapf==0.40.2 pylint numpy flatbuffers --break-system-packages

# Install clang-format
RUN apt-get update && apt-get -qqy install clang-format-16
Expand Down

0 comments on commit b5bb382

Please sign in to comment.