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

chore(iatlas): create project iatlas-data #2411

Merged
merged 15 commits into from
Feb 8, 2024

Conversation

tschaffter
Copy link
Member

@tschaffter tschaffter commented Dec 13, 2023

Closes #2408

Depends on #2412

Changelog

  • Add the project iatlas-data that populates a Postgres DB
  • Add the container of the project iatlas-data to the iAtlas stack

Preview

Prepare the workspace

workspace-install

Build the iAtlas images

iatlas-build-images

Start iAtlas Postgres DB and seed it

  1. Set the config in apps/iatlas/data/.env.
    • The DB credentials must match those specified in apps/iatlas/postgres/.env
  2. Start the Postgres container and the process that seeds it.
    • iAtlas data and data schema will be downloaded from Synapse.
nx serve-detach iatlas-data

You can follow the seeding process with:

docker logs -f iatlas-data

Visualize the content of the DB

Use the SQLTools extension for VS Code to visualize the content of the DB.

image

Bonus: Prepare iatlas-data development environment

  • Create a venv with Poetry with the version of Python specified by the project.
  • Install the project dependencies inside this venv.
nx prepare iatlas-data

The venv now lives in /workspaces/sage-monorepo/apps/iatlas/data/.venv.

Select the Python interpreter in VS Code to benefit from syntax highlighting.

vscode_select_interpreter

vscode_select_interpreter_2

vscode_select_interpreter_3

Activate the venv from VS Code terminal in order to run Python scripts:

cd apps/iatlas/data
poetry shell

Possible improvements

  • Install Python packages in the docker image with Poetry instead of relying on requirements.txt (not DRY)
  • Prevent the iatlas-data container to run again if the DB has already been populated (save time to developers when redeploying the stack)

@tschaffter tschaffter self-assigned this Dec 13, 2023
@tschaffter tschaffter marked this pull request as ready for review February 8, 2024 23:02
@tschaffter tschaffter merged commit b5c9bce into Sage-Bionetworks:main Feb 8, 2024
8 checks passed
@tschaffter tschaffter deleted the add-iatlas-api branch February 8, 2024 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story] Create project iatlas-data
1 participant