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 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; \