Skip to content

Commit 4291a27

Browse files
refactor: streamline installation and setup instructions in README.md
1 parent 29cc3cd commit 4291a27

File tree

1 file changed

+16
-146
lines changed

1 file changed

+16
-146
lines changed

backend/README.md

Lines changed: 16 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -8,136 +8,16 @@ This project was bootstrapped with [Geodjango Template](https://github.com/itsks
88

99
**Note:** Depending upon your OS and Env installation will vary, This project tightly depends on [Tensorflow](https://www.tensorflow.org/install/pip) with GPU support so accordingly build your development environment
1010

11-
### Install Python3, pip and virtualenv first
12-
13-
##### Skip this, step if you already have one
14-
15-
sudo apt-get install python3
16-
sudo apt-get install -y python3-pip
17-
sudo apt install python3-virtualenv
18-
19-
##### Create your virtual env
20-
21-
virtualenv env
22-
source ./env/bin/activate
23-
24-
##### Setup Basemodels (Ramp Supported Currently)
25-
26-
- Install git lfs
11+
### Install UV
2712

2813
```bash
29-
sudo apt-get install git-lfs
30-
```
31-
32-
- Clone Ramp Basemodel
33-
34-
```
35-
git clone https://github.com/radiantearth/model_ramp_baseline.git
36-
```
37-
38-
- Clone Ramp - Code
39-
Note: This clone location will be your RAMP_HOME
40-
41-
```
42-
git clone https://github.com/kshitijrajsharma/ramp-code-fAIr.git ramp-code
43-
```
44-
45-
- Copy Basemodel checkpoint to ramp-code
46-
47-
```
48-
cp -r model_ramp_baseline/data/input/checkpoint.tf ramp-code/ramp/checkpoint.tf
49-
```
50-
51-
- Remove basemodel repo we don't need it anymore
52-
53-
```
54-
rm -rf model_ramp_baseline
55-
```
56-
57-
- Install numpy
58-
Numpy needs to be installed before gdal
59-
60-
```
61-
pip install numpy==1.23.5
62-
```
63-
64-
- Install gdal and rasetrio
65-
Based on your env : You can either use conda / setup manually on your os
66-
for eg on ubuntu :
67-
68-
```
69-
sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
70-
sudo apt-get install gdal-bin
71-
sudo apt-get install libgdal-dev
72-
export CPLUS_INCLUDE_PATH=/usr/include/gdal
73-
export C_INCLUDE_PATH=/usr/include/gdal
74-
pip install --global-option=build_ext --global-option="-I/usr/include/gdal" GDAL==`gdal-config --version`
75-
```
76-
77-
- Install Ramp - Dependecies
78-
79-
```
80-
cd ramp-code && cd colab && make install
81-
```
82-
83-
- For Conda users : You may need to install rtree, gdal , rasterio & imagecodecs separately
84-
85-
```
86-
conda install -c conda-forge rtree
87-
conda install -c conda-forge gdal
88-
conda install -c conda-forge rasterio
89-
conda install -c conda-forge imagecodecs
14+
curl -LsSf https://astral.sh/uv/install.sh | sh
9015
```
9116

92-
##### Install necessary libraries for fAIr
17+
### Sync proj
9318

94-
- Install Tensorflow from [here] (https://www.tensorflow.org/install/pip) According to your os (Tested Versions : 2.9.2, 2.8.0)
95-
96-
- Upgrade your setuptools before installing fair-utilities
97-
98-
```
99-
pip install --upgrade setuptools
100-
```
101-
102-
- Install fAIr Utilities
103-
104-
```
105-
pip install hot-fair-utilities==1.0.41
106-
```
107-
108-
**Remember In order to run fAIr , You need to configure your PC with tensorflow - GPU Support**
109-
110-
You can check your GPU by :
111-
112-
```
113-
import tensorflow as tf
114-
print("Num GPUs Available: ", len(tf.config.experimental.list_physical_devices('GPU')))
115-
```
116-
117-
- Install psycopg2
118-
Again based on your os/env you can do manual installation
119-
for eg : on ubuntu :
120-
121-
```
122-
sudo apt-get install python3-psycopg2
123-
```
124-
125-
- Install redis server on your pc
126-
127-
```
128-
sudo apt install redis
129-
```
130-
131-
- Install pdm for dependency management
132-
133-
```
134-
pip install pdm
135-
```
136-
137-
- Finally install project dependencies
138-
139-
```
140-
pdm install
19+
```bash
20+
uv sync
14121
```
14222

14323
### Make sure you have postgresql installed with postgis extension enabled
@@ -155,9 +35,9 @@ pdm install
15535

15636
#### Now change your username, password and db name in settings.py accordingly to your database
15737

158-
python manage.py makemigrations login core
159-
python manage.py migrate
160-
python manage.py runserver
38+
uv run python manage.py makemigrations login core
39+
uv run python manage.py migrate
40+
uv run python manage.py runserver
16141

16242
### Now server will be available in your 8000 port on web, you can check out your localhost:8000/admin for admin panel
16343

@@ -179,40 +59,30 @@ fAIr uses oauth2.0 Authentication using [osm-login-python](https://github.com/ks
17959

18060
## Start celery workers
18161

182-
- Start celery workers
62+
- Sync workers env
18363

184-
```
185-
celery -A fairproject worker --loglevel=debug -n my_worker -Q ramp_training,yolo_training
64+
```bash
65+
uv sync --group base-workers
18666
```
18767

188-
- Monitor using flower
189-
if you are using redis as result backend, api supports both options django / redis
190-
You can start flower to start monitoring your tasks
68+
- Start celery workers
19169

19270
```
193-
celery -A fairproject --broker=redis://127.0.0.1:6379/0 flower
71+
uv run celery -A fairproject worker --loglevel=debug -n my_worker -Q ramp_training,yolo_training
19472
```
19573

19674
## Start background tasks
19775

19876
```bash
199-
python manage.py qcluster
77+
uv run python manage.py qcluster
20078
```
20179

20280
## Run Tests
20381

20482
```
205-
python manage.py test
83+
uv run python manage.py test
20684
```
20785

20886
# Build fAIr with Docker for Development
20987

210-
- Install all the required drivers for your graphics to access it from containers, and check your graphics and drivers with `nvidia-smi` . Up to now only nvidia is Supported
211-
- Follow docker_sample_env to create `.env` file in your dir
212-
- Build the Image
213-
214-
```
215-
docker-compose up -d --build
216-
```
217-
218-
- Once the image is build, Open the API container terminal and run the migrations
88+
Follow docker setup instructions [../SETUP.md](../SETUP.md)

0 commit comments

Comments
 (0)