Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Removes local installation instruction and includes it to local docs
  • Loading branch information
kshitijrajsharma authored Feb 22, 2024
1 parent b5511ce commit e16b80c
Showing 1 changed file with 1 addition and 114 deletions.
115 changes: 1 addition & 114 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,126 +42,13 @@ Raw Data API consists of two elements:
Raw Data API can be installed through `docker` or locally on your computer.

- To install with docker see [docker installation](./docs/src/installation/docker.md).
- To install locally, continue below.

NOTE: The installation guide below is only tested to work on Ubuntu, we recommend using docker for other operating systems.

### Local Installation Requirements.

- Install [GDAL](https://gdal.org/index.html) on your computer using the command below:

```
sudo apt-get update && \
sudo apt-get -y install gdal-bin python3-gdal && \
sudo apt-get -y autoremove && \
sudo apt-get clean
```

- Install [redis](https://redis.io/docs/getting-started/installation/) on your computer using the command below:

```
sudo apt-get -y install redis
sudo apt-get -y install redis-tools # For client
```

- Confirm Redis Installation

```
redis-cli
```

Type `ping` it should return `pong`.

If _redis_ is not running check out its [documentation](https://redis.io/docs/getting-started/)

- Clone the Raw Data API repository on your computer

```
git clone https://github.com/hotosm/raw-data-api.git
```

- Navigate to the repository directory

```
cd raw-data-api
```

- Install the python dependencies

```
pip install -r requirements.txt
```
- To install locally, see [local installation](./docs/src/installation/local.md).

## Configurations

Setup the necessary configurations for Raw Data API from [configurations](./docs/src/installation/configurations.md).

Setup config.txt in project root or include your env variables in ```.env```

### Optional : For Tiles Output
If you opt for tiles output and have ```ENABLE_TILES : True``` in env variable . Make sure you install [Tippecanoe] (https://github.com/felt/tippecanoe)

### Start the Server

```
uvicorn API.main:app --reload
```

### Queues

Currently there are two type of queue implemented :
- "raw_daemon" : Queue for recurring exports which will replace the previous exports if present on the system , can be enabled through uuid:false API Param
- "raw_ondemand" : Queue for default exports which will create each unique id for exports

### Start Celery Worker

You should be able to start [celery](https://docs.celeryq.dev/en/stable/getting-started/first-steps-with-celery.html#running-the-celery-worker-server) worker by running following command on different shell

- Start for default queue
```
celery --app API.api_worker worker --loglevel=INFO --queues="raw_ondemand" -n 'default_worker'
```
- Start for recurring queue
```
celery --app API.api_worker worker --loglevel=INFO --queues="raw_daemon" -n 'recurring_worker'
```

Set no of request that a worker can take at a time by using --concurrency

#### Note
`If you are using postgres database as result_backend for celery you need to install sqlalchemy`
```bash
pip install SQLAlchemy==2.0.25
```
### Start flower for monitoring queue [OPTIONAL]

Raw Data API uses flower for monitoring the Celery distributed queue. Run this command on a different shell , if you are running redis on same machine your broker could be `redis://localhost:6379//`.

```
celery --broker=redis://redis:6379// --app API.api_worker flower --port=5000 --queues="raw_daemon,raw_ondemand"
```

OR Simply use flower from application itself

```bash
celery --broker=redis://localhost:6379// flower
```

### Navigate to the docs to view Raw Data API endpoints

After sucessfully starting the server, visit [http://127.0.0.1:8000/v1/docs](http://127.0.0.1:8000/v1/docs) on your browser to view the API docs.

```
http://127.0.0.1:8000/v1/docs
```

Flower dashboard should be available on port `5000` on your localhost.

```
http://127.0.0.1:5000/
```

## Basic Usage

- Confirm that Authetication works
Expand Down

0 comments on commit e16b80c

Please sign in to comment.