Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/arm_build_test #1173

Merged
merged 76 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
58325c0
add arm support branch
hakuturu583 Oct 30, 2023
cba9aae
change header
hakuturu583 Oct 30, 2023
07b5703
update repos file
hakuturu583 Nov 27, 2023
2418ae0
modify cmake
Nov 27, 2023
f76a640
remove some warnings
Nov 27, 2023
2db956a
rename to new struct name
Nov 27, 2023
9a39685
remove unused line
Nov 27, 2023
66a6693
remove unused function
Nov 27, 2023
bfad757
remove IntersectContext
Nov 27, 2023
da85651
fix compile error
Nov 27, 2023
4c41ad6
add scenario
Nov 27, 2023
5cb4f6f
comment out build options in cmake
hakuturu583 Dec 4, 2023
7dc07b0
add docker bake.hcl
hakuturu583 Dec 4, 2023
d20f528
update bkae settings
hakuturu583 Dec 4, 2023
ed93997
update github actions workflow
hakuturu583 Dec 4, 2023
3ec58ce
fix dockerfile
hakuturu583 Dec 4, 2023
98ce04b
add white line at EoF
hakuturu583 Dec 4, 2023
21a02e5
use docker/bake-action@v3
hakuturu583 Dec 4, 2023
9346d08
modify bake setting
hakuturu583 Dec 4, 2023
b82ca8b
split workflow
hakuturu583 Dec 4, 2023
23373a7
extend timeout
hakuturu583 Dec 5, 2023
79b07ac
Merge remote-tracking branch 'origin' into feature/arm_support
hakuturu583 Dec 5, 2023
2eb9864
Merge branch 'feature/arm_support' of https://github.com/tier4/scenar…
hakuturu583 Dec 5, 2023
f3db7f6
Merge branch 'master' of https://github.com/tier4/scenario_simulator_…
hakuturu583 Jan 17, 2024
097b4cb
update Dockerfile
hakuturu583 Jan 18, 2024
6f512d3
Merge branch 'master' of https://github.com/tier4/scenario_simulator_…
hakuturu583 Jan 31, 2024
adb8c2e
fix docker action
hakuturu583 Jan 31, 2024
f7b1ba3
comment out steps
hakuturu583 Jan 31, 2024
ae9f3d3
uncomment steps
hakuturu583 Jan 31, 2024
0c54463
add test for docker build
hakuturu583 Jan 31, 2024
6728f06
add setup docker action
hakuturu583 Jan 31, 2024
c53d396
install docker to the mac OS
hakuturu583 Jan 31, 2024
9513479
add daemon start command
hakuturu583 Jan 31, 2024
2f446cf
add dockerd command
hakuturu583 Jan 31, 2024
55790ec
remove --cask
hakuturu583 Jan 31, 2024
3ebaf62
add dockerd step
hakuturu583 Jan 31, 2024
a2246cd
fix docker install step
hakuturu583 Jan 31, 2024
581d83d
add colima
hakuturu583 Jan 31, 2024
32f5b87
modify docker action
hakuturu583 Feb 15, 2024
0540316
Merge remote-tracking branch 'upstream/master' into feature/arm_support
hakuturu583 Feb 15, 2024
8506e13
fix yaml
hakuturu583 Feb 15, 2024
0a2f62e
fix docker yaml
hakuturu583 Feb 15, 2024
75028c6
remove brew install step
hakuturu583 Feb 15, 2024
e425ce0
install docker binary
hakuturu583 Feb 15, 2024
dde022e
change decompress option
hakuturu583 Feb 15, 2024
927d8bb
add tmate step
hakuturu583 Feb 15, 2024
cc4bf0a
change directory
hakuturu583 Feb 15, 2024
40a830e
add plugin
hakuturu583 Feb 15, 2024
a08b212
add directory
hakuturu583 Feb 15, 2024
1656982
update docker build command
hakuturu583 Feb 15, 2024
6f9cca5
modify docker tag
hakuturu583 Feb 15, 2024
41c7590
add systemctl start docker
hakuturu583 Feb 15, 2024
d3385ce
add dockerd
hakuturu583 Feb 15, 2024
9365342
use buildx
hakuturu583 Feb 15, 2024
f18daa7
Bake arm64 image with mimic-cross
f0reachARR Feb 22, 2024
83c4009
Install qemu to build container
f0reachARR Feb 22, 2024
ea9ab34
Remove ccache from arm64 build(temp)
f0reachARR Feb 22, 2024
70ae975
Remove macos job in BuildAndRun
f0reachARR Feb 29, 2024
d75d249
Enable apt cache
f0reachARR Feb 29, 2024
f0a2875
Update mimic-cross
f0reachARR Feb 29, 2024
bc8f599
Add apt cache to arm64
f0reachARR Feb 29, 2024
2270e9a
Run apt-get update on cache
f0reachARR Feb 29, 2024
4b06330
Use cache in every apt stage
f0reachARR Feb 29, 2024
8947754
Use different cache id
f0reachARR Feb 29, 2024
e9d03e5
Downgrade mimic-cross
f0reachARR Feb 29, 2024
3540e56
Use matrix to build image
f0reachARR Feb 29, 2024
89102da
Fix workflow step name
f0reachARR Mar 28, 2024
fc7eda4
Merge remote-tracking branch 'origin/master' into feature/arm_support
f0reachARR Mar 28, 2024
962b857
Fix cspell error
f0reachARR Mar 28, 2024
32d6fa5
Merge branch 'master' of https://github.com/tier4/scenario_simulator_…
hakuturu583 Mar 29, 2024
d35f395
Merge branch 'feature/arm_support' of https://github.com/tier4/scenar…
hakuturu583 Mar 29, 2024
ed3dbce
update repos file
hakuturu583 Mar 29, 2024
da40e34
add embree_vendor package to the repository
hakuturu583 Mar 29, 2024
f245e19
remove unused .github directory
hakuturu583 Mar 29, 2024
647c36f
remove unused files
hakuturu583 Mar 29, 2024
c8a9504
update version
hakuturu583 Mar 29, 2024
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
5 changes: 3 additions & 2 deletions .github/workflows/BuildAndRun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ on:
- master
jobs:
job1:
name: Build and run
runs-on: ubuntu-22.04
name: BuildAndRun
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 180
container: ros:${{ matrix.rosdistro }}
env:
Expand All @@ -29,6 +29,7 @@ jobs:
fail-fast: false
matrix:
rosdistro: [humble]
runs_on: [ubuntu-22.04] # macos-14 is added for arm support. See also https://x.com/github/status/1752458943245189120?s=20
steps:
- name: Suppress warnings
run: git config --global --add safe.directory '*'
Expand Down
52 changes: 33 additions & 19 deletions .github/workflows/Docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,39 @@ on:
- cron: 0 0 * * *
pull_request:
paths:
- '**'
- '!docs/**'
- '!README.md'
- '!.github/**'
- '.github/workflows/Docker.yaml'
- '!mkdocs.yml'
- "**"
- "!docs/**"
- "!README.md"
- "!.github/**"
- ".github/workflows/Docker.yaml"
- "!mkdocs.yml"
push:
branches:
- master
release:
types: [published]
jobs:
job1:
name: Build Docker image
runs-on: ubuntu-20.04
timeout-minutes: 180
build_docker_image:
name: Build Docker Image
runs-on: ubuntu-22.04
timeout-minutes: 720
strategy:
matrix:
rosdistro: [humble]
arch: [amd64, arm64]
steps:
- uses: actions/checkout@v3
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false

- name: Install docker for ubuntu runner
uses: docker/setup-buildx-action@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Install QEMU
uses: docker/setup-qemu-action@v3

- uses: actions/checkout@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -38,10 +47,15 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
- name: Build and push (${{ matrix.arch }})
uses: docker/bake-action@v3
with:
tags: ghcr.io/${{ github.repository_owner }}/scenario_simulator_v2:${{ matrix.rosdistro }}
no-cache: true
build-args: ROS_DISTRO=${{ matrix.rosdistro }}
push: ${{ github.event_name != 'pull_request' }}
files: |
./docker-bake.hcl
workdir: .
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
push: ${{ github.event_name != 'pull_request' && matrix.arch == 'amd64' }}
targets: |
${{ matrix.rosdistro }}_base_${{ matrix.arch }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ log
# external packages
external/*
!external/concealer
!external/embree_vendor

# auto-generated files
html
Expand Down
38 changes: 30 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
ARG ROS_DISTRO
FROM ros:${ROS_DISTRO}
ARG ROS_DISTRO="humble"
FROM ros:${ROS_DISTRO} as build-stage
SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS=yes
ARG ROS_DISTRO

RUN sudo apt-get update && sudo apt-get -y install python3-pip python3-rospkg python3-rosdep software-properties-common
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get -y install python3-pip python3-rospkg python3-rosdep software-properties-common ccache
# cspell: ignore kisak
RUN add-apt-repository ppa:kisak/kisak-mesa -y
RUN apt-get update && apt-get install libegl-mesa0 -y
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
add-apt-repository ppa:kisak/kisak-mesa -y
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install libegl-mesa0 -y

RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator
COPY . $WORKDIR
Expand All @@ -18,10 +26,24 @@ RUN mkdir -p /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator/e
WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator
RUN vcs import external < dependency_${ROS_DISTRO}.repos
WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && rosdep install -iy --from-paths . --rosdistro ${ROS_DISTRO}
RUN --mount=type=cache,id=apt-cache-amd64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-amd64,target=/var/lib/apt,sharing=locked \
source /opt/ros/${ROS_DISTRO}/setup.bash \
&& apt-get update \
&& rosdep install -iy --from-paths . --rosdistro ${ROS_DISTRO}

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws
RUN source /opt/ros/${ROS_DISTRO}/setup.bash && colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release

ENV CC="/usr/lib/ccache/gcc"
ENV CXX="/usr/lib/ccache/g++"
ENV CCACHE_DIR="/ccache"
RUN --mount=type=cache,target=/ccache source /opt/ros/${ROS_DISTRO}/setup.bash && \
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_CPP_MOCK_SCENARIOS=ON
COPY ./docker-entrypoint.sh /
RUN chmod a+x /docker-entrypoint.sh

Expand Down
53 changes: 53 additions & 0 deletions Dockerfile.arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
ARG ROS_DISTRO="humble"

# cspell: ignore impactaky deno BUILDPLATFORM TARGETARCH

FROM --platform=${BUILDPLATFORM} impactaky/mc-ubuntu22.04-${TARGETARCH}-host:2.1.0 AS mimic-host
FROM ros:${ROS_DISTRO} as build-stage

SHELL ["/bin/bash", "-c"]
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NOWARNINGS=yes

COPY --from=mimic-host / /mimic-cross
RUN /mimic-cross/mimic-cross.deno/setup.sh

RUN --mount=type=cache,id=apt-cache-arm64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-arm64,target=/var/lib/apt,sharing=locked \
sudo apt-get update && sudo apt-get -y install python3-pip python3-rospkg python3-rosdep software-properties-common ccache
# cspell: ignore kisak
RUN --mount=type=cache,id=apt-cache-arm64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-arm64,target=/var/lib/apt,sharing=locked \
add-apt-repository ppa:kisak/kisak-mesa -y
RUN --mount=type=cache,id=apt-cache-arm64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-arm64,target=/var/lib/apt,sharing=locked \
apt-get update && apt-get install libegl-mesa0 -y

RUN rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator
COPY . $WORKDIR

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/
RUN mkdir -p /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator/external
WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src/scenario_simulator
RUN vcs import external < dependency_${ROS_DISTRO}.repos
WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws/src
RUN --mount=type=cache,id=apt-cache-arm64,target=/var/cache/apt,sharing=locked \
--mount=type=cache,id=apt-lib-arm64,target=/var/lib/apt,sharing=locked \
source /opt/ros/${ROS_DISTRO}/setup.bash \
&& apt-get update \
&& rosdep install -iy --from-paths . --rosdistro ${ROS_DISTRO}

WORKDIR /home/ubuntu/Desktop/scenario_simulator_ws

RUN source /opt/ros/${ROS_DISTRO}/setup.bash && \
colcon build --symlink-install \
--cmake-args \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_CPP_MOCK_SCENARIOS=ON
COPY ./docker-entrypoint.sh /
RUN chmod a+x /docker-entrypoint.sh

ENTRYPOINT ["/docker-entrypoint.sh"]
26 changes: 26 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
group "default" {
targets = ["humble"]
}

target "base_amd64" {
target = "build-stage"
dockerfile = "Dockerfile"
platforms = ["linux/amd64"]
}

target "base_arm64" {
target = "build-stage"
dockerfile = "Dockerfile.arm64"
platforms = ["linux/arm64/v8"]
}

target "humble" {
inherits = [base]
name = "humble_${base}"
tags = ["ghcr.io/tier4/scenario_simulator_v2:humble"]
args = {"ROS_DISTRO" : "humble"}
group = ["humble"]
matrix = {
base = ["base_amd64", "base_arm64"]
}
}
2 changes: 2 additions & 0 deletions external/embree_vendor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
debian
obj-x86_64-linux-gnu
79 changes: 79 additions & 0 deletions external/embree_vendor/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package embree_vendor
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.0.9 (2021-07-13)
------------------

0.1.0 (2021-07-14)
------------------
* Merge branch 'master' of https://github.com/OUXT-Polaris/embree_vendor
* Merge pull request `#4 <https://github.com/OUXT-Polaris/embree_vendor/issues/4>`_ from OUXT-Polaris/feature/onetbb_src
Feature/onetbb src
* change build order
* remove unused action
* add tbb build command
* fix version
* Contributors: Masaya Kataoka

0.8.1 (2021-07-13)
------------------
* add pkg-config to the depends
* Contributors: Masaya Kataoka

0.0.8 (2021-07-12)
------------------
* fix embree version
* Contributors: Masaya Kataoka

0.0.7 (2021-07-12)
------------------
* remove test lines
* Merge pull request `#3 <https://github.com/OUXT-Polaris/embree_vendor/issues/3>`_ from OUXT-Polaris/workflow/galactic
update CI workflow for galactic
* update .github/workflows/ROS2-Galactic.yaml
* Merge pull request `#2 <https://github.com/OUXT-Polaris/embree_vendor/issues/2>`_ from OUXT-Polaris/workflow/foxy
update CI workflow for foxy
* update .github/workflows/ROS2-Foxy.yaml
* update dependency.repos
* add workflow_dispatch trigger
* Contributors: Masaya Kataoka, robotx_buildfarm

0.0.6 (2021-01-10)
------------------
* Merge pull request `#1 <https://github.com/OUXT-Polaris/embree_vendor/issues/1>`_ from OUXT-Polaris/feature/add_tbb_to_depends
update package.xml
* update package.xml
* update workflow
* rename workflow
* fix workflow
* add generate foxy dpkg workflow
* Contributors: Masaya Kataoka

0.0.5 (2021-01-04)
------------------
* update LICENSE
* add ignore
* Contributors: Masaya Kataoka

0.0.4 (2021-01-03)
------------------
* update release workflow
* Contributors: Masaya Kataoka

0.0.2 (2021-01-03)
------------------
* update version
* update version tag
* update version
* add description
* add Release action
* fix xml tag
* add libglfw3-dev to the depends
* update workflow
* add README.md
* Create ROS2-Foxy.yaml
adding ROS2-Foxy workflow
* update instal dir
* enable pass rostest
* Contributors: Masaya Kataoka
53 changes: 53 additions & 0 deletions external/embree_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
cmake_minimum_required(VERSION 3.5)
project(embree_vendor)

# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)

macro(build_embree)

set(cmake_commands)
set(cmake_configure_args
-Wno-dev
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install
-DEMBREE_ISPC_SUPPORT=OFF)

include(ExternalProject)
externalproject_add(embree-ext
GIT_REPOSITORY https://github.com/embree/embree.git
GIT_TAG v4.1.0
TIMEOUT 6000
${cmake_commands}
CMAKE_ARGS
${cmake_configure_args}
)

# The external project will install to the build folder, but we'll install that on make install.
install(
DIRECTORY
${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_install/
DESTINATION
${CMAKE_INSTALL_PREFIX}
)
endmacro()

build_embree()

ament_export_include_directories(include)
ament_export_libraries(embree4)

ament_package()
3 changes: 3 additions & 0 deletions external/embree_vendor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# embree_vendor

vendor package for ray-tracing library made by Intel. (https://github.com/embree/embree)
Loading
Loading