Make ros_pkg configurable for Jenkins workers (#740)

* Make ros_pkg configurable for Jenkins workers
master
Christoph Schütte 2018-02-27 15:00:59 +01:00 committed by GitHub
parent 58f463dc98
commit faa21f4234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 7 deletions

View File

@ -84,9 +84,9 @@ ENV HOME /home/jenkins
RUN addgroup --system --gid 10000 jenkins RUN addgroup --system --gid 10000 jenkins
RUN adduser --system --ingroup jenkins --home $HOME --uid 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 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 \ 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 \

View File

@ -197,6 +197,7 @@ class Job(object):
self.assets_writer_launch_file = entity['assets_writer_launch_file'] self.assets_writer_launch_file = entity['assets_writer_launch_file']
self.assets_writer_config_file = entity['assets_writer_config_file'] self.assets_writer_config_file = entity['assets_writer_config_file']
self.rosbag = entity['rosbag'] self.rosbag = entity['rosbag']
self.ros_package = entity['ros_package']
def __repr__(self): def __repr__(self):
return 'Job: id : {} launch_file: {} rosbag: {}'.format( return 'Job: id : {} launch_file: {} rosbag: {}'.format(
@ -218,18 +219,20 @@ class Job(object):
# Creates pbstream # Creates pbstream
output = run_ros_cmd(ros_distro, output = run_ros_cmd(ros_distro,
'/usr/bin/time -v roslaunch cartographer_ros {} ' '/usr/bin/time -v roslaunch {} {} '
'bag_filenames:={}/{} no_rviz:=true'.format( '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) info = extract_stats(output)
# Creates assets. # Creates assets.
run_ros_cmd( run_ros_cmd(
ros_distro, '/usr/bin/time -v roslaunch cartographer_ros {} ' ros_distro, '/usr/bin/time -v roslaunch {} {} '
'bag_filenames:={}/{} pose_graph_filename:=' 'bag_filenames:={}/{} pose_graph_filename:='
'{}/{}.pbstream config_file:={}'.format( '{}/{}.pbstream config_file:={}'.format(
self.assets_writer_launch_file, scratch_dir, rosbag_filename, self.ros_package, self.assets_writer_launch_file, scratch_dir,
scratch_dir, rosbag_filename, self.assets_writer_config_file)) rosbag_filename, scratch_dir, rosbag_filename,
self.assets_writer_config_file))
# Copies assets to bucket. # Copies assets to bucket.
run_cmd('gsutil cp {}/{}.pbstream ' run_cmd('gsutil cp {}/{}.pbstream '