From 6a0b44ad2b67a14f851792139cb7f2fcc0ac81b3 Mon Sep 17 00:00:00 2001 From: Tomo Norman Date: Mon, 17 Oct 2022 20:52:50 +0900 Subject: [PATCH 1/4] Dockerfile to run test-suite (for infra) --- .gitignore | 3 +++ Dockerfile-testsuite | 21 +++++++++++++++++++ README.md | 14 +++++++++++++ .../test/artefacts.yaml => artefacts.yaml | 6 +++--- 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Dockerfile-testsuite rename ros_workspace/src/turtle_odometry/test/artefacts.yaml => artefacts.yaml (84%) diff --git a/.gitignore b/.gitignore index b6e4761..da8065b 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,6 @@ dmypy.json # Pyre type checker .pyre/ + +# Warp Client (Using it for Dev purposes only) +warp-client diff --git a/Dockerfile-testsuite b/Dockerfile-testsuite new file mode 100644 index 0000000..156ec31 --- /dev/null +++ b/Dockerfile-testsuite @@ -0,0 +1,21 @@ +FROM ros:noetic-ros-core + +SHELL ["/bin/bash", "-c"] + +RUN apt-get update && apt-get upgrade -y +RUN apt install -y --no-install-recommends python3-pip +RUN pip install --upgrade setuptools +RUN pip install artefacts-client --extra-index-url https://d5cw4z7oemmfd.cloudfront.net/pep503/ -U +RUN apt install curl lsb-release git wget gnupg cmake build-essential python3-catkin-tools python3-osrf-pycommon python3-rospy ros-noetic-turtlesim ros-noetic-rosbag -y +RUN pip3 install --upgrade numpy ruamel.yaml matplotlib bqplot pyyaml plotly +RUN pip3 install pandas + +COPY . /ws/src + +WORKDIR /ws + +RUN source /opt/ros/noetic/setup.bash && catkin config --init && catkin build + +WORKDIR /ws/src + +CMD source /ws/devel/setup.bash --extend && QT_QPA_PLATFORM=offscreen artefacts run $ARTEFACTS_JOB_NAME diff --git a/README.md b/README.md index 5ad0f47..65111d3 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,20 @@ You will see the turtlesim window appear and the turtle perform a square traject You can play around and change the parameters of the artefacts.yaml file: for example change the starting position of the turtle or the segment_length of its trajectory (keep in mind that the size of the turtlesim environment is just 11 by 11 meters, with x,y = 0,0 at the bottom left). +## Running Just the Test Suite with Artefacts + +This repo contains a second Dockerfile `Dockerfile-testsuite` which can be used standalone to run the tests located in ros_workspace/src/turtle_odometry without having to enter the container created with `docker-compose`. + +The Dockerfile is a copy of what (TODO:) is automatically generated by Artefacts if a user dockerfile is not provided. + +To run locally: + +1. Clone this repo +2. `cd` into it and run `docker build -f Dockerfile-testsuite -t .` +3. Create an Apikey for your project if you do not already have one (see above) +4. Run `docker run --env ARTEFACTS_JOB_NAME=basic_turtle --env ARTEFACTS_KEY= ` + +You will see the test run, and results displayed on app.artefacts.com. ## Under the Hood Explanations of what happens under the hood to adapt it to your own use cases (with turtlesim or another simulator!) diff --git a/ros_workspace/src/turtle_odometry/test/artefacts.yaml b/artefacts.yaml similarity index 84% rename from ros_workspace/src/turtle_odometry/test/artefacts.yaml rename to artefacts.yaml index 17df6d1..0452f19 100644 --- a/ros_workspace/src/turtle_odometry/test/artefacts.yaml +++ b/artefacts.yaml @@ -1,6 +1,6 @@ version: 0.1.0 -project: demo-ros1-turtlesim +project: ros1turtle #change to match dashboard jobs: basic_turtle: # Overall job name type: test @@ -29,5 +29,5 @@ jobs: test/segment_length: 5 # for square trajectory test/odom_tuning_theta: 0.01 # demo: tune odometry algorithm test/odom_tuning_forward: 0.1 # demo: tune odometry algorithm - # test/odom_tuning_theta: [0, 0.01, 0.1] # demo: tune odometry algorithm - # test/odom_tuning_forward: [0, 0.1, 0.5] # demo: tune odometry algorithm + #test/odom_tuning_theta: [0, 0.01, 0.1] # demo: tune odometry algorithm + #test/odom_tuning_forward: [0, 0.1, 0.5] # demo: tune odometry algorithm From 115768a4f3199f613b16b7dc87a0d4bd1d714cca Mon Sep 17 00:00:00 2001 From: Tomo Norman Date: Wed, 19 Oct 2022 09:17:42 +0900 Subject: [PATCH 2/4] use ecr public library to avoid dockerhub limit issues: --- Dockerfile-testsuite | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile-testsuite b/Dockerfile-testsuite index 156ec31..d16ad39 100644 --- a/Dockerfile-testsuite +++ b/Dockerfile-testsuite @@ -1,17 +1,18 @@ -FROM ros:noetic-ros-core +FROM public.ecr.aws/docker/library/ros:noetic-ros-core SHELL ["/bin/bash", "-c"] RUN apt-get update && apt-get upgrade -y -RUN apt install -y --no-install-recommends python3-pip +RUN apt install -y --no-install-recommends python3-pip RUN pip install --upgrade setuptools RUN pip install artefacts-client --extra-index-url https://d5cw4z7oemmfd.cloudfront.net/pep503/ -U + +COPY . /ws/src + RUN apt install curl lsb-release git wget gnupg cmake build-essential python3-catkin-tools python3-osrf-pycommon python3-rospy ros-noetic-turtlesim ros-noetic-rosbag -y RUN pip3 install --upgrade numpy ruamel.yaml matplotlib bqplot pyyaml plotly RUN pip3 install pandas -COPY . /ws/src - WORKDIR /ws RUN source /opt/ros/noetic/setup.bash && catkin config --init && catkin build From 05090544a82e4d901252ae6d6c377467cf26e263 Mon Sep 17 00:00:00 2001 From: Tomo Norman Date: Wed, 2 Nov 2022 21:24:44 +0900 Subject: [PATCH 3/4] Update Readme for runtime configurations --- Dockerfile-testsuite | 22 ---------------------- README.md | 16 ++++++---------- artefacts.yaml | 2 +- 3 files changed, 7 insertions(+), 33 deletions(-) delete mode 100644 Dockerfile-testsuite diff --git a/Dockerfile-testsuite b/Dockerfile-testsuite deleted file mode 100644 index d16ad39..0000000 --- a/Dockerfile-testsuite +++ /dev/null @@ -1,22 +0,0 @@ -FROM public.ecr.aws/docker/library/ros:noetic-ros-core - -SHELL ["/bin/bash", "-c"] - -RUN apt-get update && apt-get upgrade -y -RUN apt install -y --no-install-recommends python3-pip -RUN pip install --upgrade setuptools -RUN pip install artefacts-client --extra-index-url https://d5cw4z7oemmfd.cloudfront.net/pep503/ -U - -COPY . /ws/src - -RUN apt install curl lsb-release git wget gnupg cmake build-essential python3-catkin-tools python3-osrf-pycommon python3-rospy ros-noetic-turtlesim ros-noetic-rosbag -y -RUN pip3 install --upgrade numpy ruamel.yaml matplotlib bqplot pyyaml plotly -RUN pip3 install pandas - -WORKDIR /ws - -RUN source /opt/ros/noetic/setup.bash && catkin config --init && catkin build - -WORKDIR /ws/src - -CMD source /ws/devel/setup.bash --extend && QT_QPA_PLATFORM=offscreen artefacts run $ARTEFACTS_JOB_NAME diff --git a/README.md b/README.md index 876040d..d2371fd 100644 --- a/README.md +++ b/README.md @@ -64,18 +64,14 @@ You can play around and change the parameters of the artefacts.yaml file: for ex ## Running Just the Test Suite with Artefacts -This repo contains a second Dockerfile `Dockerfile-testsuite` which can be used standalone to run the tests located in ros_workspace/src/turtle_odometry without having to enter the container created with `docker-compose`. +The test suite can also be run completly in the cloud using the Artefacts Infrastructure. To do so, fork this repository and install the Artefacts GitHub app on your account. When you push to your fork, the platform is triggered automatically. -The Dockerfile is a copy of what (TODO:) is automatically generated by Artefacts if a user dockerfile is not provided. +Step by Step: -To run locally: - -1. Clone this repo -2. `cd` into it and run `docker build -f Dockerfile-testsuite -t .` -3. Create an Apikey for your project if you do not already have one (see above) -4. Run `docker run --env ARTEFACTS_JOB_NAME=basic_turtle --env ARTEFACTS_KEY= ` - -You will see the test run, and results displayed on app.artefacts.com. +1. Create an account on app.artefacts.com if you have not already done so, then create a new project. The Framework should be ROS1, and make sure to check the "I want to link a GitHub repo" box before hitting "Create project" +2. The next page will ask you to select the GitHub owner of the repo (yourself or your organization) and then provide instructions to install the Artefacts + GitHub Application. You will have the choice to allow the application to see all of your repositories, or only the ones you wish for it to see. After making your choice, you will then be able to add the repository in the "GitHub Repository to link". +3. Once setup, make sure that `project` in the artefacts.yaml file matches the project name you made on app.artefacts.com. Make a change (changing the project name can be that change!), `add`, `commit` and push your change(s) to GitHub. +4. Artefacts will see the change, build the project, and run the tests. You will see the dashboard give you status updates, and once complete, the test results will be displayed. ## Under the Hood Explanations of what happens under the hood to adapt it to your own use cases (with turtlesim or another simulator!) diff --git a/artefacts.yaml b/artefacts.yaml index 0452f19..68014a7 100644 --- a/artefacts.yaml +++ b/artefacts.yaml @@ -1,6 +1,6 @@ version: 0.1.0 -project: ros1turtle #change to match dashboard +project: ros1-turtlesim # change to match your project name in the dashboard jobs: basic_turtle: # Overall job name type: test From 19ca7c680bb8226325e48d5abbfe6d58c487a66d Mon Sep 17 00:00:00 2001 From: Tomo Norman Date: Wed, 2 Nov 2022 21:28:17 +0900 Subject: [PATCH 4/4] fix artefacts.yaml --- artefacts.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/artefacts.yaml b/artefacts.yaml index 68014a7..431eab3 100644 --- a/artefacts.yaml +++ b/artefacts.yaml @@ -1,6 +1,6 @@ version: 0.1.0 -project: ros1-turtlesim # change to match your project name in the dashboard +project: demo-ros1-turtlesim # change to match your project name in the dashboard jobs: basic_turtle: # Overall job name type: test @@ -29,5 +29,5 @@ jobs: test/segment_length: 5 # for square trajectory test/odom_tuning_theta: 0.01 # demo: tune odometry algorithm test/odom_tuning_forward: 0.1 # demo: tune odometry algorithm - #test/odom_tuning_theta: [0, 0.01, 0.1] # demo: tune odometry algorithm - #test/odom_tuning_forward: [0, 0.1, 0.5] # demo: tune odometry algorithm + # test/odom_tuning_theta: [0, 0.01, 0.1] # demo: tune odometry algorithm + # test/odom_tuning_forward: [0, 0.1, 0.5] # demo: tune odometry algorithm