Packaging with Docker
For the majority of common use cases, artefacts will run seamlessly on the artefacts cloud simulation. See cloud-simulation for more details.
For more custom cases, artefacts also supports user-provided Dockerfiles. This guide will explain the necessary steps for creating them.
Specifying a Dockerfile or docker image
When running on artefacts cloud simulation, you will need to specify a Dockerfile or image to run in these situations:
- You are not using ROS
- You are using an unsupported simulator
- Your project has some specific custom requirements
my-job:
type: test
package:
docker:
build: # Sample with a custom Dockerfile. Another option is to specify an image.
dockerfile: ./Dockerfile
Artefacts Base Images
We have prepared a number of images which you are freely welcome to use as a base layer of your ROS1 and ROS2 projects. These base images contain:
- The tag's corresponding ROS version (e.g.
noetic-gazebo11
contains theros-noetic-ros-core
package) - The tag's corresponding simulator
- Commonly used ROS dependencies for that ROS/simulator combination (such as
ros-galactic-ros-ign-bridge
in our ROS2 Galactic / Fortress base image) - Necessary build tools (
catkin
/colcon
) - Initializes and updates
rosdep
- The artefacts CLI
The following ROS / simulator combinations are currently available:
- ROS1 Noetic and Gazebo 11 (Classic)
- ROS2 Galactic and Gazebo (Ignition) Fortress
and are publicly available on Amazon ECR:
public.ecr.aws/artefacts/ros1:noetic-gazebo11
(amd64
andarm64
)public.ecr.aws/artefacts/ros1:noetic-gazebo11-gpu
(amd64
only)public.ecr.aws/artefacts/ros1:noetic-turtlesim
(amd64
andarm64
)public.ecr.aws/artefacts/ros2:galactic-fortress
(amd64
andarm64
)public.ecr.aws/artefacts/ros2:galactic-fortress-gpu
(amd64
only)public.ecr.aws/artefacts/ros2:galactic-turtlesim
(amd64
andarm64
)public.ecr.aws/artefacts/ros2-humble-fortress
(amd64
andarm64
)public.ecr.aws/artefacts/ros2:humble-fortress-gpu
(amd64
only)public.ecr.aws/artefacts/ros2:humble-turtlesim
(amd64
andarm64
)
By using these base images, your project Dockerfile will then need to perform (as a minimum) the following steps:
- Copy over your project files
- Install your ROS dependencies
- Build your project
- Run the artefacts client
As an example, a ROS2 Galactic / Ignition Fortress project's Dockerfile could look like the following to work with artefacts:
# Use the artefacts ROS2 galactic base image
FROM public.ecr.aws/artefacts/ros2:galactic-fortress
# Set the working directory and copy our project
WORKDIR /ws
COPY . /ws/src
# ROS dependencies
RUN rosdep install --from-paths src --ignore-src -r -y
# Source ROS version and build
RUN . /opt/ros/galactic/setup.sh && colcon build --symlink-install
WORKDIR /ws/src
# Source colcon workspace and run the artefacts client
CMD . /ws/install/setup.sh && artefacts run $ARTEFACTS_JOB_NAME
Note: The gpu
enabled images are specifically designed to run on the artefacts infrastructure, and with NVIDIA gpus. As a result they do not require any additional environment variables to be set when running on artefacts cloud simulation.
If you are running locally, you may need to install the NVIDIA Container Toolkit, and set some environment variables ('ENV'). See NVIDIA's installation guide and user guide for more details.
Dockerfile requirements
The docker file must currently comply to 2 requirements:
- it must install the CLI (already installed in artefacts provided base images)
RUN pip install --upgrade setuptools
RUN pip install artefacts-client --extra-index-url https://d5cw4z7oemmfd.cloudfront.net/pep503/ -U
- the container launch command must run the CLI:
CMD artefacts run $ARTEFACTS_JOB_NAME