HUB
Sign inSign up
project_database logo

datagnomesteam/project_database

By datagnomesteam

•Updated over 1 year ago

Image
0

949

datagnomesteam/project_database repository overview

⁠Getting Started

Our project is packed into two Docker images you can pull and the provided docker-compose-hub.yml sets all variables, ports, and images for you. We have provided instructions as well for running this project outside of a container. However, we strongly advise in using the docker container version since it's much easier to run. During development, we primarily leveraged the docker containers.

⁠Requirements - Docker

⁠We highly recommend running the project using the Docker method!

You can watch a 1-minute unlisted tutorial on how to run it using this method as well: https://www.youtube.com/watch?v=k151XB_YDDQ⁠

You will need:

  • Docker Desktop (or Docker Engine with Docker Compose)
  • An x86-64 (Intel) or ARM (M1) based device
  • Atleast 6GB of free storage (assuming the default "slim" version)
  • A fast, uninterruptable internet connection
  • Ability to access DockerHub (https://registry-1.docker.io⁠, https://hub.docker.com⁠ should be whitelisted)

⁠Steps - Docker:

  1. Ensure your user account can pull & run Docker images (If you can run docker run hello-world without issues, your system is ready)
  2. Ensure ports 8000, 8501, and 5432 are open for local access only.
  3. Place the provided docker-compose-hub.yml in an empty accessible directory.
  4. Open a Command Prompt/Powershell (for Windows) or Terminal (for Mac/Linux) and cd into the directory containing your docker-compose-hub.yml
  5. Run docker compose -f ./docker-compose-hub.yml up
  6. Wait for the images to download and the containers to be deployed
  7. Once both the db and data_server containers are ready, navigate to http://localhost:8501 to view the page
  8. Change the Streamlit web application to 'dark' mode, otherwise some of the visual will not display correctly. (From the Streamlit web page, click the vertical three dots in the upper right hand corner -> Click on 'Settings' -> Select the drop down menu underneath 'Choose app theme, colors and fonts' -> Select 'Dark' and close 'Settings')

Note: there are some startup tasks that will take roughly 1-5 minutes depending on the speed of your storage and CPU.

⁠Requirements - local

You can use this method to build the containers locally. Keep in mind this will require a significant amount of CPU/Storage which is why we recommend the Docker method

You will need:

  • An x86-64 (Intel) or ARM (M1) based device
  • Atleast 10GB of free storage (may be larger depending how Docker unpacks data on your system or atleast 70GB+ if you want to run the full database)
  • A fast, uninterruptable internet connection
  • PostgreSQL server and client installed (this will vary by OS. https://www.postgresql.org/download/⁠)
  • streamlit installed (pip install streamlit)
  • zstd installed (exact install instructions vary by OS and distro)

⁠Steps - local/db:

This builds the database container alone. Keep in mind this will require a significant amount of CPU/Storage which is why we recommend the Docker method

  1. Download either the slim database (https://datagnomesgroup.ddns.net/pg_slim.zst⁠) or the full database (https://datagnomesgroup.ddns.net/pg.zst⁠)

    We strongly recommend the slim version because some of our queries require 60+GB of memory to execute

  2. Create the database (/usr/lib/postgresql/15/bin/initdb -D [wherever you want the database])

  3. Start the database (/usr/lib/postgresql/15/bin/pg_ctl -D $PGDATA start)

  4. Create database (createdb --encoding=UTF8 --lc-collate='en_US.utf8' --lc-ctype='en_US.utf8' --template=template0 datastore )

  5. Create user (psql -d datastore -c "CREATE USER chris WITH SUPERUSER PASSWORD 'chris';")

  6. Load data (zstd -d [path to your database download] -c | psql -d datastore --set ON_ERROR_STOP=1)

⁠Steps - local/app:

  1. Unzip the code
  2. Change directory (cd) to the server directory
  3. Install all Python dependancies using the command: python -m pip install -r requirements.txt
  4. Start database by running: /usr/lib/postgresql/15/bin/pg_ctl -D [postgres location from above] start
  5. Run the model to do the calculations on your chosen database by running python3 server/model_objects/run_algos.py
  6. Start the server by running: streamlit run Home.py --server.port=8501
  7. Navigate to http://localhost:8501 to view the page
  8. Change the Streamlit web application to 'dark' mode, otherwise some of the visual will not display correctly. (From the Streamlit web page, click the vertical three dots in the upper right hand corner -> Click on 'Settings' -> Select the drop down menu underneath 'Choose app theme, colors and fonts' -> Select 'Dark' and close 'Settings')

Note: there are some startup tasks that will take roughly 5-15 minutes depending on the speed of your storage and CPU.

If you need assistance, contact our team leader or email [email protected]

Tag summary

Content type

Image

Digest

sha256:1a91c8183…

Size

4.2 GB

Last updated

over 1 year ago

docker pull datagnomesteam/project_database