Skip to content
This repository has been archived by the owner on Mar 13, 2023. It is now read-only.

Latest commit

 

History

History
66 lines (49 loc) · 2.28 KB

DEVELOPMENT.md

File metadata and controls

66 lines (49 loc) · 2.28 KB

Development

To run AWS ParallelCluster UI locally, start by setting the following environment variables:

export AWS_ACCESS_KEY_ID=[...]
export AWS_SECRET_ACCESS_KEY=[...]
export AWS_DEFAULT_REGION=us-east-2
export API_BASE_URL=https://[API_ID].execute-api.us-east-2.amazonaws.com/prod  # get this from ParallelClusterApi stack outputs
export ENV=dev

Install dependencies by running:

pip3 install -r requirements.txt

Backend with Cognito

From the Cognito service page of the AWS account where PCUI has been deployed, click on the user pool and then on the App Integration tab. In the App client list at the bottom, make note of the Client ID, then click on the App client and click Edit in the Hosted UI section, adding http://localhost:5001/login to the Allowed callback URLs.

Then export the following variables:

export SECRET_ID=<the value of the UserPoolClientSecretName output from the Cognito stack>
export SITE_URL=http://localhost:5001
export AUDIENCE=<the value of the Client ID noted in the previous step>
export AUTH_PATH=<the UserPoolAuthDomain output of the ParallelClusterCognito nested stack>

Start the API backend by running:

./scripts/run_flask.sh

Start the React frontend by running:

cd frontend/
npm install # if this is your first time starting the frontend
npm run dev

Lastly, navigate to http://localhost:5001

Typescript

The project has been converted to Typescript using ts-migrate(an in depth explanation can be found here). The tool automatically adds comments similar to // @ts-expect-error when typing errors cannot be fixed automatically: if you fix a type error either by adding a missing third party declaration or tweaking the signature of a function, you can adjust automatically the codebase and remove //@ts-ignore comments using npm run ts-reignore.

Testing

Launch tests of the API backend by running:

pytest

For detailed information on how to invoke pytest, see this resource.

To run frontend tests:

npm test