16053-install-deps @ 0344940255604764cb37cf9ea248b538cce04ff4 -- developer-run-tests: #1775
This version should take care of dev/test dependencies mentioned at
Hacking prerequisites. For example:
- Build arvados-server binary ("go build -o /tmp ./cmd/arvados-server")
- Bind mount it into a docker container ("docker run -it -v /tmp/arvados-server:/bin/arvados-server:ro debian:10")
- Run the install subcommand ("arvados-server install -type test")
- Commit the docker container
- The resulting image can check out (or bind-mount) an arvados source tree, and run ("arvados-server boot -type test -own-temporary-database -source /path/to/arvados -config /path/to/arvados/doc/examples/config/zzzzz.yml")
There's a test along these lines, but it's disabled by default. You can run it with
go test -tags docker ./lib/install
The test downloads a lot, so it's good to use a proxy. If you set http_proxy and https_proxy env vars, they will be propagated to the docker container.
Once merged, this should reduce the "Hacking prerequisites" page to:
# (start with debian buster)
apt-get install --no-install-recommends build-essential ca-certificates git golang
go run git.arvados.org/arvados.git/cmd/arvados-server install -type test
...but for now, you need to insert extra steps to checkout this branch.
apt-get install --no-install-recommends build-essential ca-certificates git golang
go get -d -v git.arvados.org/arvados.git
(
export GO111MODULE=on
cd ~/go/src/git.arvados.org/arvados.git/cmd/arvados-server
git checkout origin/16053-install-deps
go mod download
go install
)
~/go/bin/arvados-server install -type test
You can also build the arvados-server binary elsewhere, copy it to the target machine, and run:
/path/to/arvados-server install -type test
There's also a script that nearly makes it practical to use run-tests.sh in a docker container, without having to install stuff on your dev machine at all. Currently it operates on a copy of your working tree instead of a read-only mount, though, so it's not quite conducive to edit-and-test cycles. Next we need to clean up the remaining things in run-tests.sh
(and test suites) that write files/dirs in the source tree.
# create a docker image with build deps:
./lib/install/arvadostest_docker_build.sh
# update the docker image with latest deps:
./lib/install/arvadostest_docker_build.sh --update
# run tests:
./lib/install/arvadostest_docker_run.sh --interactive
<pre>