-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker build action Signed-off-by: Masaya Kataoka <[email protected]> * rename docker Signed-off-by: Masaya Kataoka <[email protected]> * enable logging all topics Signed-off-by: Masaya Kataoka <[email protected]> * add rosbag directory Signed-off-by: Masaya Kataoka <[email protected]> * update entrypoint Signed-off-by: Masaya Kataoka <[email protected]> --------- Signed-off-by: Masaya Kataoka <[email protected]>
- Loading branch information
1 parent
6174abd
commit 8476d44
Showing
11 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
packages.repos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ARG ROS_DISTRO=humble | ||
FROM ros:${ROS_DISTRO}-ros-core | ||
SHELL ["/bin/bash", "-c"] | ||
|
||
RUN apt update && \ | ||
apt install -y ros-$ROS_DISTRO-rosbag2-storage-mcap ros-$ROS_DISTRO-rosbag2 python3-vcstool python3-rosdep git python3-colcon-common-extensions && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN mkdir -p messages_ws/src | ||
|
||
WORKDIR messages_ws | ||
COPY packages.repos packages.repos | ||
RUN vcs import src < packages.repos | ||
|
||
RUN rosdep init && \ | ||
rosdep update && \ | ||
apt update && \ | ||
source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
rosdep install -iry --from-paths $(colcon list -p | xargs -I{} bash -c 'if [ "`cat {}/package.xml | grep "rosidl_interface_packages"`" ]; then echo {}; fi') && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ | ||
colcon build --packages-select $(colcon list -n | xargs -I{} bash -c 'if [ "`cat {}/package.xml | grep "rosidl_interface_packages"`" ]; then echo {}; fi' | xargs) | ||
|
||
ENV ROS_LOCALHOST_ONLY 0 | ||
|
||
RUN mkdir /rosbag | ||
|
||
ADD entrypoint.sh / | ||
RUN chmod +x /entrypoint.sh | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: "Build auto logger image action" | ||
description: "Build Virtual RobotX docker images" | ||
|
||
inputs: | ||
docker_username: | ||
description: "Username for Dockerhub" | ||
required: true | ||
docker_password: | ||
description: "Password for Dockerhub" | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: basic install | ||
run: | | ||
sudo apt install make ansible | ||
- uses: actions/checkout@v2-beta | ||
- name: run ansible | ||
run: | | ||
ansible-playbook -i ansible/hosts/localhost.ini ansible/export_repos_full.yml --connection local --become -e ansible_user=ubuntu | ||
- name: copy repos file | ||
run: | | ||
cp ansible/mv ansible/packages.repos .github/workflows/docker/auto_logger/ | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
- name: Build and Push Docker Image | ||
if: ${{ github.event_name != 'pull_request'}} | ||
uses: docker/build-push-action@v2 | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
with: | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
context: ./.github/workflows/docker/auto_logger | ||
file: ./.github/workflows/docker/auto_logger/Dockerfile | ||
tags: wamvtan/auto_logger:latest | ||
no-cache: false | ||
cache-from: type=registry,ref=wamvtan/auto_logger:buildcache | ||
cache-to: type=registry,ref=wamvtan/auto_logger:buildcache,mode=max | ||
push: true | ||
- name: Build Docker Image | ||
if: ${{ github.event_name == 'pull_request'}} | ||
uses: docker/build-push-action@v2 | ||
env: | ||
DOCKER_BUILDKIT: 1 | ||
with: | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
context: ./.github/workflows/docker/auto_logger | ||
file: ./.github/workflows/docker/auto_logger/Dockerfile | ||
tags: wamvtan/auto_logger:latest | ||
no-cache: false | ||
cache-from: type=registry,ref=wamvtan/auto_logger:buildcache | ||
push: false | ||
- uses: peter-evans/dockerhub-description@v3 | ||
if: ${{ github.event_name == 'pull_request'}} | ||
with: | ||
username: ${{ inputs.docker_username }} | ||
password: ${{ inputs.docker_password }} | ||
repository: wamvtan/auto_logger | ||
short-description: "Docker Image for Virtual RobotX Challenge" | ||
readme-filepath: ./.github/workflows/docker/auto_logger/README.md | ||
enable-url-completion: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# setup ros environment. | ||
source "/opt/ros/$ROS_DISTRO/setup.bash" | ||
|
||
# exec "$@" | ||
|
||
# record all topics | ||
ros2 bag record -a -d 10 -s mcap -o /rosbag/$(date '+%Y-%m-%d-%H-%M-%S') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters