Skip to content

feat(EG-666): simplify configuration for deployment and development#281

Merged
zigtan merged 36 commits intomainfrom
feat/EG-666_simplify_configuration_for_deployment_and_development
Sep 4, 2024
Merged

feat(EG-666): simplify configuration for deployment and development#281
zigtan merged 36 commits intomainfrom
feat/EG-666_simplify_configuration_for_deployment_and_development

Conversation

@zigtan
Copy link
Contributor

@zigtan zigtan commented Sep 2, 2024

This PR simplifies the configuration and improves the deployment reliability to make it easier for users to deploy the system to AWS.

We no longer need to manually copy and paste the API Gateway URL or the Cognito IDP details. This is achieved by running an external FE script nuxt-load-configuration-settings.ts that will query AWS for these details and write necessary settings to a config/.env.nuxt file for the FE nuxt.config.ts to use.

This has allowed easy-genomics.yaml file structure has been simplified to:

easy-genomics:
  configurations:
    - demo: # Unique 'env-name' identifier for the following collection of configuration settings (e.g. dev, uat, demo, prod)
        # Shared settings common to Back-End and Front-End sub-packages
        aws-account-id: # e.g '123456789'
        aws-region: # e.g. 'us-east-1'
        env-type: # e.g. 'dev' | 'pre-prod' | 'prod'
        app-domain-name: # e.g. 'demo.easy-genomics.myinstitution.org'
        # The following Front-End Infrastructure settings will need to be pre-configured in AWS and defined when 'env-type' is 'pre-prod' or 'prod'.
        aws-hosted-zone-id:
        aws-certificate-arn:

        # Back-End specific settings
        back-end:
            test-user-email: 'demouser@easygenomics.com'
            test-user-password: # Demo User Password - must be minimum 8 chars long and contain: 1 number, 1 special char, 1 uppercase letter, 1 lowercase letter
            seqera-api-base-url: # Optional: Update for self-hosted Seqera API Base URL; if unspecified this defaults to 'https://api.cloud.seqera.io'

For end-users, the build and deployment workflow can now be achieved by a single command:

   [easy-genomics root dir]$ pnpm run build-and-deploy`                            # Deploys BE and FE

For developers, we still have the convenience to work in parallel on the FE or BE and be able to deploy either separately:

   [easy-genomics root dir/packages/back-end]$ pnpm run build-and-deploy`          # Deploy BE only
   [easy-genomics root dir/packages/front-end]$ pnpm run build-and-deploy`         # Deploy FE only

For local FE development, once your BE has been deployed to AWS you can use:

   [easy-genomics root dir/packages/front-end]$ pnpm run nuxt-dev

The nuxt-load-configuration-settings.ts external script is run as part of the FE build workflow, and can be manually run by using this shortcut pnpm run nuxt-load-settings. But it does need the BE to be deployed first otherwise it will not find the right API Gateway or Cognito IDP details.

NOTE: An external script solution was needed because the project's current JS module setting does support top-level asynchronous calls to be made. If this module is updated to support this, the logic in the nuxt-load-configuration-settings.ts can be refactored to either the FE main.ts file or nuxt.config.ts.

@zigtan zigtan changed the title Feat/eg 666 simplify configuration for deployment and development feat(EG-666): simplify configuration for deployment and development Sep 2, 2024
@zigtan zigtan merged commit d960403 into main Sep 4, 2024
@zigtan zigtan deleted the feat/EG-666_simplify_configuration_for_deployment_and_development branch September 4, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants