Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce config environment variable #3006

Open
wants to merge 108 commits into
base: main
Choose a base branch
from

Conversation

BobanL
Copy link
Collaborator

@BobanL BobanL commented Dec 9, 2024

Review #3059 first

PULL REQUEST

Summary

  • Add new CONFIG variable that, if set will, replace NEXT_PUBLIC_NON_INTEGRATED_VIEWER, SOURCE, METADATA_DATABASE_TYPE, METADATA_DATBASE_SCHEMA, NBS_AUTH
    • If no valid CONFIG value is set then the values will have to be set manually
  • Install next-runtime-env to set NEXT_PUBLIC_NON_INTEGRATED_VIEWER value from the register function.
  • Replace APP_ENV with NBS_AUTH to make it more clear what it does
  • Update docker profiles to match new collection variables
  • Update LA seed data that has duplicate lab info

Cleanup 🧹

  • Add default to SQL_SERVER_USER and SQL_SERVER_PASSWORD since .env was deleted
  • Combine azure-init and azure-storage into a single container
    • The docker compose flag --abort-on-container-exit will stop all containers if any container stops. Since Azure-storage depended on azure-init completing it would stop the entire convert-seed-data.
  • Remove wrapping around S3 Client creation since undefined values will not effect the creation of the client
  • Add public and private key to env sample to be able to test NBS_AUTH flow.

Related Issue

Fixes #2873

Acceptance Criteria

  • collections created for each
    • AWS integrated
      • APP_ENV=test
      • NEXT_PUBLIC_NON_INTEGRATED_VIEWER=false
      • SOURCE=s3
      • METADATA_DATABASE_TYPE=undefined
      • METADATA_DATABASE_SCHEMA=undefined
    • Azure integrated
      • APP_ENV=test
      • NEXT_PUBLIC_NON_INTEGRATED_VIEWER=false
      • SOURCE=azure
      • METADATA_DATABASE_TYPE=undefined
      • METADATA_DATABASE_SCHEMA=undefined
    • AWS non-integrated
      • APP_ENV=prod
      • NEXT_PUBLIC_NON_INTEGRATED_VIEWER=true
      • SOURCE=s3
      • METADATA_DATABASE_TYPE=sqlserver
      • METADATA_DATABASE_SCHEMA=extended
    • Azure non-integrated
      • APP_ENV=prod
      • NEXT_PUBLIC_NON_INTEGRATED_VIEWER=true
      • SOURCE=azure
      • METADATA_DATABASE_TYPE=sqlserver
      • METADATA_DATABASE_SCHEMA=?
  • Setting the new configuration name environment variable causes the correct set of environment variables to be set on startup

Testing

  • Use .env.sample as the base of your .env.local and change the CONFIG variable to test different combinations

docker compose --env-file .env.local --profile "*" up to test with different configs
@BobanL BobanL marked this pull request as ready for review December 19, 2024 15:15
@BobanL BobanL changed the title collection env variables with next runtime env feat: introduce config environment variable Dec 19, 2024
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.

Create environment variable collections
2 participants