|
| 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 | + |
0 commit comments