You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+118-37
Original file line number
Diff line number
Diff line change
@@ -50,11 +50,23 @@ The project consists of multiple moving parts, and you can see how things hang t
50
50
|[trade-processor](trade-processor)| java/spring | Trade Feed consumer which processes trade/orders |
51
51
|[web-front-end](web-front-end)| html/angular or react | Interactive UI for executing trades and viewing blotter. Note: the AngularJS GUI was an initial contribution and contains account management capabilities. The React GUI was contributed during a hack day and may not work for managing accounts, but it does work for executing trades and viewing the blotter |
52
52
53
-
## Installation
53
+
## Check out Code
54
54
55
55
This is installed locally through normal git clone operations.
56
56
57
-
## Usage example (Manual)
57
+
```
58
+
git clone https://github.com/finos/traderX.git
59
+
```
60
+
61
+
## Run locally
62
+
63
+
There are a number of ways to run TraderX locally. You should choose the method you are most comfortable with.
64
+
-[Run locally manually](#run-locally-manually)
65
+
-[Run locally within a Corporate Environments](#run-locally-within-a-corporate-environments)
66
+
-[Run locally using Docker & Docker Compose](#run-locally-using-docker--docker-compose)
67
+
-[Run locally using Kubernetes](#run-locally-using-kubernetes)
68
+
69
+
## Run locally manually
58
70
59
71
In order to get things working together, it is recommended to select a range of ports to provide all running processes with, so that the pieces can interconnect as needed. To run this all up 'by hand' here are default ports which are used, and you can easily export these variables to your favorite shell.
60
72
@@ -87,31 +99,7 @@ trade-service
87
99
web-front-end
88
100
```
89
101
90
-
## Usage (Docker + Docker Compose)
91
-
92
-
The easiest way to run up the entire system is using Docker Compose. This should work on your local computer using Docker Desktop / Docker Compose (tested on Mac Silicon) and also in Github Codespaces.
93
-
94
-
### Codespaces
95
-
If using Github Codespaces it is recommended you select an 8-core type machine with 32GB RAM to ensure all the components have the required resources to start.
96
-
97
-
To do this
98
-
* Select the Green Code menu at the top of this page
99
-
* Select the Codespace tab then click the three dots '...' and select 'New with options...'.
100
-
* Change the machine type to '8-core' and click 'Create codespace'
101
-
102
-
As of writing, personal Github accounts receive 120 free core hours per month for using Codespaces, see the most recent details [here](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts)
103
-
104
-
Once you have cloned the repository locally or once your Codespace has started, from the root traderX directory run
105
-
```
106
-
docker compose up
107
-
```
108
-
On first run this will build all of the containers from the project specific Dockerfile's and then start them in the correct sequence.
109
-
110
-
The Docker containers are configured via Docker Compose to connect to a shred virtual network enabling them to communciate whether running on your local computer or via a Codespace.
111
-
112
-
Once everything has started the WebUI will be accessible at http://localhost:8080 (even if using a codespace, the localhost URL will be mapped through from your local browser to the Codespace).
113
-
114
-
## Local Building (Corporate Environments)
102
+
## Run locally within a Corporate Environments
115
103
116
104
When building locally in your company, if you are using a corporate artifact repository, you might need to override certain settings such as mavenCentral() in gradle, for the Java projects.
117
105
@@ -162,34 +150,127 @@ cd .corp
162
150
./gradlew account-service:bootRun
163
151
```
164
152
165
-
## Usage (K8s)
153
+
## Run locally using Docker & Docker Compose
154
+
155
+
The easiest way to run up the entire system is using Docker Compose. This should work on your local computer using Docker Desktop / Docker Compose (tested on Mac Silicon) and also in Github Codespaces.
166
156
167
-
The following are instructions to build and deploy all TraderX apps to your local enviroment using [tilt](https://tilt.dev) and kustomize files.
157
+
### Codespaces
158
+
If using Github Codespaces it is recommended you select an 8-core type machine with 32GB RAM to ensure all the components have the required resources to start.
168
159
169
-
## Prerequistes
170
-
- Running [Docker](https://www.docker.com/products/docker-desktop/) or similar
171
-
- Running K8s - [Kind](https://kind.sigs.k8s.io/) /[Minikube](https://minikube.sigs.k8s.io/docs/start/)/[k3s](https://k3s.io/) or similar
172
-
- Install an [Ingress Controller](https://kubernetes.github.io/ingress-nginx/deploy/)
160
+
To do this
161
+
* Select the Green Code menu at the top of this page
162
+
* Select the Codespace tab then click the three dots '...' and select 'New with options...'.
163
+
* Change the machine type to '8-core' and click 'Create codespace'
164
+
165
+
As of writing, personal Github accounts receive 120 free core hours per month for using Codespaces, see the most recent details [here](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts)
166
+
167
+
Once you have cloned the repository locally or once your Codespace has started, from the root traderX directory run
168
+
```
169
+
docker compose up
170
+
```
171
+
On first run this will build all of the containers from the project specific Dockerfile's and then start them in the correct sequence.
172
+
173
+
The Docker containers are configured via Docker Compose to connect to a shred virtual network enabling them to communciate whether running on your local computer or via a Codespace.
174
+
175
+
Once everything has started the WebUI will be accessible at http://localhost:8080 (even if using a codespace, the localhost URL will be mapped through from your local browser to the Codespace).
176
+
177
+
178
+
## Run locally using Kubernetes
179
+
180
+
Another easy way to run up the entire system is using Kubernetes (K8s), which using [tilt.dev](https://tilt.dev) also allows you to easily swap in locally built images. The following are instructions to deploy all TraderX apps to your local enviroment using [tilt.dev](https://tilt.dev) and kustomize files.
181
+
182
+
### Prerequistes
183
+
- Install and run [Docker](https://www.docker.com/products/docker-desktop/) or similar
184
+
- Install and run K8s - this could be one of the following well know distributions
185
+
-[K8s with Docker Desktop](https://docs.docker.com/desktop/kubernetes/)
This command will build and start all locally built applications and deploy them to your local K8s environment.
217
+
This command will deploy all the services to your local K8s environment.
218
+
Note: Ensure all the [pre-requistes](#prerequistes) are complete
187
219
220
+
After cloning the repo, you should `cd` into the folder (`cd traderx`)
188
221
```
222
+
# cd into gitops repo
189
223
cd ./gitops/local/
224
+
225
+
# Start Tilt
190
226
tilt up
191
227
```
192
228
229
+
Expected Console Output:
230
+
```
231
+
Tilt started on http://localhost:10350/
232
+
v0.30.2, built 2022-06-06
233
+
234
+
(space) to open the browser
235
+
(s) to stream logs (--stream=true)
236
+
(t) to open legacy terminal mode (--legacy=true)
237
+
(ctrl-c) to exit
238
+
```
239
+
240
+
This will download all the images and start them in your local k8s cluster.
241
+
242
+
Launching the tilt.dev local webpage will allow you to monitor the progress by pressing the space bar. Or use one of the other options from the console.
243
+
244
+
Note: if you run `tilt up` and you get an error stating `template engine not found for: up.`. Your OS might be trying to run a ruby library, please check the tilt.dev installation instructions, or you path settings.
245
+
246
+
247
+
### Start Tilt.dev
248
+
249
+
### Local Developement
250
+
251
+
With all the services running you can then chose which ones you actively build locally.
252
+
253
+
If you go to your local [Tiltfile](./gitops/local/Tiltfile) you simply need to uncomment all the lines, or just for the respective applicaiton that you want to work on. Those applications will be built locally and deployed to your cluster instead of the host images. For example. In your local [Tiltfile](./gitops/local/Tiltfile) uncommenting the line for position_service will ask that Tilt.dev builds the images and your locally built image is deployed in your local k8s cluster in place of the prebuilt image from the Github Container Registry.
0 commit comments