Skip to content

Commit

Permalink
Add more clarifications to setup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrablaj committed Mar 8, 2024
1 parent 2a352b4 commit 18e21f1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions content/en/apps/guides/data/analytics/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ Install the dependencies:
npm install
```

{{% alert title="Note" %}}
The first time you run the commands from any of the sections below it will need to download many Docker images and will take a while. You'll know it's done when you see `#8 DONE 0.0s` and you are returned to the command line. Be patient!
{{% /alert %}}

### Sample CouchDB data
This setup involves starting Logstash, PostgreSQL, PostgREST, DBT, and CouchDB. Sample fake data is generated for CouchDB.

Expand All @@ -64,6 +68,8 @@ Run the Docker containers and wait for every container to be up and running:
docker-compose -f docker-compose.couchdb.yml -f docker-compose.postgres.yml -f docker-compose.yml up -d
```

You can verify this command worked by running `docker ps`. It should show 6 containers running including Logstash, DBT, data generator, Postgres, CouchDB and Postgrest (note the `t` at the end!).

### Separate CouchDB instance
This setup involves starting Logstash, PostgreSQL, PostgREST, and DBT. It assumes you have a CouchDB instance running, and you updated the `.env` CouchDB variables accordingly.

Expand All @@ -72,12 +78,28 @@ Run the Docker containers locally and wait for every container to be up and runn
docker-compose -f docker-compose.postgres.yml -f docker-compose.yml up -d
```

You can verify this command worked by running `docker ps`. It should show 4 containers running including Logstash, DBT, Postgres, and Postgrest.

### Separate CouchDB and PostgreSQL instances
This local setup involves starting Logstash, PostgREST, and DBT. It assumes that CouchDB and PostgreSQL instances are run separately from the Docker Compose provided with CHT Sync, and the `.env` variables were updated to match those instances details.

Run the Docker containers locally and wait for every container to be up and running:
```sh
docker-compose -f docker-compose.postgrest.yml -f docker-compose.yml up -d logstash postgrest dbt
```

You can verify this command worked by running `docker ps`. It should show 3 containers running including Logstash, DBT, and Postgrest.

### Cleanup
When you are done using the services, you can clean everything by running `down`.

For example, in the scenario of the [Sample CouchDB data]({{< relref "#sample-couchdb-data" >}}), the command should look like:

```sh
docker compose -f docker-compose.couchdb.yml -f docker-compose.postgres.yml -f docker-compose.yml down
```

To remove all the data volumes, add `-v` at the end of this command.

## Setup Superset
To build data visualization dashboards, follow the [Superset instructions](https://superset.apache.org/docs/installation/installing-superset-using-docker-compose/) to run Superset and connect it to the PostgreSQL database.

0 comments on commit 18e21f1

Please sign in to comment.