From 8ed7221b790f2d776d6655cb8e3adce42f9cc602 Mon Sep 17 00:00:00 2001 From: HiroIshida Date: Wed, 10 Jan 2024 01:59:22 +0900 Subject: [PATCH 1/2] Remove unnecessary -it flag --- run_container.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_container.py b/run_container.py index 52bf9c9..d014ad5 100755 --- a/run_container.py +++ b/run_container.py @@ -56,7 +56,7 @@ def add_prefix(file_path: Path, prefix: str) -> Path: docker_run_command = """ docker run \ -v {tmp_launch_path}:{detic_ros_root}/launch \ - --rm --net=host -it \ + --rm --net=host \ --gpus 1 detic_ros:latest \ /bin/bash -i -c \ "source ~/.bashrc; \ From 491633f5e768046697b0b7e7dc4345a1fd122c6b Mon Sep 17 00:00:00 2001 From: HiroIshida Date: Wed, 10 Jan 2024 02:02:03 +0900 Subject: [PATCH 2/2] Test if python launching script actually works --- .github/workflows/check_container_running.sh | 11 +++++++++++ .github/workflows/docker_build.yml | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 .github/workflows/check_container_running.sh diff --git a/.github/workflows/check_container_running.sh b/.github/workflows/check_container_running.sh new file mode 100644 index 0000000..181f9cd --- /dev/null +++ b/.github/workflows/check_container_running.sh @@ -0,0 +1,11 @@ +python3 run_container.py -host pr1040 -mount ./launch -name sample.launch device:=auto input_image:=/kinect_head/rgb/image_color & +PYTHON_PID=$! +sleep 15 +if ps -p $PYTHON_PID > /dev/null; then + echo "Container is running" + kill -9 $PYTHON_PID + exit 0 +else + echo "Container is not running (unexpected)" + exit 1 +fi diff --git a/.github/workflows/docker_build.yml b/.github/workflows/docker_build.yml index 16094b1..cd56867 100644 --- a/.github/workflows/docker_build.yml +++ b/.github/workflows/docker_build.yml @@ -32,3 +32,6 @@ jobs: - name: rostest run: | docker run --rm detic_ros:latest /bin/bash -i -c "source ~/.bashrc; rostest detic_ros test_node.test" + - name: test main python scirpt + run: | + bash .github/workflows/check_container_running.sh