Skip to content

Commit b7d2b6f

Browse files
authored
Merge pull request #225 from raphaelrpl/reuse-cube
Review usage/setup docs
2 parents 627f659 + 7f19e4a commit b7d2b6f

File tree

15 files changed

+420
-229
lines changed

15 files changed

+420
-229
lines changed

CHANGES.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010
Changes
1111
=======
1212

13-
Version 0.8.1 (2022-09-13)
13+
Version 0.8.1 (2022-09-14)
1414
--------------------------
1515

16-
- Fix search images using temporal dimension `#221 <https://github.com/brazil-data-cube/cube-builder/issues/221> `_.
16+
- Fix search images using temporal dimension `#221 <https://github.com/brazil-data-cube/cube-builder/issues/221>`_.
1717
- Add way to retrieve total items per tile
18+
- Improve Usage/Setup documentation `#164 <https://github.com/brazil-data-cube/cube-builder/issues/164>`_.
1819

1920

2021
Version 0.8.0 (2022-05-05)

DEPLOY.rst

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,22 +17,51 @@ If you do not have Docker installed, take a look at `this tutorial on how to ins
1717
See also the `tutorial on how to install Docker Compose <https://docs.docker.com/compose/install/>`_.
1818

1919

20+
Compatibility
21+
-------------
22+
23+
Before deploy/install ``Cube-Builder``, please, take a look into compatibility table:
24+
25+
+--------------+-------------+
26+
| Cube-Builder | BDC-Catalog |
27+
+==============+=============+
28+
| 0.8.x | 0.8.2 |
29+
+--------------+-------------+
30+
| 0.4.x, 0.6.x | 0.8.1 |
31+
+--------------+-------------+
32+
| 0.2.x | 0.2.x |
33+
+--------------+-------------+
34+
35+
2036
Configuration
2137
-------------
2238

23-
docker-compose.yml
24-
~~~~~~~~~~~~~~~~~~
39+
Before proceed to the ``DEPLOY`` step, we have prepared a minimal ``docker-compose.yml`` file
40+
with config to launch ``Cube-Builder``.
41+
By default, it will generate data cubes in directories ``./volumes/data`` and ``./volumes/workdir``, respectively.
42+
You may set a different location editing the ``docker-compose.yml`` file. Please refer to the page :doc:`configuration`
43+
for further details.
2544

26-
Open and edit **docker-compose.yml** with the following variables:
45+
.. note::
2746

28-
1. **DATA_DIR** - Path to store collections.
29-
2. **SQLALCHEMY_DATABASE_URI** - Database URI.
30-
3. **RABBIT_MQ_URL** - URI to connect on RabbitMQ protocol.
47+
Take a look into ``docker-compose.yml`` the variables ``DATA_DIR`` and ``WORK_DIR``
48+
and make sure you have enough space in disk for data cubes.
3149

3250

3351
Running the Docker Containers
3452
-----------------------------
3553

54+
.. note::
55+
56+
Make sure you have a machine with at least the following requirements:
57+
58+
- 4 vCPU or more
59+
- 8 GB RAM
60+
- 40 GB free space
61+
62+
It may change according the type/volume size of collections used to generate data cube.
63+
64+
3665
.. note::
3766

3867
If you do not have a PostgreSQL instance with the Brazil Data Cube data model up and running, you will need to prepare one before following the rest of this documentation.
@@ -99,14 +128,13 @@ If the above command runs successfully, you will be able to list the launched co
99128
100129
.. note::
101130

102-
Refer to the `USING.rst <USING.rst>`_ documentation in order to use the cube builder services.
131+
Refer to the page :doc:`usage` documentation in order to use the cube builder services.
103132

104133

105134
.. rubric:: Footnotes
106135

107136
.. [#f1]
108137
109-
| For now you will need to login into the BDC registry:
138+
| By default, the docker compose will try to build a new Docker image
139+
| If you have account in the BDC registry, you may use as following:
110140
| ``$ docker login registry.dpi.inpe.br``
111-
|
112-
| In the next releases we will get ride of this internal registry.

INSTALL.rst

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ The ``Cube Builder`` depends essentially on:
3030
- `Brazil Data Cube Catalog Module <https://github.com/brazil-data-cube/bdc-catalog.git>`_
3131

3232

33+
Compatibility
34+
-------------
35+
36+
+--------------+-------------+
37+
| Cube-Builder | BDC-Catalog |
38+
+==============+=============+
39+
| 0.8.x | 0.8.2 |
40+
+--------------+-------------+
41+
| 0.4.x, 0.6.x | 0.8.1 |
42+
+--------------+-------------+
43+
| 0.2.x | 0.2.x |
44+
+--------------+-------------+
45+
3346
Development Installation
3447
------------------------
3548

@@ -102,10 +115,15 @@ The ``Cube Builder`` uses `BDC-DB <https://github.com/brazil-data-cube/bdc-db/>`
102115

103116
If you already have a database instance with the Brazil Data Cube data model, you can skip this section.
104117

118+
In order to proceed with installation, you will need ``PostgreSQL with PostGIS``. We have already prepared a minimal
119+
instance in ``docker-compose.yml``. You may use it as following::
120+
121+
docker-compose up -d postgres
122+
105123

106124
We have prepared a script to configure the database model::
107125

108-
SQLALCHEMY_DATABASE_URI="postgresql://postgres:password@host:port/bdc" ./deploy/configure-db.sh
126+
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" ./deploy/configure-db.sh
109127

110128

111129

@@ -115,19 +133,22 @@ Launch the ``Cube Builder`` service
115133

116134
In the source code folder, enter the following command::
117135

118-
$ FLASK_ENV="development" \
119-
DATA_DIR="/data" \
120-
SQLALCHEMY_DATABASE_URI="postgresql://postgres:password@host:port/bdc" \
121-
cube-builder run
136+
FLASK_ENV="development" \
137+
WORK_DIR="/workdir" \
138+
DATA_DIR="/data" \
139+
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
140+
cube-builder run
122141

123142

124143
You may need to replace the definition of some environment variables:
125144

126145
- ``FLASK_ENV="development"``: used to tell Flask to run in ``Debug`` mode.
127146

147+
- ``WORK_DIR="/workdir"``: set path to store temporary cubes/processing.
148+
128149
- ``DATA_DIR="/data"``: set path to store data cubes
129150

130-
- ``SQLALCHEMY_DATABASE_URI="postgresql://postgres:password@host:port/bdc"``: set the database URI connection for PostgreSQL.
151+
- ``SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc"``: set the database URI connection for PostgreSQL.
131152

132153

133154
The above command should output some messages in the console as showed below::
@@ -146,8 +167,9 @@ Launch the ``Cube Builder`` worker
146167

147168
Enter the following command to start ``Cube Builder`` worker::
148169

170+
WORK_DIR="/workdir" \
149171
DATA_DIR="/data" \
150-
SQLALCHEMY_DATABASE_URI="postgresql://postgres:password@host:port/bdc" \
172+
SQLALCHEMY_DATABASE_URI="postgresql://postgres:postgres@localhost/bdc" \
151173
cube-builder worker -l INFO --concurrency 8 -Q default,merge-cube,prepare-cube,blend-cube,publish-cube
152174

153175

@@ -161,12 +183,15 @@ You may need to replace the definition of some parameters:
161183

162184
.. note::
163185

164-
The command line ``cube-builder worker`` is an auxiliary tool that wraps celery command line using ``cube_builder`` as context. In this way, all ``celery worker`` parameters are currently supported. See more in `Celery Workers Guide <https://docs.celeryproject.org/en/stable/userguide/workers.html>`_.
186+
The command line ``cube-builder worker`` is an auxiliary tool that wraps celery command line
187+
using ``cube_builder`` as context. In this way, all ``celery worker`` parameters are currently supported.
188+
See more in `Celery Workers Guide <https://docs.celeryproject.org/en/stable/userguide/workers.html>`_.
165189

166190

167191
.. warning::
168192

169-
The ``Cube Builder`` can use a lot of memory for each concurrent process, since it opens multiple images in memory. You can limit the concurrent processes in order to prevent it.
193+
The ``Cube Builder`` can use a lot of memory for each concurrent process, since it opens multiple images in memory.
194+
You can limit the concurrent processes in order to prevent it.
170195

171196

172197
.. rubric:: Footnotes

0 commit comments

Comments
 (0)