generated from finos-labs/project-blueprint
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve developer experience when working with traderx and k8s (#232)
* Add optional builds * Update readme as per feedback
- Loading branch information
1 parent
6863fa3
commit e211bae
Showing
13 changed files
with
213 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
docker_build('traderx/database', './../../database/.') | ||
docker_build('traderx/account-service', './../../account-service/.') | ||
docker_build('traderx/people-service', './../../people-service/.') | ||
docker_build('traderx/position-service', './../../position-service/.') | ||
docker_build('traderx/reference-data', './../../reference-data/.') | ||
docker_build('traderx/trade-feed', './../../trade-feed/.') | ||
docker_build('traderx/trade-processor', './../../trade-processor/.') | ||
docker_build('traderx/trade-service', './../../trade-service/.') | ||
docker_build('traderx/web-front-end-angular', './../../web-front-end/angular/.') | ||
# Uncomment lines to use locally built version | ||
# docker_build('ghcr.io/finos/traderx/database', './../../database/.') | ||
# docker_build('ghcr.io/finos/traderx/account-service', './../../account-service/.') | ||
# docker_build('ghcr.io/finos/traderx/people-service', './../../people-service/.') | ||
# docker_build('ghcr.io/finos/traderx/position-service', './../../position-service/.') | ||
# docker_build('ghcr.io/finos/traderx/reference-data', './../../reference-data/.') | ||
# docker_build('ghcr.io/finos/traderx/trade-feed', './../../trade-feed/.') | ||
# docker_build('ghcr.io/finos/traderx/trade-processor', './../../trade-processor/.') | ||
# docker_build('ghcr.io/finos/traderx/trade-service', './../../trade-service/.') | ||
# docker_build('ghcr.io/finos/traderx/web-front-end-angular', './../../web-front-end/angular/.') | ||
yaml = kustomize(('./traderx')) | ||
print(yaml) | ||
k8s_yaml(yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...tion-service/src/main/java/finos/traderx/positionservice/controller/HealthController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package finos.traderx.positionservice.controller; | ||
|
||
import java.util.List; | ||
|
||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.CrossOrigin; | ||
import org.springframework.web.bind.annotation.ExceptionHandler; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import finos.traderx.positionservice.model.Position; | ||
import finos.traderx.positionservice.service.PositionService; | ||
|
||
@CrossOrigin("*") | ||
@RestController | ||
@RequestMapping(value="/health", produces="application/json") | ||
public class HealthController { | ||
|
||
@Autowired | ||
PositionService positionService; | ||
|
||
|
||
@GetMapping("/ready") | ||
public ResponseEntity isReady() { | ||
List<Position> retVal = this.positionService.getAllPositions(); | ||
return ResponseEntity.ok(retVal.size()>0); | ||
} | ||
|
||
@GetMapping("/alive") | ||
public ResponseEntity<Boolean> isAlive() { | ||
return ResponseEntity.ok(true); | ||
} | ||
|
||
|
||
@ExceptionHandler(Exception.class) | ||
public ResponseEntity<String> generalError(Exception e) { | ||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(e.getMessage()); | ||
} | ||
} |