Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit 0b3d7b8

Browse files
authored
Merge pull request #44 from topcoder-platform/add_README_doc
add README docs
2 parents 386b2ba + e567b76 commit 0b3d7b8

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# # Topcoder - Elastic Feeder service
2+
3+
## Prerequisites
4+
- Java 8 with Maven 3
5+
- Docker and Docker Compose
6+
- Git
7+
8+
## Environment Setup
9+
Clone the repository using the below command.
10+
```
11+
git clone https://github.com/topcoder-platform/tc-elasticsearch-feeder-service.git
12+
```
13+
14+
# Dependent Services
15+
The elastic search feeder service depends upon services defined in https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app.
16+
17+
Notes, You need to add the following entry to hosts file:
18+
```
19+
<docker-box-ip> cockpit.cloud.topcoder.com
20+
21+
```
22+
Where `<docker-box-ip>` is the ip address of your docker box. It's 192.168.99.100 for my Windows and Mac docker box, and it should be 127.0.0.1 for linux docker box.
23+
24+
* If you just need to start the dependent services, you can run
25+
26+
```
27+
docker-compose up -d tc-cache tc-informix elasticsearch
28+
```
29+
30+
* If you want to use direct app to create challenges for local testing, you can run
31+
```
32+
docker-compose up -d tc-direct elasticsearch
33+
```
34+
35+
Please verify the services are properly running like
36+
37+
```
38+
docker ps
39+
```
40+
41+
the related containers should be in running status.
42+
43+
# Build and Run the service
44+
## Build And Package:
45+
46+
```
47+
mvn clean compile package
48+
```
49+
50+
Move to the 'local' then start the service using the following command. Make sure that `DOCKER_IP` environment variable is set to the docker box ip.
51+
52+
```
53+
./run.sh
54+
```
55+
56+
## Verification
57+
58+
If the maven build process was successful.
59+
60+
Create an new challenge using the direct-app.
61+
Then you can use the Postman collections elasticFeederVerification.postman_collection.json which is `docs/` directory to test with the APIs. Please make sure to update the challenge ids and service URL and elastic cluster IP in the postman collection.
62+
63+
Refer to the Swagger docs for API spec: https://github.com/topcoder-platform/tc-elasticsearch-feeder-service/blob/dev/swagger.yaml
64+

local/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ export TC_JWT_KEY="secret"
55
# export AWS_ACCESS_KEY=your key
66
# export AWS_SECRET_KEY=your secret
77

8+
export DOCKER_IP=127.0.0.1
89
export REDISSON_JOB_CLUSTER_ENABLED=false
910
export REDISSON_JOB_FORCE_INITIAL_LOAD=true
11+
export ELASTIC_SEARCH_URL="http://$DOCKER_IP:9200"
1012

1113
java -jar ../target/elasticsearch-feeder-service-*.jar server ../src/main/resources/elasticsearch-feeder-service.yaml

0 commit comments

Comments
 (0)