From faa21f4234c31be18359ef93e6142cef2ffb6968 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Sch=C3=BCtte?= Date: Tue, 27 Feb 2018 15:00:59 +0100 Subject: [PATCH] Make ros_pkg configurable for Jenkins workers (#740) * Make ros_pkg configurable for Jenkins workers --- jenkins/Dockerfile.kinetic | 4 ++-- jenkins/worker.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/jenkins/Dockerfile.kinetic b/jenkins/Dockerfile.kinetic index 48efb2d..d2cc9ba 100644 --- a/jenkins/Dockerfile.kinetic +++ b/jenkins/Dockerfile.kinetic @@ -84,9 +84,9 @@ ENV HOME /home/jenkins RUN addgroup --system --gid 10000 jenkins RUN adduser --system --ingroup jenkins --home $HOME --uid 10000 jenkins -LABEL Description="This is a base image, which provides the Jenkins agent executable (slave.jar)" Vendor="Jenkins project" Version="3.10" +LABEL Description="This is a base image, which provides the Jenkins agent executable (slave.jar)" Vendor="Jenkins project" Version="3.17" -ARG VERSION=3.10 +ARG VERSION=3.17 ARG AGENT_WORKDIR=/home/jenkins/agent RUN curl --create-dirs -sSLo /usr/share/jenkins/slave.jar https://repo.jenkins-ci.org/public/org/jenkins-ci/main/remoting/${VERSION}/remoting-${VERSION}.jar \ diff --git a/jenkins/worker.py b/jenkins/worker.py index 8225f6b..e23213e 100644 --- a/jenkins/worker.py +++ b/jenkins/worker.py @@ -197,6 +197,7 @@ class Job(object): self.assets_writer_launch_file = entity['assets_writer_launch_file'] self.assets_writer_config_file = entity['assets_writer_config_file'] self.rosbag = entity['rosbag'] + self.ros_package = entity['ros_package'] def __repr__(self): return 'Job: id : {} launch_file: {} rosbag: {}'.format( @@ -218,18 +219,20 @@ class Job(object): # Creates pbstream output = run_ros_cmd(ros_distro, - '/usr/bin/time -v roslaunch cartographer_ros {} ' + '/usr/bin/time -v roslaunch {} {} ' 'bag_filenames:={}/{} no_rviz:=true'.format( - self.launch_file, scratch_dir, rosbag_filename)) + self.ros_package, self.launch_file, scratch_dir, + rosbag_filename)) info = extract_stats(output) # Creates assets. run_ros_cmd( - ros_distro, '/usr/bin/time -v roslaunch cartographer_ros {} ' + ros_distro, '/usr/bin/time -v roslaunch {} {} ' 'bag_filenames:={}/{} pose_graph_filename:=' '{}/{}.pbstream config_file:={}'.format( - self.assets_writer_launch_file, scratch_dir, rosbag_filename, - scratch_dir, rosbag_filename, self.assets_writer_config_file)) + self.ros_package, self.assets_writer_launch_file, scratch_dir, + rosbag_filename, scratch_dir, rosbag_filename, + self.assets_writer_config_file)) # Copies assets to bucket. run_cmd('gsutil cp {}/{}.pbstream '