Giter Club home page Giter Club logo

la-data-generator's Introduction

Introduction

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:

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.

1) Prerequisites

This repo

Clone or download this repository and follow these steps:

Some inventories

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

Some data directory

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.

docker

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.

Optionally the ala-install repository

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/

2) Build

Now you can build this image:

./do build 

Or directly pull it from docker hub

docker pull livingatlases/la-data-generator

3) Run

Run the image with stable ala-install

./do --data=$DATA_DIR --inv=$LA_INV run

Or run the image with some other ala-install

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

4) Finally, generate all /data in DATA_DIR

./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'

Re-run

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.

Stop and remove the container

docker stop la-data-generator

Sample DATA_DIR output

Further help

$ ./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.

License

Apache-2.0 © Living Atlases

la-data-generator's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.