Skip to content

Commit 7a806d4

Browse files
committed
docs: added pecularities of v5 local setup
1 parent 522ff4a commit 7a806d4

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

README.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,28 +86,32 @@ Microservice to manage CRUD operations for all things Projects.
8686
The project service will be served on `http://localhost:8001`.
8787

8888
### Import sample metadata & projects
89+
8990
```bash
9091
CONNECT_USER_TOKEN=<connect user token> npm run demo-data
9192
```
92-
This command will create sample metadata entries in the DB (duplicate what is currently in development environment).
93+
To retrieve data from DEV env we have to provide a valid user token (`CONNECT_USER_TOKEN`). You may login to http://connect.topcoder-dev.com and find the Bearer token in the request headers using browser dev tools.
9394

94-
To retrieve data from DEV env we need to provide a valid user token. You may login to http://connect.topcoder-dev.com and find the Bearer token in the request headers using browser dev tools.
95+
This command for importing data uses API to create demo data. Which has a few pecularities:
96+
- data in DB would be for sure created
97+
- data in ElasticSearch Index (ES) would be only created if services [project-processor-es](https://github.com/topcoder-platform/project-processor-es) and [tc-bus-api](https://github.com/topcoder-platform/tc-bus-api) are also started locally. If you don't start them, then imported data wouldn't be indexed in ES, and would be only added to DB. You may start them locally separately, or better use `local/full/docker-compose.yml` as described [next section](#local-deployment-with-other-topcoder-services) which would start them automatically.
98+
- **NOTE** During data importing a lot of records has to be indexed in ES, so you have to wait about 5-10 minutes after `npm run demo-data` is finished until imported data is indexed in ES. You may watch logs of `project-processor-es` to see if its done or no.
9599

96100
### Local Deployment with other Topcoder Services.
97101

98102
* There exists an alternate `docker-compose.yml` file that can be used to spawn containers for the following services:
99103

100-
| Service | Name | Port |
101-
|----------|:-----:|:----:|
102-
| PostGreSQL DB | db | 5432 |
103-
| ElasticSearch | esearch | 9200,9300 |
104-
| RabbitMQ | queue | 5672, 15672 |
105-
| Zookeeper | zookeeper | 2181 |
106-
| Kafka | kafka | 9092 |
107-
| [tc-bus-api](https://github.com/topcoder-platform/tc-bus-api) | tc-bus-api | 8002 |
108-
| [project-processor-es](https://github.com/topcoder-platform/project-processor-es) | project-processor-es | 5000 |
109-
| [tc-notifications-api](https://github.com/topcoder-platform/tc-notifications) | tc-notifications-api | 4000 |
110-
| [tc-notifications-processor](https://github.com/topcoder-platform/tc-notifications) | tc-notifications-processor | 4001 |
104+
| Service | Name | Port |
105+
|----------|:-----:|:----:|
106+
| PostGreSQL DB | db | 5432 |
107+
| ElasticSearch | esearch | 9200,9300 |
108+
| RabbitMQ | queue | 5672, 15672 |
109+
| Zookeeper | zookeeper | 2181 |
110+
| Kafka | kafka | 9092 |
111+
| [tc-bus-api](https://github.com/topcoder-platform/tc-bus-api) | tc-bus-api | 8002 |
112+
| [project-processor-es](https://github.com/topcoder-platform/project-processor-es) | project-processor-es | 5000 |
113+
| [tc-notifications-api](https://github.com/topcoder-platform/tc-notifications) | tc-notifications-api | 4000 |
114+
| [tc-notifications-processor](https://github.com/topcoder-platform/tc-notifications) | tc-notifications-processor | 4001 |
111115

112116
* To have kafka create a list of desired topics on startup, there exists a file with the path `local/full/kafka-client/topics.txt`. Each line from the file will be added as a topic.
113117
* To run these services simply run the following commands:
@@ -134,6 +138,15 @@ To retrieve data from DEV env we need to provide a valid user token. You may log
134138

135139
* The containers have been configured such that all Topcoder services will wait until all the topics listed in `local/full/kafka-client/topics.txt` have been created. To monitor the progress of topic creation, you can view the logs of the `kafka-client` service, which will exit when all topics have been created.
136140

141+
* **WARNING**<br>
142+
After all the containers are started, make sure that `project-processor-es` service started successfully, as sometimes it doesn't start successfully as Kafka wasn't yet properly started at that moment. So run `docker-compose logs -f project-processor-es` to see its logs, you should see 3 lines with text `Subscribed to project.action.` like:
143+
```
144+
project-processor-es_1 | 2019-12-18T11:10:12.849Z DEBUG no-kafka-client Subscribed to project.action.update:0 offset 0 leader 96e65c46c746:9092
145+
project-processor-es_1 | 2019-12-18T11:10:12.851Z DEBUG no-kafka-client Subscribed to project.action.delete:0 offset 0 leader 96e65c46c746:9092
146+
project-processor-es_1 | 2019-12-18T11:10:12.852Z DEBUG no-kafka-client Subscribed to project.action.create:0 offset 0 leader 96e65c46c746:9092
147+
```
148+
If you don't see such lines, restart `project-processor-es` service ONLY by running `docker-compose restart project-processor-es`.
149+
137150
### Run Connect App with Project Service locally
138151

139152
To be able to run [Connect App](https://github.com/appirio-tech/connect-app) with the local setup of Project Service we have to do two things:

0 commit comments

Comments
 (0)