aws / aws-parallelcluster-ui

Apache License 2.0
31 stars 20 forks source link

[Tools] Add scripts to facilitate 1-click deployment of PCUI in personal environment #291

Closed gmarciani closed 10 months ago

gmarciani commented 10 months ago

Changes

  1. Add script 'deploy.sh' to deploy (created or update) the local PCUI to a personal environment.
  2. Add script 'setup-env.sh' to create the configuration files to deploy PCUI to personal environments
  3. Documented how to use the above scripts.

Command to create files for the personal environment (this must be done just the first time):

bash scripts/setup-env.sh giacomo-env

Command to deploy (create or update) PCUI into the environment:

bash scripts/deploy.sh giacomo-env

Example of execution:

(pcluster-ui) ➜  aws-parallelcluster-ui git:(wip/mgiacomo/2023120/fix-urlib-cve) ✗ bash scripts/deploy.sh mgiacomo                            
[INFO] Selected environment: mgiacomo
[INFO] Retrieving infrastructure bucket
[INFO] Using infrastructure bucket mgiacomo-aws-parallelcluster-ui
[INFO] Uploading templates to infrastructure bucket mgiacomo-aws-parallelcluster-ui
upload: infrastructure/parallelcluster-ui-cognito.yaml to s3://mgiacomo-aws-parallelcluster-ui/parallelcluster-ui-cognito.yaml
upload: infrastructure/parallelcluster-ui.yaml to s3://mgiacomo-aws-parallelcluster-ui/parallelcluster-ui.yaml
[INFO] Settings up private ECR repository parallelcluster-ui
[INFO] The private ECR repository parallelcluster-ui already exists
[INFO] Using private ECR repository arn:aws:ecr:us-east-1:REDACTED:repository/parallelcluster-ui at ECR endpoint REDACTED.dkr.ecr.us-east-1.amazonaws.com
[INFO] Building image locally and publishing it to private ECR repository
[INFO] Logging in REDACTED.dkr.ecr.us-east-1.amazonaws.com
Login Succeeded
[INFO] Building frontend
~/workplace/aws-parallelcluster-ui/frontend ~/workplace/aws-parallelcluster-ui
[INFO] Building image
...DOCKER LOGS...
[INFO] Pushing image REDACTED.dkr.ecr.us-east-1.amazonaws.com/parallelcluster-ui:2023.11.21 in repository parallelcluster-ui
...DOCKER LOGS...
[INFO] Uploaded: REDACTED.dkr.ecr.us-east-1.amazonaws.com/parallelcluster-ui:2023.11.21, REDACTED.dkr.ecr.us-east-1.amazonaws.com/parallelcluster-ui:latest
[INFO] Image built with tag '2023.11.21' and 'latest'
[INFO] Deploying stack pcui-test
[INFO] The stack pcui-test does not exist, creating ...
{
    "StackId": "arn:aws:cloudformation:us-east-1:REDACTED:stack/pcui-test/REDACTED"
}
[INFO] Deployment completed!
[INFO] PCUI endpoint is https://REDACTED.execute-api.us-east-1.amazonaws.com/pcui

How Has This Been Tested?

Used both script to deploy PCUI in personal account.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.