Many times we need some LA configurations, those generated by ala-install typically in /data
when using ansible
to deploy a LA portal.
These configurations are useful for instance:
- To setup a LA Development environment.
- On docker LA deployments that don't use
ala-install
.
More than these configurations, it's also important to have a correct directory hierarchy, users/groups and permissions of this /data
directory and descendants.
So many times people ask in our slack channel for these configurations, or ask for the permissions of some of these directories.
This helper generate this /data
for you, using docker
+ ala-install
+ some-inventories and some basic steps.
Clone or download this repository and follow these steps:
You will need some LA generated ansible
inventories, use the command line or the web interface: https://generator.l-a.site.
Setup a LA_INV
enviroment shell variable pointing to the directory of these inventories:
export LA_INV=/home/myuser/the/directory/where/I/unziped/the/inventories
If you need some development environment, create a /data
owned by you:
sudo mkdir /data
sudo chown youruser:youruser /data
export DATA_DIR=/data/
or if you don't need it for a develoment environment, you can create a data directory in any other location:
mkdir /tmp/data
export DATA_DIR=/tmp/data/
We'll use this DATA_DIR
as a volume in the docker image.
As we mentioned above, we use docker
to run ansible
inside a container and generate that LA /data
for you.
So you need to install docker in the computer you are using.
You can provide an ala-install
cloned repository as a docker volume, or if not, we'll use a stable version for you.
Let's setup this in a variable also:
export ALA_INSTALL=/home/myuser/ala-install-location/
Now you can build this image:
./do build
docker pull livingatlases/la-data-generator
./do --data=$DATA_DIR --inv=$LA_INV run
Clone ala-install
in some directory and run this image with that ala-install
volume.
./do --data=$DATA_DIR --inv=$LA_INV --ala-install=$AL_INSTALL run
./do generate
or just some service:
./do generate spatial
In the previous step we configured the ssh
to fake a bit your inventories hostnames, so ansible will access via ssh
to localhost and configure the DATA_DIR
volume.
At the end your configs will be accesible in:
ls -l $DATA_DIR
Check the uid
/gid
of each user with:
docker exec -i -t la-data-generator bash -c 'id tomcat7; id solr; id image-service; id postgres; id doi-service'
You can edit your inventories to fit better to your needs, update the inventories, and rerun the previous ansiblew
docker exec command to update your DATA_DIR
.
docker stop la-data-generator
$ ./do -h
do: LA data generator
Usage:
do [options] build
do [options] --data=<dir> --inv=<dir> [--ala-install=<dir>] run
do [options] generate [<service>...]
do -h | --help
do -v | --version
Options:
--verbose Verbose output.
-d --dry-run Print the commands without actually running them.
-h --help Show this help.
-v --version Show version.
Apache-2.0 © Living Atlases