Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kdid committed Oct 13, 2023
1 parent 5ddb2d1 commit e5120ab
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,33 @@ npm run dev

Access the app in a browser at: https://USER_PREFIX.dev.rdc.library.northwestern.edu:3003/

## Running the API locally with State Machine + lambdas (needed for AV download route)

From the `dc-api-v2` root directory:

- Make sure you've done an `npm install` recently to update any packages in the `lambdas` directory
- Run `bin/startwi`

```shell
# From the repo root
cd dc-api-v2

# Start the proxy (if needed)
https-proxy start 3002 3000

# Login as the staging-admin user
export AWS_PROFILE=staging-admin
aws sso login

# Start the API + step function and associated lambdas
bin/start-with-step

# Open a second terminal and create the state machine
aws stepfunctions create-state-machine --endpoint http://localhost:8083 --definition file://state_machines/av_download.json --name "hlsStitcherStepFunction" --role-arn arn:aws:iam::012345678901:role/DummyRole
```



## Deploying the API manually

- Symlink the `*.parameters` file you need from `tfvars/dc-api/` to the application root
Expand Down
4 changes: 2 additions & 2 deletions bin/start-with-step
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

sam local start-lambda --host 0.0.0.0 --port 3003 --env-vars env.json --log-file lambda.log & lambda_pid=$!
sam local start-lambda --host 0.0.0.0 --port 3005 --env-vars env.json --log-file lambda.log & lambda_pid=$!
sam local start-api --host 0.0.0.0 --log-file dc-api.log & api_pid=$!
docker run --rm -p 8083:8083 -e LAMBDA_ENDPOINT=http://172.17.0.1:3003/ amazon/aws-stepfunctions-local
docker run --rm -p 8083:8083 -e LAMBDA_ENDPOINT=http://172.17.0.1:3005/ amazon/aws-stepfunctions-local
kill $api_pid $lambda_pid
6 changes: 3 additions & 3 deletions lambdas/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scripts": {
"lint": "eslint src/**/*.js test/**/*.js",
"preinstall": "cd src && npm i && cd -",
"preinstall": "cd src && npm i && cd ../lambdas && npm i && cd ../",
"prettier": "prettier -c src test",
"prettier:fix": "prettier -cw src test",
"test": "mocha",
Expand Down

0 comments on commit e5120ab

Please sign in to comment.