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

シナリオテスト #362

Merged
merged 63 commits into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
1af9791
シナリオテストに向けての準備を少し
HansRobo May 6, 2024
3e4f5b0
ワークフローの設定ミスを修正
HansRobo May 6, 2024
750e101
ワークフロー修正
HansRobo May 6, 2024
03058c6
ワークフロー修正
HansRobo May 6, 2024
845ed98
Merge branch 'develop' into feature/scenario_test
HansRobo May 11, 2024
d16afc8
Merge branch 'develop' into feature/scenario_test
HansRobo May 14, 2024
ff17276
Merge branch 'develop' into feature/scenario_test
HansRobo May 24, 2024
d0301be
Merge branch 'develop' into feature/scenario_test
HansRobo May 29, 2024
aaf83f1
Merge branch 'develop' into feature/scenario_test
HansRobo May 29, 2024
f559e88
Merge branch 'develop' into feature/scenario_test
HansRobo May 31, 2024
1edc418
docker/build-push-actionを最新版にした
HansRobo May 31, 2024
b2c187d
キャッシュの設定
HansRobo May 31, 2024
adca7b4
一時的にPullRequestをトリガーに設定
HansRobo May 31, 2024
499e4b5
docker/setup-buildx-actionを追加
HansRobo May 31, 2024
0f891f5
空コミットw
HansRobo May 31, 2024
aeb9853
シナリオテスト用のworkflow (とりあえずイメージビルドだけ)
HansRobo May 31, 2024
2140601
シナリオテストライブラリのセットアップ
HansRobo May 31, 2024
3d45028
シナリオテストJobの冒頭
HansRobo May 31, 2024
3092e84
シナリオテストライブラリのセットアップ失敗の修正?
HansRobo May 31, 2024
b569e5a
style(pre-commit): autofix
pre-commit-ci[bot] May 31, 2024
dee784e
launchファイルでオリジナルのgrsim使用モードを追加
HansRobo May 31, 2024
733a689
シナリオテスト用docker-composeファイルを追加
HansRobo May 31, 2024
07dc48a
style(pre-commit): autofix
pre-commit-ci[bot] May 31, 2024
276d342
空コミット
HansRobo May 31, 2024
f60ad1a
runnerの調整
HansRobo May 31, 2024
e4e99be
ちぇcこうtwasure
HansRobo May 31, 2024
e5209ed
docker-compose.yaml内の変数名のミスを修正
HansRobo May 31, 2024
6c4b5ad
シナリオテストの後工程を追加
HansRobo May 31, 2024
97daae5
テストシナリオを1つ追加
HansRobo May 31, 2024
5e5d06d
style(pre-commit): autofix
pre-commit-ci[bot] May 31, 2024
0d9f432
rcstを辞書に追加
HansRobo May 31, 2024
1f5033a
新チーム追加
HansRobo May 31, 2024
b68ce3a
起動判定修正
HansRobo May 31, 2024
a5a5c5c
とりあえず20秒固定待機に変更
HansRobo May 31, 2024
1b49527
Merge remote-tracking branch 'origin/develop' into feature/scenario_test
HansRobo May 31, 2024
8c769f2
ポート設定
HansRobo May 31, 2024
af41e6c
ビルドテスト用のイメージを一旦baseに差し替え
HansRobo May 31, 2024
e2f4933
self hosted runnerで動かないものはubuntu-latestに設定
HansRobo May 31, 2024
d52aaa9
パスの修正
HansRobo May 31, 2024
5f788cc
うおおおお
HansRobo May 31, 2024
dbe8586
わざと失敗させてみる
HansRobo May 31, 2024
07387b2
ちゃんとテストする
HansRobo May 31, 2024
d019ba3
launchファイルにGUI切り替えオプションを追加
HansRobo May 31, 2024
8cd40b9
立ち上げコマンドを修正
HansRobo May 31, 2024
6c8629b
launchで喋るかどうかを切り替えられるように
HansRobo May 31, 2024
1a657a8
待ち時間を短縮
HansRobo May 31, 2024
0e385a1
自前のgrSimを作る
HansRobo May 31, 2024
b45e816
動いたら失敗する
HansRobo May 31, 2024
04ab07c
ログは全て出力
HansRobo May 31, 2024
e757d1c
タグをアップデート
HansRobo May 31, 2024
142158c
いつでもログをアップロード
HansRobo May 31, 2024
df66ae9
いつでもログをアップロード
HansRobo May 31, 2024
f22c5fc
タグのtypoを修正
HansRobo May 31, 2024
d2e5e81
TEST変数にスラッシュやセミコロンが入らないように変更
HansRobo May 31, 2024
7574db2
FORCE_STARTするテスト
HansRobo May 31, 2024
2f680b0
STOPするテスト
HansRobo May 31, 2024
d3a9d60
style(pre-commit): autofix
pre-commit-ci[bot] May 31, 2024
e1c4989
わざと失敗してみる
HansRobo May 31, 2024
f92098f
Merge remote-tracking branch 'origin/feature/scenario_test' into feat…
HansRobo May 31, 2024
22ae675
pre-commitエラー解消
HansRobo May 31, 2024
4dc76d9
テストを分割
HansRobo May 31, 2024
ce303ea
正常化
HansRobo May 31, 2024
6219f92
トリガーを元に戻す
HansRobo May 31, 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
17 changes: 16 additions & 1 deletion .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
|| fromJSON('[ "ubuntu-latest" ]')
}}
timeout-minutes: 30
container: ghcr.io/ibis-ssl/crane:prebuilt
container: ghcr.io/ibis-ssl/crane:base
env:
DEBIAN_FRONTEND: noninteractive
strategy:
Expand Down Expand Up @@ -43,6 +43,21 @@ jobs:
cd ~/ibis_ws
vcs import src < src/crane/dependency_${{ matrix.rosdistro }}.repos

- name: Install other dependencies
run: |
sudo apt-get update
sudo apt-get install -y curl docker-compose

- name: Download logger for scenario test
run: |
curl -L https://github.com/RoboCup-SSL/ssl-go-tools/releases/download/v1.5.2/ssl-log-recorder_v1.5.2_linux_amd64 -o ssl-log-recorder
chmod +x ssl-log-recorder

- name: docker compose pull
run: |
docker-compose pull -f docker/docker-compose.yaml
shell: bash

- name: Resolve rosdep
run: |
cd ~/ibis_ws
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/custom_dict.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
"ZJUNlict",
"luhbots",
"nAMeC",
"TRAPS",
"Shinobi",
"reRo",
"roboticserlangen",
"tigersmannheim",
"simulatorcli",
Expand All @@ -105,6 +108,7 @@
"MPPI",
"Kwargs",
"voicevox",
"FREEKICK"
"FREEKICK",
"rcst"
]
}
22 changes: 18 additions & 4 deletions .github/workflows/docker_build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on:
branches:
- develop
workflow_dispatch:

jobs:
build_base:
name: build base image
Expand All @@ -16,6 +15,9 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -25,12 +27,14 @@ jobs:

- name: Build image
if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: docker/base/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:base
cache-from: type=gha
cache-to: type=gha,mode=max

build_ccache:
name: build ccache image
Expand All @@ -41,6 +45,9 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -50,12 +57,14 @@ jobs:

- name: Build image
if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: docker/ccache/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:ccache
cache-from: type=gha
cache-to: type=gha,mode=max

build_prebuilt:
name: build prebuilt image
Expand All @@ -66,6 +75,9 @@ jobs:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
Expand All @@ -75,9 +87,11 @@ jobs:

- name: Build image
if: steps.check_image.outputs.GITHUB_OUTPUT == ${{ steps.extract_dependencies.outputs.rosdep_checksum }}
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
file: docker/prebuilt/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:prebuilt
cache-from: type=gha
cache-to: type=gha,mode=max
162 changes: 162 additions & 0 deletions .github/workflows/scenario_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: scenario test

on:
workflow_dispatch:
pull_request:
merge_group:

env:
PYTHON_VERSION: '3.10'

jobs:
create_scenario_test_image:
name: build image for scenario test
runs-on: ubuntu-latest
env:
DEBIAN_FRONTEND: noninteractive
strategy:
fail-fast: false
matrix:
rosdistro: [humble]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image
uses: docker/build-push-action@v5
with:
context: .
file: docker/scenario/Dockerfile
push: true
tags: ghcr.io/${{ github.repository }}:scenario-${{ github.sha }}
cache-from: type=gha

setup_scenario_test_library:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Setup virtual environment
run: |
python -m venv env
source env/bin/activate

- name: Cache virtual environment
uses: actions/cache@v4
with:
path: env
key: ${{ runner.os }}-env-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-env-

- name: Install robocup_scenario_test library
run: |
source env/bin/activate
python -m pip install --upgrade pip
sudo apt update
sudo apt install -y protobuf-compiler
pip install -v git+https://github.com/SSL-Roots/robocup_scenario_test
pip install pytest

scenario_test:
needs: [create_scenario_test_image, setup_scenario_test_library]
strategy:
fail-fast: false
matrix:
env:
- TEST: STOP_AVOID_BALL
- TEST: STOP_ROBOT_SPEED

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Cache virtual environment
uses: actions/cache@v4
with:
path: env
key: ${{ runner.os }}-env-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-env-

- name: Setup virtual environment
run: |
python -m venv env
source env/bin/activate
python -m pip list

- name: Start Docker Compose services
run: |
docker compose -f docker/scenario/docker-compose.yaml up -d
env:
CRANE_TAG: scenario-${{ github.sha }}

- name: Wait for crane to start
timeout-minutes: 5
run: |
sleep 5

- name: Download logger
run: |
curl -L https://github.com/RoboCup-SSL/ssl-go-tools/releases/download/v1.5.2/ssl-log-recorder_v1.5.2_linux_amd64 -o ssl-log-recorder
chmod +x ssl-log-recorder

- name: Run pytest
run: |
source env/bin/activate
pytest scenario_test/${{ matrix.env.TEST }}.py --vision_port=10020 --logging --log_recorder=./ssl-log-recorder
echo "LOG_EXISTS=$(ls *.log.gz 2> /dev/null)" >> $GITHUB_ENV

- name: Get and print logs
if: always()
run: docker compose -f docker/scenario/docker-compose.yaml logs

- name: Clean up Docker Compose services
if: always()
run: docker compose -f docker/scenario/docker-compose.yaml down

- name: Upload artifacts
id: upload-artifact
if: always()
# if: env.LOG_EXISTS != ''
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.env.TEST}}-failure-logs
path: '*.log.gz'

- name: Comment PR with Artifact URL
if: always()
# if: env.LOG_EXISTS != ''
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Failure logs: ${{ steps.upload-artifact.outputs.artifact-url }}
43 changes: 27 additions & 16 deletions crane_bringup/launch/crane.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
<!-- <arg name="referee_port" default="10003" description="Set multicast port to connect Game Controller."/>-->
<arg name="team" default="ibis" description="team name"/>
<arg name="sim" default="true" description="Set true if you want to use simulator."/>
<arg name="original_grsim" default="false" description="Set true if you want to default grsim."/>
<arg name="simple_ai" default="false" description="a"/>
<arg name="max_vel" default="5.0" description="Set max velocity of robot."/>
<arg name="gui" default="true" description="Set true if you want to use GUI."/>
<arg name="speak" default="true" description="Set true if you want to use speaker."/>
<set_parameter name="use_sim_time" value="$(var sim)"/>

<!-- Nodes -->
Expand All @@ -32,13 +35,6 @@
<param name="d_gain" value="1.0"/>
<param name="max_vel" value="$(var max_vel)"/>
</node>
<node pkg="crane_sender" exec="ibis_sender_node" output="screen">
<param name="no_movement" value="false"/>
<param name="theta_kp" value="3.5"/>
<param name="theta_ki" value="0.0"/>
<param name="theta_kd" value="0.5"/>
<param name="sim_mode" value="true"/>
</node>

<node pkg="crane_clock_publisher" exec="crane_clock_publisher_node" output="screen">
<param name="time_scale" value="1.00"/>
Expand All @@ -54,14 +50,25 @@
<param name="d_gain" value="0.8"/>
<param name="max_vel" value="$(var max_vel)"/>
</node>
</group>

<group if="$(var original_grsim)">
<node pkg="crane_sender" exec="sim_sender_node" output="screen">
<param name="no_movement" value="false"/>
<param name="theta_kp" value="3.5"/>
<param name="theta_ki" value="0.0"/>
<param name="theta_kd" value="0.5"/>
<param name="sim_mode" value="true"/>
</node>
</group>

<group unless="$(var original_grsim)">
<node pkg="crane_sender" exec="ibis_sender_node" output="screen">
<param name="no_movement" value="true"/>
<param name="theta_kp" value="5.5"/>
<param name="no_movement" value="false"/>
<param name="theta_kp" value="3.5"/>
<param name="theta_ki" value="0.0"/>
<param name="theta_kd" value="0.1"/>
<param name="delay_s" value="0.0"/>
<param name="debug_id" value="1"/>
<param name="sim_mode" value="false"/>
<param name="theta_kd" value="0.5"/>
<param name="sim_mode" value="$(var sim)"/>
</node>
</group>

Expand Down Expand Up @@ -95,14 +102,18 @@
<param name="team_name" value="$(var team)"/>
</node>

<node pkg="crane_speaker" exec="crane_speaker_node"/>
<group if="$(var speak)">
<node pkg="crane_speaker" exec="crane_speaker_node"/>
</group>

<node pkg="speak_ros" exec="speak_ros_node">
<param name="plugin_name" value="voicevox_plugin::VoiceVoxPlugin"/>
<param name="voicevox_plugin/speaker" value="14"/>
<param name="voicevox_plugin/speedScale" value="1.0"/>
<param name="voicevox_plugin/volumeScale" value="2.0"/>
<param name="voicevox_plugin/volumeScale" value="1.0"/>
</node>

<node pkg="consai_visualizer" exec="consai_visualizer"/>
<group if="$(var gui)">
<node pkg="consai_visualizer" exec="consai_visualizer"/>
</group>
</launch>
17 changes: 17 additions & 0 deletions docker/scenario/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ghcr.io/ibis-ssl/crane:prebuilt

ENV ROS_OVERLAY /root/ibis_ws
WORKDIR $ROS_OVERLAY/src
SHELL ["/bin/bash", "-c"]

COPY . crane

RUN vcs import . < crane/dependency_${ROS_DISTRO}.repos

RUN rosdep update && \
rosdep install -iy --from-paths . && \
rm -rf /var/lib/apt/lists/

RUN cd .. && \
source /opt/ros/humble/setup.bash && \
colcon build --symlink-install --cmake-args '-DCMAKE_BUILD_TYPE=Release'
Loading
Loading