3 . `dirname "$(readlink -f "$0")"`/run-library.sh
4 . `dirname "$(readlink -f "$0")"`/libcloud-pin
6 read -rd "\000" helpmessage <<EOF
7 $(basename $0): Build Arvados packages
10 WORKSPACE=/path/to/arvados $(basename $0) [options]
14 --build-bundle-packages (default: false)
15 Build api server and workbench packages with vendor/bundle included
17 Output debug information (default: false)
19 Distribution to build packages for (default: debian7)
21 Build command to execute (defaults to the run command defined in the
24 WORKSPACE=path Path to the Arvados source tree to build packages from
29 DEBUG=${ARVADOS_DEBUG:-0}
33 PARSEDOPTS=$(getopt --name "$0" --longoptions \
34 help,build-bundle-packages,debug,target: \
40 eval set -- "$PARSEDOPTS"
41 while [ $# -gt 0 ]; do
44 echo >&2 "$helpmessage"
59 echo >&2 "$0: unrecognized argument '$2'. Try: $0 --help"
67 if [[ "$COMMAND" != "" ]]; then
68 COMMAND="/usr/local/rvm/bin/rvm-exec default bash /jenkins/$COMMAND --target $TARGET"
71 STDOUT_IF_DEBUG=/dev/null
72 STDERR_IF_DEBUG=/dev/null
74 if [[ "$DEBUG" != 0 ]]; then
75 STDOUT_IF_DEBUG=/dev/stdout
76 STDERR_IF_DEBUG=/dev/stderr
80 declare -a PYTHON_BACKPORTS PYTHON3_BACKPORTS
83 PYTHON3_VERSION=$(python3 -c 'import sys; print("{v.major}.{v.minor}".format(v=sys.version_info))')
88 PYTHON2_PACKAGE=python$PYTHON2_VERSION
89 PYTHON2_PKG_PREFIX=python
90 PYTHON3_PACKAGE=python$PYTHON3_VERSION
91 PYTHON3_PKG_PREFIX=python3
92 PYTHON_BACKPORTS=(python-gflags google-api-python-client==1.4.2 \
93 oauth2client==1.5.2 pyasn1==0.1.7 pyasn1-modules==0.0.5 \
94 rsa uritemplate httplib2 ws4py pykka six pyexecjs jsonschema \
95 ciso8601 pycrypto backports.ssl_match_hostname llfuse==0.41.1 \
96 'pycurl<7.21.5' contextlib2 pyyaml 'rdflib>=4.2.0' 'rdflib-jsonld>=0.3.0' \
98 PYTHON3_BACKPORTS=(docker-py six requests websocket-client)
102 PYTHON2_PACKAGE=python$PYTHON2_VERSION
103 PYTHON2_PKG_PREFIX=python
104 PYTHON3_PACKAGE=python$PYTHON3_VERSION
105 PYTHON3_PKG_PREFIX=python3
106 PYTHON_BACKPORTS=(python-gflags google-api-python-client==1.4.2 \
107 oauth2client==1.5.2 pyasn1==0.1.7 pyasn1-modules==0.0.5 \
108 rsa uritemplate httplib2 ws4py pykka six pyexecjs jsonschema \
109 ciso8601 pycrypto backports.ssl_match_hostname llfuse==0.41.1 \
110 'pycurl<7.21.5' pyyaml 'rdflib>=4.2.0' 'rdflib-jsonld>=0.3.0' \
112 PYTHON3_BACKPORTS=(docker-py six requests websocket-client)
116 PYTHON2_PACKAGE=python$PYTHON2_VERSION
117 PYTHON2_PKG_PREFIX=python
118 PYTHON3_PACKAGE=python$PYTHON3_VERSION
119 PYTHON3_PKG_PREFIX=python3
120 PYTHON_BACKPORTS=(python-gflags google-api-python-client==1.4.2 \
121 oauth2client==1.5.2 pyasn1==0.1.7 pyasn1-modules==0.0.5 \
122 rsa uritemplate httplib2 ws4py pykka six pyexecjs jsonschema \
123 ciso8601 pycrypto backports.ssl_match_hostname llfuse==0.41.1 \
124 contextlib2 'pycurl<7.21.5' pyyaml 'rdflib>=4.2.0' \
125 'rdflib-jsonld>=0.3.0' shellescape mistune)
126 PYTHON3_BACKPORTS=(docker-py six requests websocket-client)
130 PYTHON2_PACKAGE=python$PYTHON2_VERSION
131 PYTHON2_PKG_PREFIX=python
132 PYTHON3_PACKAGE=python$PYTHON3_VERSION
133 PYTHON3_PKG_PREFIX=python3
134 PYTHON_BACKPORTS=(pyasn1==0.1.7 pyasn1-modules==0.0.5 llfuse==0.41.1 ciso8601 \
135 google-api-python-client==1.4.2 six uritemplate oauth2client==1.5.2 httplib2 \
136 rsa 'pycurl<7.21.5' backports.ssl_match_hostname pyyaml 'rdflib>=4.2.0' \
137 'rdflib-jsonld>=0.3.0' shellescape mistune)
138 PYTHON3_BACKPORTS=(docker-py requests websocket-client)
142 PYTHON2_PACKAGE=$(rpm -qf "$(which python$PYTHON2_VERSION)" --queryformat '%{NAME}\n')
143 PYTHON2_PKG_PREFIX=$PYTHON2_PACKAGE
144 PYTHON3_PACKAGE=$(rpm -qf "$(which python$PYTHON3_VERSION)" --queryformat '%{NAME}\n')
145 PYTHON3_PKG_PREFIX=$PYTHON3_PACKAGE
146 PYTHON_BACKPORTS=(python-gflags google-api-python-client==1.4.2 \
147 oauth2client==1.5.2 pyasn1==0.1.7 pyasn1-modules==0.0.5 \
148 rsa uritemplate httplib2 ws4py pykka six pyexecjs jsonschema \
149 ciso8601 pycrypto backports.ssl_match_hostname 'pycurl<7.21.5' \
150 python-daemon lockfile llfuse==0.41.1 'pbr<1.0' pyyaml \
151 'rdflib>=4.2.0' 'rdflib-jsonld>=0.3.0' shellescape mistune)
152 PYTHON3_BACKPORTS=(docker-py six requests websocket-client)
153 export PYCURL_SSL_LIBRARY=nss
156 echo -e "$0: Unknown target '$TARGET'.\n" >&2
162 if ! [[ -n "$WORKSPACE" ]]; then
163 echo >&2 "$helpmessage"
165 echo >&2 "Error: WORKSPACE environment variable not set"
171 fpm --version >/dev/null 2>&1
173 if [[ "$?" != 0 ]]; then
174 echo >&2 "$helpmessage"
176 echo >&2 "Error: fpm not found"
181 EASY_INSTALL2=$(find_easy_install -$PYTHON2_VERSION "")
182 EASY_INSTALL3=$(find_easy_install -$PYTHON3_VERSION 3)
184 RUN_BUILD_PACKAGES_PATH="`dirname \"$0\"`"
185 RUN_BUILD_PACKAGES_PATH="`( cd \"$RUN_BUILD_PACKAGES_PATH\" && pwd )`" # absolutized and normalized
186 if [ -z "$RUN_BUILD_PACKAGES_PATH" ] ; then
187 # error; for some reason, the path is not accessible
188 # to the script (e.g. permissions re-evaled after suid)
192 debug_echo "$0 is running from $RUN_BUILD_PACKAGES_PATH"
193 debug_echo "Workspace is $WORKSPACE"
195 if [[ -f /etc/profile.d/rvm.sh ]]; then
196 source /etc/profile.d/rvm.sh
197 GEM="rvm-exec default gem"
202 # Make all files world-readable -- jenkins runs with umask 027, and has checked
203 # out our git tree here
204 chmod o+r "$WORKSPACE" -R
206 # More cleanup - make sure all executables that we'll package are 755
207 find -type d -name 'bin' |xargs -I {} find {} -type f |xargs -I {} chmod 755 {}
209 # Now fix our umask to something better suited to building and publishing
213 debug_echo "umask is" `umask`
215 if [[ ! -d "$WORKSPACE/packages/$TARGET" ]]; then
216 mkdir -p $WORKSPACE/packages/$TARGET
220 debug_echo -e "\nPerl packages\n"
222 cd "$WORKSPACE/sdk/perl"
224 if [[ -e Makefile ]]; then
225 make realclean >"$STDOUT_IF_DEBUG"
227 find -maxdepth 1 \( -name 'MANIFEST*' -or -name "libarvados-perl*.$FORMAT" \) \
231 perl Makefile.PL INSTALL_BASE=install >"$STDOUT_IF_DEBUG" && \
232 make install INSTALLDIRS=perl >"$STDOUT_IF_DEBUG" && \
233 fpm_build install/lib/=/usr/share libarvados-perl \
234 "Curoverse, Inc." dir "$(version_from_git)" install/man/=/usr/share/man \
235 "$WORKSPACE/LICENSE-2.0.txt=/usr/share/doc/libarvados-perl/LICENSE-2.0.txt" && \
236 mv --no-clobber libarvados-perl*.$FORMAT "$WORKSPACE/packages/$TARGET/"
239 debug_echo -e "\nRuby gems\n"
241 FPM_GEM_PREFIX=$($GEM environment gemdir)
243 cd "$WORKSPACE/sdk/ruby"
244 handle_ruby_gem arvados
246 cd "$WORKSPACE/sdk/cli"
247 handle_ruby_gem arvados-cli
249 cd "$WORKSPACE/services/login-sync"
250 handle_ruby_gem arvados-login-sync
253 debug_echo -e "\nPython packages\n"
255 cd "$WORKSPACE/sdk/pam"
256 handle_python_package
258 cd "$WORKSPACE/sdk/python"
259 handle_python_package
261 cd "$WORKSPACE/sdk/cwl"
262 handle_python_package
264 cd "$WORKSPACE/services/fuse"
265 handle_python_package
267 cd "$WORKSPACE/services/nodemanager"
268 handle_python_package
275 COMMIT_HASH=$(format_last_commit_here "%H")
277 SRC_BUILD_DIR=$(mktemp -d)
278 # mktemp creates the directory with 0700 permissions by default
279 chmod 755 $SRC_BUILD_DIR
280 git clone $DASHQ_UNLESS_DEBUG "$WORKSPACE/.git" "$SRC_BUILD_DIR"
283 # go into detached-head state
284 git checkout $DASHQ_UNLESS_DEBUG "$COMMIT_HASH"
285 echo "$COMMIT_HASH" >git-commit.version
288 PKG_VERSION=$(version_from_git)
289 cd $WORKSPACE/packages/$TARGET
290 fpm_build $SRC_BUILD_DIR/=/usr/local/arvados/src arvados-src 'Curoverse, Inc.' 'dir' "$PKG_VERSION" "--exclude=usr/local/arvados/src/.git" "--url=https://arvados.org" "--license=GNU Affero General Public License, version 3.0" "--description=The Arvados source code" "--architecture=all"
292 rm -rf "$SRC_BUILD_DIR"
295 # On older platforms we need to publish a backport of libfuse >=2.9.2,
296 # and we need to build and install it here in order to even build an
298 cd $WORKSPACE/packages/$TARGET
299 if [[ $TARGET =~ ubuntu1204 ]]; then
300 # port libfuse 2.9.2 to Ubuntu 12.04
301 LIBFUSE_DIR=$(mktemp -d)
304 # download fuse 2.9.2 ubuntu 14.04 source package
305 file="fuse_2.9.2.orig.tar.xz" && curl -L -o "${file}" "http://archive.ubuntu.com/ubuntu/pool/main/f/fuse/${file}"
306 file="fuse_2.9.2-4ubuntu4.14.04.1.debian.tar.xz" && curl -L -o "${file}" "http://archive.ubuntu.com/ubuntu/pool/main/f/fuse/${file}"
307 file="fuse_2.9.2-4ubuntu4.14.04.1.dsc" && curl -L -o "${file}" "http://archive.ubuntu.com/ubuntu/pool/main/f/fuse/${file}"
309 # install dpkg-source and dpkg-buildpackage commands
310 apt-get install -y --no-install-recommends dpkg-dev
312 # extract source and apply patches
313 dpkg-source -x fuse_2.9.2-4ubuntu4.14.04.1.dsc
314 rm -f fuse_2.9.2.orig.tar.xz fuse_2.9.2-4ubuntu4.14.04.1.debian.tar.xz fuse_2.9.2-4ubuntu4.14.04.1.dsc
316 # add new version to changelog
319 echo "fuse (2.9.2-5) precise; urgency=low"
321 echo " * Backported from trusty-security to precise"
323 echo " -- Joshua Randall <jcrandall@alum.mit.edu> Thu, 4 Feb 2016 11:31:00 -0000"
326 ) > debian/changelog.new
327 mv debian/changelog.new debian/changelog
329 # install build-deps and build
330 apt-get install -y --no-install-recommends debhelper dh-autoreconf libselinux-dev
331 dpkg-buildpackage -rfakeroot -b
333 fpm_build "$LIBFUSE_DIR/fuse_2.9.2-5_amd64.deb" fuse "Ubuntu Developers" deb "2.9.2" --iteration 5
334 fpm_build "$LIBFUSE_DIR/libfuse2_2.9.2-5_amd64.deb" libfuse2 "Ubuntu Developers" deb "2.9.2" --iteration 5
335 fpm_build "$LIBFUSE_DIR/libfuse-dev_2.9.2-5_amd64.deb" libfuse-dev "Ubuntu Developers" deb "2.9.2" --iteration 5
337 "$WORKSPACE/packages/$TARGET/fuse_2.9.2-5_amd64.deb" \
338 "$WORKSPACE/packages/$TARGET/libfuse2_2.9.2-5_amd64.deb" \
339 "$WORKSPACE/packages/$TARGET/libfuse-dev_2.9.2-5_amd64.deb"
340 apt-get -y --no-install-recommends -f install
342 elif [[ $TARGET =~ centos6 ]]; then
343 # port fuse 2.9.2 to centos 6
344 # install tools to build rpm from source
345 yum install -y rpm-build redhat-rpm-config
346 LIBFUSE_DIR=$(mktemp -d)
349 # download fuse 2.9.2 centos 7 source rpm
350 file="fuse-2.9.2-6.el7.src.rpm" && curl -L -o "${file}" "http://vault.centos.org/7.2.1511/os/Source/SPackages/${file}"
352 # modify source rpm spec to remove conflict on filesystem version
353 mkdir -p /root/rpmbuild/SOURCES
354 cd /root/rpmbuild/SOURCES
355 rpm2cpio ${LIBFUSE_DIR}/fuse-2.9.2-6.el7.src.rpm | cpio -i
356 perl -pi -e 's/Conflicts:\s*filesystem.*//g' fuse.spec
358 # build rpms from source
359 rpmbuild -bb /root/rpmbuild/SOURCES/fuse.spec
360 rm -f fuse-2.9.2-6.el7.src.rpm
361 # move built RPMs to LIBFUSE_DIR
362 mv "/root/rpmbuild/RPMS/x86_64/fuse-2.9.2-6.el6.x86_64.rpm" ${LIBFUSE_DIR}/
363 mv "/root/rpmbuild/RPMS/x86_64/fuse-libs-2.9.2-6.el6.x86_64.rpm" ${LIBFUSE_DIR}/
364 mv "/root/rpmbuild/RPMS/x86_64/fuse-devel-2.9.2-6.el6.x86_64.rpm" ${LIBFUSE_DIR}/
365 rm -rf /root/rpmbuild
367 fpm_build "$LIBFUSE_DIR/fuse-libs-2.9.2-6.el6.x86_64.rpm" fuse-libs "Centos Developers" rpm "2.9.2" --iteration 5
368 fpm_build "$LIBFUSE_DIR/fuse-2.9.2-6.el6.x86_64.rpm" fuse "Centos Developers" rpm "2.9.2" --iteration 5 --no-auto-depends
369 fpm_build "$LIBFUSE_DIR/fuse-devel-2.9.2-6.el6.x86_64.rpm" fuse-devel "Centos Developers" rpm "2.9.2" --iteration 5 --no-auto-depends
371 "$WORKSPACE/packages/$TARGET/fuse-libs-2.9.2-5.x86_64.rpm" \
372 "$WORKSPACE/packages/$TARGET/fuse-2.9.2-5.x86_64.rpm" \
373 "$WORKSPACE/packages/$TARGET/fuse-devel-2.9.2-5.x86_64.rpm"
377 cd $WORKSPACE/packages/$TARGET
378 export GOPATH=$(mktemp -d)
379 package_go_binary services/keepstore keepstore \
380 "Keep storage daemon, accessible to clients on the LAN"
381 package_go_binary services/keepproxy keepproxy \
382 "Make a Keep cluster accessible to clients that are not on the LAN"
383 package_go_binary services/keep-web keep-web \
384 "Static web hosting service for user data stored in Arvados Keep"
385 package_go_binary services/datamanager arvados-data-manager \
386 "Ensure block replication levels, report disk usage, and determine which blocks should be deleted when space is needed"
387 package_go_binary services/arv-git-httpd arvados-git-httpd \
388 "Provide authenticated http access to Arvados-hosted git repositories"
389 package_go_binary services/crunchstat crunchstat \
390 "Gather cpu/memory/network statistics of running Crunch jobs"
391 package_go_binary tools/keep-rsync keep-rsync \
392 "Copy all data from one set of Keep servers to another"
395 # Please resist the temptation to add --no-python-fix-name to the fpm call here
396 # (which would remove the python- prefix from the package name), because this
397 # package is a dependency of arvados-fuse, and fpm can not omit the python-
398 # prefix from only one of the dependencies of a package... Maybe I could
399 # whip up a patch and send it upstream, but that will be for another day. Ward,
401 cd $WORKSPACE/packages/$TARGET
402 rm -rf "$WORKSPACE/sdk/python/build"
403 fpm_build $WORKSPACE/sdk/python "${PYTHON2_PKG_PREFIX}-arvados-python-client" 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/sdk/python/arvados_python_client.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados Python SDK" --deb-recommends=git
406 cd $WORKSPACE/packages/$TARGET
407 rm -rf "$WORKSPACE/sdk/cwl/build"
408 fpm_build $WORKSPACE/sdk/cwl "${PYTHON2_PKG_PREFIX}-arvados-cwl-runner" 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/sdk/cwl/arvados_cwl_runner.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados CWL runner"
410 # schema_salad. This is a python dependency of arvados-cwl-runner,
411 # but we can't use the usual PYTHONPACKAGES way to build this package due to the
412 # intricacies of how version numbers get generated in setup.py: we need version
413 # 1.7.20160316203940. If we don't explicitly list that version with the -v
414 # argument to fpm, and instead specify it as schema_salad==1.7.20160316203940, we get
415 # a package with version 1.7. That's because our gittagger hack is not being
416 # picked up by self.distribution.get_version(), which is called from
417 # https://github.com/jordansissel/fpm/blob/master/lib/fpm/package/pyfpm/get_metadata.py
418 # by means of this command:
420 # python2.7 setup.py --command-packages=pyfpm get_metadata --output=metadata.json
422 # So we build this thing separately.
425 fpm --maintainer='Ward Vandewege <ward@curoverse.com>' -s python -t deb --exclude=*/dist-packages/tests/* --exclude=*/site-packages/tests/* --deb-ignore-iteration-in-dependencies -n python-schema-salad --iteration 1 --python-bin python2.7 --python-easyinstall easy_install-2.7 --python-package-name-prefix python --depends python2.7 -v 1.7.20160316203940 schema_salad
427 # And for cwltool we have the same problem as for schema_salad. Ward, 2016-03-17
428 fpm --maintainer='Ward Vandewege <ward@curoverse.com>' -s python -t deb --exclude=*/dist-packages/tests/* --exclude=*/site-packages/tests/* --deb-ignore-iteration-in-dependencies -n python-cwltool --iteration 1 --python-bin python2.7 --python-easyinstall easy_install-2.7 --python-package-name-prefix python --depends python2.7 -v 1.0.20160316204054 cwltool
431 if [[ $TARGET =~ debian|ubuntu ]]; then
432 cd $WORKSPACE/packages/$TARGET
433 rm -rf "$WORKSPACE/sdk/pam/build"
434 fpm_build $WORKSPACE/sdk/pam libpam-arvados 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/sdk/pam/arvados_pam.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=PAM module for authenticating shell logins using Arvados API tokens" --depends libpam-python
438 # Please see comment about --no-python-fix-name above; we stay consistent and do
439 # not omit the python- prefix first.
440 cd $WORKSPACE/packages/$TARGET
441 rm -rf "$WORKSPACE/services/fuse/build"
442 fpm_build $WORKSPACE/services/fuse "${PYTHON2_PKG_PREFIX}-arvados-fuse" 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/services/fuse/arvados_fuse.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Keep FUSE driver"
445 cd $WORKSPACE/packages/$TARGET
446 rm -rf "$WORKSPACE/services/nodemanager/build"
447 fpm_build $WORKSPACE/services/nodemanager arvados-node-manager 'Curoverse, Inc.' 'python' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/services/nodemanager/arvados_node_manager.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados node manager"
449 # The Docker image cleaner
450 cd $WORKSPACE/packages/$TARGET
451 rm -rf "$WORKSPACE/services/dockercleaner/build"
452 fpm_build $WORKSPACE/services/dockercleaner arvados-docker-cleaner 'Curoverse, Inc.' 'python3' "$(awk '($1 == "Version:"){print $2}' $WORKSPACE/services/dockercleaner/arvados_docker_cleaner.egg-info/PKG-INFO)" "--url=https://arvados.org" "--description=The Arvados Docker image cleaner"
455 LIBCLOUD_DIR=$(mktemp -d)
458 git clone $DASHQ_UNLESS_DEBUG https://github.com/curoverse/libcloud.git .
459 git checkout apache-libcloud-$LIBCLOUD_PIN
460 # libcloud is absurdly noisy without -q, so force -q here
461 OLD_DASHQ_UNLESS_DEBUG=$DASHQ_UNLESS_DEBUG
462 DASHQ_UNLESS_DEBUG=-q
463 handle_python_package
464 DASHQ_UNLESS_DEBUG=$OLD_DASHQ_UNLESS_DEBUG
466 fpm_build $LIBCLOUD_DIR "$PYTHON2_PKG_PREFIX"-apache-libcloud
469 # Python 2 dependencies
470 declare -a PIP_DOWNLOAD_SWITCHES=(--no-deps)
471 # Add --no-use-wheel if this pip knows it.
472 pip wheel --help >/dev/null 2>&1
474 0) PIP_DOWNLOAD_SWITCHES+=(--no-use-wheel) ;;
476 *) echo "WARNING: `pip wheel` test returned unknown exit code $?" ;;
479 for deppkg in "${PYTHON_BACKPORTS[@]}"; do
480 outname=$(echo "$deppkg" | sed -e 's/^python-//' -e 's/[<=>].*//' -e 's/_/-/g' -e "s/^/${PYTHON2_PKG_PREFIX}-/")
482 httplib2|google-api-python-client)
483 # Work around 0640 permissions on some package files.
484 # See #7591 and #7991.
485 pyfpm_workdir=$(mktemp --tmpdir -d pyfpm-XXXXXX) && (
488 pip install "${PIP_DOWNLOAD_SWITCHES[@]}" --download . "$deppkg"
489 tar -xf "$deppkg"-*.tar*
491 "python$PYTHON2_VERSION" setup.py $DASHQ_UNLESS_DEBUG egg_info build
494 # --iteration 2 provides an upgrade for previously built
496 fpm_build . "$outname" "" python "" --iteration 2
497 # The upload step uses the package timestamp to determine
498 # whether it's new. --no-clobber plays nice with that.
499 mv --no-clobber "$outname"*.$FORMAT "$WORKSPACE/packages/$TARGET"
501 if [ 0 != "$?" ]; then
502 echo "ERROR: $deppkg build process failed"
505 if [ -n "$pyfpm_workdir" ]; then
506 rm -rf "$pyfpm_workdir"
510 fpm_build "$deppkg" "$outname"
515 # Python 3 dependencies
516 for deppkg in "${PYTHON3_BACKPORTS[@]}"; do
517 outname=$(echo "$deppkg" | sed -e 's/^python-//' -e 's/[<=>].*//' -e 's/_/-/g' -e "s/^/${PYTHON3_PKG_PREFIX}-/")
518 # The empty string is the vendor argument: these aren't Curoverse software.
519 fpm_build "$deppkg" "$outname" "" python3
522 # Build the API server package
523 handle_rails_package arvados-api-server "$WORKSPACE/services/api" \
524 "$WORKSPACE/agpl-3.0.txt" --url="https://arvados.org" \
525 --description="Arvados API server - Arvados is a free and open source platform for big data science." \
526 --license="GNU Affero General Public License, version 3.0"
528 # Build the workbench server package
531 cd "$WORKSPACE/apps/workbench"
533 # We need to bundle to be ready even when we build a package without vendor directory
534 # because asset compilation requires it.
535 bundle install --path vendor/bundle >"$STDOUT_IF_DEBUG"
537 # clear the tmp directory; the asset generation step will recreate tmp/cache/assets,
538 # and we want that in the package, so it's easier to not exclude the tmp directory
539 # from the package - empty it instead.
543 # Set up application.yml and production.rb so that asset precompilation works
544 \cp config/application.yml.example config/application.yml -f
545 \cp config/environments/production.rb.example config/environments/production.rb -f
546 sed -i 's/secret_token: ~/secret_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/' config/application.yml
548 RAILS_ENV=production RAILS_GROUPS=assets bundle exec rake assets:precompile >/dev/null
550 # Remove generated configuration files so they don't go in the package.
551 rm config/application.yml config/environments/production.rb
554 if [[ "$?" != "0" ]]; then
555 echo "ERROR: Asset precompilation failed"
558 handle_rails_package arvados-workbench "$WORKSPACE/apps/workbench" \
559 "$WORKSPACE/agpl-3.0.txt" --url="https://arvados.org" \
560 --description="Arvados Workbench - Arvados is a free and open source platform for big data science." \
561 --license="GNU Affero General Public License, version 3.0"
564 # clean up temporary GOPATH