Skip to content

Commit 7cd9f45

Browse files
committed
add migration testing info, miscellaneous
1 parent 2c22375 commit 7cd9f45

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,4 +346,39 @@ To build the `sphinx` documentation locally, use:
346346

347347
```shell
348348
docker run -v $(pwd):/opt/dev -w /opt/dev computationalplantscience/plantit sphinx-build -b html docs docs_output
349-
```
349+
```
350+
351+
### Testing DIRT migrations
352+
353+
The DIRT migration feature allows users of the original [DIRT](http://dirt.cyverse.org/) web application to migrate their data to `plantit`. To test this feature, you will need to have access to the DIRT server and database. The following environment variables must be set:
354+
355+
- `DIRT_MIGRATION_DATA_DIR`: the directory on the DIRT server where DIRT data is stored
356+
- `DIRT_MIGRATION_HOST`: the hostname of the DIRT server
357+
- `DIRT_MIGRATION_PORT`: the SSH port of the DIRT server
358+
- `DIRT_MIGRATION_USERNAME`: the SSH username for the DIRT server
359+
- `DIRT_MIGRATION_DB_HOST`: the hostname of the DIRT database server
360+
- `DIRT_MIGRATION_DB_PORT`: the port of the DIRT database server
361+
- `DIRT_MIGRATION_DB_USER`: the username of the DIRT database user
362+
- `DIRT_MIGRATION_DB_DATABASE`: the name of the DIRT database
363+
- `DIRT_MIGRATION_DB_PASSWORD`: the DIRT database password
364+
365+
An SSH tunnel must also be opened to the DIRT server, as the database is not open to external connections. For instance, to open a tunnel from port 5678 on the DIRT server to port 3306 on a development machine:
366+
367+
```shell
368+
ssh -L 3306:localhost:3306 -p 5678 <your cyverse username>@<DIRT server IP or FQDN>
369+
```
370+
371+
On some Linux systems it may be necessary to:
372+
- substitute the loopback IP address `127.0.0.1` for `localhost`
373+
374+
Be sure to set `DIRT_MIGRATION_DB_HOST=host.docker.internal` to point the Docker containers to the host's loopback/localhost address.
375+
376+
Some extra configuration is necessary for Linux systems to allow containers to access services running on the local host. The `docker-compose.dev.yml` configuration file configures the `plantit`, `celery`, and `celerye` containers with the `extra_hosts` option:
377+
378+
```yaml
379+
extra_hosts:
380+
- "host.docker.internal:host-gateway"
381+
```
382+
383+
This is only necessary on Linux systems. On Mac and Windows, the `host.docker.internal` hostname is automatically configured. See [this post](https://stackoverflow.com/a/43541732/6514033) for more information.
384+

docker-compose.dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ services:
8686
- celery
8787
ports:
8888
- "3000:3000"
89+
extra_hosts:
90+
- "host.docker.internal:host-gateway"
8991
healthcheck:
9092
test: curl -f http://localhost:3000/ping/
9193
interval: 20s
@@ -291,6 +293,8 @@ services:
291293
- FIND_STRANDED_TASKS=${FIND_STRANDED_TASKS}
292294
- PULL_JOB_WALLTIME=${PULL_JOB_WALLTIME}
293295
- PUSH_JOB_WALLTIME=${PUSH_JOB_WALLTIME}
296+
extra_hosts:
297+
- "host.docker.internal:host-gateway"
294298
healthcheck:
295299
test: celery -A plantit status | grep "OK"
296300
interval: 60s
@@ -387,6 +391,8 @@ services:
387391
- FIND_STRANDED_TASKS=${FIND_STRANDED_TASKS}
388392
- PULL_JOB_WALLTIME=${PULL_JOB_WALLTIME}
389393
- PUSH_JOB_WALLTIME=${PUSH_JOB_WALLTIME}
394+
extra_hosts:
395+
- "host.docker.internal:host-gateway"
390396
healthcheck:
391397
test: celery -A plantit status | grep "OK"
392398
interval: 60s

dockerfiles/plantit/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ RUN apt-get -y update && apt-get install -y \
55
python3-numpy-dev \
66
cron \
77
postgresql-client \
8+
default-mysql-client \
89
openssh-client \
10+
iputils-ping \
911
sshpass \
1012
curl \
1113
vim \
@@ -35,4 +37,3 @@ RUN chmod +x scripts/ssh-copy-id.expect
3537
RUN chmod +x scripts/wait-for-it.sh
3638
RUN chmod +x scripts/wait-for-postgres.sh
3739
RUN pip3 install coveralls
38-

0 commit comments

Comments
 (0)