Bug #22474
closedJenkins test node build fails because arvados-server is not in $PATH
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.
Updated by Brett Smith about 1 year 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
- Built a new image from the branch, configured Jenkins to use that, and then did a successful test run: developer-run-tests: #4611
- Built a new image from the branch, configured Jenkins to use that, and then did a successful test run: developer-run-tests: #4611
- 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)
Updated by Lucas Di Pentima about 1 year 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.
Updated by Brett Smith about 1 year ago
Lucas Di Pentima wrote in #note-3:
At line 37 there's a
trapline that AFAICT should delete the$builddirdirectory right after building thearvados-serverbinary and before installing it in$PATH. Can you tell what am I missing here? The secondtrapat line 42 also removes the$builddirdirectory 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.
Updated by Lucas Di Pentima about 1 year ago
Thank you, I was assuming trap would run its task on the next command's exit and not the currently running script.
LGTM
Updated by Brett Smith about 1 year ago
- Status changed from In Progress to Resolved
Applied in changeset arvados-dev|4951623dc2a418270b5822ad5da0547a39356ea4.