Skip to content

Commit 92bb751

Browse files
authored
Merge pull request cfpb#1087 from hkeeler/readme-compose-lb
Update README w/ latest Compose details
2 parents 93ff201 + 17aeb5f commit 92bb751

File tree

1 file changed

+105
-32
lines changed

1 file changed

+105
-32
lines changed

README.md

Lines changed: 105 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -214,51 +214,124 @@ The Filing API will run on `$(docker-machine ip):8080`
214214
The Public API will run on `$(docker-machine ip):8082`
215215

216216
#### To run the entire platform
217-
Clone the [HMDA Platform UI](https://github.com/cfpb/hmda-platform-ui) repo and the [HMDA Platform Auth](https://github.com/cfpb/hmda-platform-auth) repo into sibling directories of this one. Your directory structure should look like this:
218-
```shell
219-
~/dev/hmda-project$ ls -la
220-
total 16
221-
drwxr-xr-x 6 lortone staff 204B Jul 25 17:44 ./
222-
drwxr-xr-x 9 lortone staff 306B Jul 25 17:50 ../
223-
drwxr-xr-x 22 lortone staff 748B Jul 27 16:28 hmda-platform/
224-
drwxr-xr-x 25 lortone staff 850B Jul 25 17:13 hmda-platform-ui/
225-
drwxr-xr-x 23 lortone staff 796B Jul 28 17:15 hmda-platform-auth/
226-
```
227217

228-
From the _`hmda-platform-ui`'s_ root directory, run `yarn`. (Get yarn [here](https://yarnpkg.com/lang/en/docs/install/) if you don't have it installed.)
218+
1. Dedicate appropriate resources to your Docker environment. We've found
219+
that for the full stack to run efficiently, you need approximately:
229220

230-
From _`hmda-platform`'s_ root directory, run the following:
221+
* 4 CPUs
222+
* 6 GB RAM
223+
* 80 GB Disk space
231224

232-
```shell
233-
sbt clean assembly
234-
docker-compose up
235-
```
225+
Assuming you are using Docker Machine to provision your Docker
226+
environment, you can check you current settings with the following
227+
(ignore the second `Memory`):
236228

237-
This will bring up all the HMDA Platform services. The first run may take several minutes.
229+
$ docker-machine inspect | grep 'CPU\|Memory\|DiskSize'
230+
"CPU": 4,
231+
"Memory": 6144,
232+
"DiskSize": 81920,
233+
"Memory": 0,
238234

239-
Next, find your docker machine's endpoint.
235+
If your settings are below these suggestions, you should create a new
236+
Docker VM. The following will create a VM named `hmda-platform` with
237+
the appropriate resources:
240238

241-
```shell
242-
# Typically defaults to 192.168.99.100, which will be used in the following examples
243-
docker-machine ip dev
244-
```
239+
$ docker-machine create \
240+
--driver virtualbox \
241+
--virtualbox-disk-size 81920 \
242+
--virtualbox-cpu-count 4 \
243+
--virtualbox-memory 6144 \
244+
hmda-platform
245+
246+
1. Clone [hmda-platform-ui](https://github.com/cfpb/hmda-platform-ui) and
247+
[hmda-platform-auth](https://github.com/cfpb/hmda-platform-auth) into the same
248+
directory as hmda-platform.
249+
250+
~/dev/hmda-project$ ls -l
251+
drwxr-xr-x 22 lortone staff 748B Jul 27 16:28 hmda-platform/
252+
drwxr-xr-x 25 lortone staff 850B Jul 25 17:13 hmda-platform-ui/
253+
drwxr-xr-x 23 lortone staff 796B Jul 28 17:15 hmda-platform-auth/
254+
255+
1. Build hmda-platform-ui
256+
257+
cd hmda-platform-ui && \
258+
yarn && \
259+
cd ..
260+
261+
**Note:** This requires [yarn](https://yarnpkg.com/lang/en/docs/install/) to be installed.
262+
263+
1. Build hmda-platform
264+
265+
cd hmda-platform && \
266+
sbt clean assembly
267+
268+
1. Launch the stack with Docker Compose
269+
270+
docker-compose up
271+
272+
This will bring up all the HMDA Platform services. The first run may take several minutes.
273+
274+
1. Discover your Docker host's IP
275+
276+
echo $DOCKER_HOST
277+
278+
...or if using Docker Machine...
279+
280+
docker-machine ip
281+
282+
**Note:** Docker Machine generally defaults to `192.168.99.100`. We reference that
283+
IP throught this doc. If your Docker host IP differs, please adjust these instructions
284+
to match the Docker host IP provided by your system.
285+
286+
1. Use it! Below are steps representing a standard HMDA filing:
287+
288+
1. Browse to the app at http://192.168.99.100.
289+
1. Select the "Login" button. This will redirect your browser to the Keycloak login screen.
290+
1. Select "create and account" on the login screen.
291+
1. Enter you account information and select "Register".
292+
293+
**Note:** You must register with an email address from our whitelist of email domains.
294+
For convenience, `bank0.com` and `bank1.com` address should be available automatically.
295+
296+
1. Browse to the mock email server at https://192.168.99.100:8443/mail/, and select the
297+
verification link in the email found there. This should take you back to the HMDA
298+
filing web app, now logged in.
299+
300+
**Note:** This "MailDev" services is for development purposes only. In the case of
301+
an actual HMDA filing, you would receive a confirmation to your actual email account.
302+
303+
1. Submit a HMDA filing. Several sample files can be found [here](https://github.com/cfpb/hmda-platform/tree/master/parser/jvm/src/test/resources/txt).
245304

246-
Then, visit the following URLS and click advanced -> proceed. This will bypass self-signed cert errors from your browser when running the app.
305+
##### Updating an existing system
247306

248-
- https://192.168.99.100:8443/
249-
- https://192.168.99.100:4443/
250-
- https://192.168.99.100:9443/
307+
If you've updated any of the hmda-platform services, and would like to see those
308+
changes reflected in the Docker Compose setup, the simplest way to do this is to
309+
rebuild everything from scratch. The following command should be executed from
310+
within the `hmda-platform` directory.
251311

252-
Visit the app at http://192.168.99.100, click the "Login" button, and click "Register" when redirected to the keycloak login screen.
312+
docker-compose stop -t0 && \
313+
docker-compose rm -vf && \
314+
cd ../hmda-platform-ui && \
315+
yarn && \
316+
cd ../hmda-platform && \
317+
sbt clean assembly && \
318+
docker-compose build --no-cache && \
319+
docker-compose up
253320

254-
To use demo data there are two institutions available; Bank 0 and Bank 1. To register for either of these institutions you have to use the corresponding domain:
255321

256-
- Bank 0 = bank0.com
257-
- Bank 1 = bank1.com
322+
##### Service URLs
258323

259-
Confirm your signup via MailDev by visiting http://192.168.99.100:1080, opening the email, and clicking the verifying link.
324+
When running the full stack via Docker Compose, the following services are available:
260325

261-
You can now interact with the app/begin uploading files, etc.
326+
| Service | URL |
327+
|------------------------|-------------------------------------|
328+
| Filing UI | https://192.168.99.100 |
329+
| Filing API (Unsecured) | http://192.168.99.100:8080 |
330+
| Filing API (Secured) | https://192.168.99.100:4443/hmda/ |
331+
| Admin API | http://192.168.99.100:8081 |
332+
| Public API | https://192.168.99.100:4443/public/ |
333+
| Keycloak | https://192.168.99.100:8443 |
334+
| MailDev | https://192.168.99.100:8443/mail/ |
262335

263336
#### Development conveniences
264337

0 commit comments

Comments
 (0)