Project

General

Profile

Actions

Bug #22474

closed

Jenkins test node build fails because arvados-server is not in $PATH

Added by Brett Smith 19 days ago. Updated 14 days ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
CI
Target version:
Story points:
-

Description

packer-build-jenkins-image-arvados-tests: #103

==> googlecompute: + cd /usr/src/arvados/services/api
==> googlecompute: + export RAILS_ENV=test
==> googlecompute: + RAILS_ENV=test
==> googlecompute: + bin/rails db:environment:set
==> googlecompute: rails aborted!
==> googlecompute: Errno::ENOENT: No such file or directory - arvados-server (Errno::ENOENT)

The build fails because the build script calls go run arvados-server install -test, which in turn calls bundle exec rake db:environment:set for RailsAPI, which in turn calls arvados-server config. This fails because we never installed arvados-server in $PATH, we're just running it directly.


Subtasks 1 (0 open1 closed)

Task #22475: Review arvados-dev branch 22406-rails-db-bugfixResolvedLucas Di Pentima01/27/2025Actions
Actions #1

Updated by Brett Smith 19 days ago

arvados-dev branch 22406-rails-db-bugfix @ commit:923b202afc12e0342f0fcdea32c15a3d1eb1a581 - packer-build-jenkins-image-arvados-tests: #104

  • All agreed upon points are implemented / addressed.
    • Does the simplest thing that could possibly work. A nicer solution can wait for when we switch this to using the Ansible test install playbook.
  • Anything not implemented (discovered or discussed during work) has a follow-up story.
    • N/A
  • Code is tested and passing, both automated and manual, what manual testing was done is described
  • Documentation has been updated.
    • N/A, pure bugfix
  • Behaves appropriately at the intended scale (describe intended scale).
    • No change in scale
  • Considered backwards and forwards compatibility issues between client and server.
    • N/A
  • Follows our coding standards and GUI style guidelines.
    • N/A (no shell style guide)
Actions #2

Updated by Brett Smith 19 days ago

  • Subtask #22475 added
Actions #3

Updated by Lucas Di Pentima 14 days ago

Although this update seems to have fixed the problem, I have some doubt:

At line 37 there's a trap line that AFAICT should delete the $builddir directory right after building the arvados-server binary and before installing it in $PATH. Can you tell what am I missing here? The second trap at line 42 also removes the $builddir directory so I'm guessing the first one shouldn't be there.

Actions #4

Updated by Brett Smith 14 days ago

Lucas Di Pentima wrote in #note-3:

At line 37 there's a trap line that AFAICT should delete the $builddir directory right after building the arvados-server binary and before installing it in $PATH. Can you tell what am I missing here? The second trap at line 42 also removes the $builddir directory so I'm guessing the first one shouldn't be there.

I think you might misunderstand the timing of trap. The shell code given to trap only runs when the shell exits with one of the listed conditions or signals, a little like Go's defer statement. So the first trap statement arranges to clean up the build directory on most exits, and then the second trap updates the handler to remove /usr/local/bin/arvados-server as well.

Put it another way: as long as everything goes well, only the second trap will run after the script finishes. The first trap is there to clean up in case something goes wrong before the second.

Actions #5

Updated by Lucas Di Pentima 14 days ago

Thank you, I was assuming trap would run its task on the next command's exit and not the currently running script.

LGTM

Actions #6

Updated by Brett Smith 14 days ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF