Skip to content

Commit

Permalink
Merge pull request #204 from willtsai/deploy-with-radius
Browse files Browse the repository at this point in the history
Add radius app definition file
  • Loading branch information
maoo authored Sep 28, 2024
2 parents 291aa3d + 8f86559 commit f1d1d40
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 0 deletions.
2 changes: 2 additions & 0 deletions radius-traderx/.rad/rad.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
workspace:
application: "radius-traderx"
34 changes: 34 additions & 0 deletions radius-traderx/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Deploy TraderX Using Radius

Radius can be used to deploy and run the [TraderX](https://github.com/finos/traderX) application.

## Prerequisites

- Install and set up [Radius](https://docs.radapp.io/getting-started/) and local Kubernetes cluster
- Optionally set up an [Azure](https://docs.radapp.io/providers/azure/) or [AWS](https://docs.radapp.io/providers/aws/) provider and environment in Radius

## Instructions

To deploy the TraderX app using Radius, you can run the commands directly in this directory.

First, initialize Radius:
```bash
rad init
```

>Select `Yes` when prompted to setup an application in the current directory
To deploy and run the app in your local environment:
```bash
rad run traderx.bicep
```

If you have an Azure environment set up, you can deploy the app there as well (in this example the Azure environment is associated with the `prod-azure` workspace):
```bash
rad deploy traderx.bicep -w prod-azure
```

If you have an AWS environment set up, you can deploy the app there as well (in this example the AWS environment is associated with the `prod-aws` workspace):
```bash
rad deploy traderx.bicep -w prod-aws
```
280 changes: 280 additions & 0 deletions radius-traderx/app.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
extension radius

// Parameters
param application string

resource database 'Applications.Core/containers@2023-10-01-preview' = {
name: 'database'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/database:latest'
ports: {
tcp: {
containerPort: 18082
}
pg:{
containerPort: 18083
}
web: {
containerPort: 18084
}
}
}
}
}

resource referencedata 'Applications.Core/containers@2023-10-01-preview' = {
name: 'reference-data'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/reference-data:latest'
ports: {
web: {
containerPort: 18085
}
}
}
}
}

resource tradefeed 'Applications.Core/containers@2023-10-01-preview' = {
name: 'trade-feed'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/trade-feed:latest'
ports: {
web: {
containerPort: 18086
}
}
}
}
}

resource peopleservice 'Applications.Core/containers@2023-10-01-preview' = {
name: 'people-service'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/people-service:latest'
ports: {
web: {
containerPort: 18089
}
}
}
}
}

resource accountservice 'Applications.Core/containers@2023-10-01-preview' = {
name: 'account-service'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/account-service:latest'
ports: {
web: {
containerPort: 18088
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
PEOPLE_SERVICE_HOST: {
value: peopleservice.name
}
}
}
connections: {
peopleservice: {
source: peopleservice.id
}
db: {
source: database.id
}
}
}
}

resource positionservice 'Applications.Core/containers@2023-10-01-preview' = {
name: 'position-service'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/position-service:latest'
ports: {
web: {
containerPort: 18090
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
}
}
connections: {
db: {
source: database.id
}
}
}
}

resource tradeservice 'Applications.Core/containers@2023-10-01-preview' = {
name: 'trade-service'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/trade-service:latest'
ports: {
web: {
containerPort: 18092
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
PEOPLE_SERVICE_HOST: {
value: peopleservice.name
}
ACCOUNT_SERVICE_HOST: {
value: accountservice.name
}
REFERENCE_DATA_HOST: {
value: referencedata.name
}
TRADE_FEED_HOST: {
value: tradefeed.name
}
}
}
connections: {
db: {
source: database.id
}
peopleservice: {
source: peopleservice.id
}
accountservice: {
source: accountservice.id
}
referencedata: {
source: referencedata.id
}
tradefeed: {
source: tradefeed.id
}
}
}
}

resource tradeprocessor 'Applications.Core/containers@2023-10-01-preview' = {
name: 'trade-processor'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/trade-processor:latest'
ports: {
web: {
containerPort: 18091
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
TRADE_FEED_HOST: {
value: tradefeed.name
}
}
}
connections: {
db: {
source: database.id
}
tradefeed: {
source: tradefeed.id
}
}
}
}

resource webfrontend 'Applications.Core/containers@2023-10-01-preview' = {
name: 'web-front-end-angular'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/web-front-end-angular:latest'
ports: {
web: {
containerPort: 18093
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
}
}
connections: {
db: {
source: database.id
}
tradefeed: {
source: tradefeed.id
}
}
}
}

resource ingress 'Applications.Core/containers@2023-10-01-preview' = {
name: 'ingress'
properties: {
application: application
container: {
image: 'ghcr.io/finos/traderx/ingress:latest'
ports: {
web: {
containerPort: 8080
}
}
env: {
DATABASE_TCP_HOST: {
value: database.name
}
}
}
connections: {
db: {
source: database.id
}
tradefeed: {
source: tradefeed.id
}
peopleservice: {
source: peopleservice.id
}
accountservice: {
source: accountservice.id
}
positionservice: {
source: positionservice.id
}
tradeservice: {
source: tradeservice.id
}
tradeprocessor: {
source: tradeprocessor.id
}
webfrontend: {
source: webfrontend.id
}
}
}
}
11 changes: 11 additions & 0 deletions radius-traderx/bicepconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"experimentalFeaturesEnabled": {
"extensibility": true,
"extensionRegistry": true,
"dynamicTypeLoading": true
},
"extensions": {
"radius": "br:biceptypes.azurecr.io/radius:0.38",
"aws": "br:biceptypes.azurecr.io/aws:0.38"
}
}

0 comments on commit f1d1d40

Please sign in to comment.