Skip to content

Getting started with Dartmouth Dashoard, Databases and Containers

Visit Dartmouth Dashboard.

Dashboard Sections

  • Project - All resources in the Dashboard must be in a project
  • Database - Create a MySQL, PostgreSQL or SQL Server database
  • Compute - Build and deploy container images

Project

If you don't already have a project go to Project and click "Create Project"

Note

Multiple users can be in a project working on the resources therein.

Warning

Each user may have one "Free-tier" project. To remove the free tier limitations from a project, billing information must be provided by editing the project. Once billing has been configured, a project cannot transition back to the free-tier.

Database

Once your Project is created go to Database and click "Create Instance"

  • Instance Type: PostgreSQL
  • Instance Name: Todo
  • Location: rcikube6

Warning

Admin Password: Click Generate, and the 👁 icon and make note of the admin password - you won't see it again.

  • Storage: 1GB

Click Create

After creating the database return to Database Instances and select your database and click Connect - make note of the Hostname

Screenshot of DB Connection Info

DB Connection Info

Streamlit App

Streamlit documentation

Start by downloading Tim's Todo Streamlit app at

https://github.com/dartmouth/todo-demo

via Code -> Download Zip

If you have git installed
git clone git@github.com:dartmouth/todo-demo.git

Running Streamlit

cd todo-domo
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
streamlit run main.py

Install uv

and

uv run --with streamlit,python-dotenv,peewee,watchdog streamlit run main.py

Building and Running a Todo Container

podman build --tag todo .
podman run -e USER_NAME="Tivon" --name todo todo

Getting your container image published

Info

We will be using an existing image in this workshop but you can use these instructions for your own code in the future.

Once you have tested your code in a local container it is time to publish your container image for external collaboraotes and users

  • Ensure your code and Dockerfile are pushed to your GitHub repository in the Dartmouth Organization

  • Set up your GitHub repository for container image publishing

Each Git Repository associated with a Container Image Builder must be setup to allow read access to a service account, and a webhook needs to be setup to trigger builds.

  1. Navigate to your Git repository on https://github.com

  2. Navigate to Settings > Collaborators and teams

  3. Click Add people

  4. Enter f0068fg in the Find people box, then select f0068fg from the list

  5. If required to select a role, select Read

  6. Click the Add button

Webhook

  1. Navigate to your Git repository on https://github.com

  2. Navigate to Settings > Webhooks

  3. Click Add webhook

  4. Enter https://github-webhook-proxy.dartmouth.edu as the Payload URL

  5. Select application/json as the Content type

  6. Select Let me select individual events as the Trigger, then make sure only Releases is checked

  7. Click Add webhook

With these settings, whenever a new release is created, a build will be triggered.

Creating a Release and your Contaimer Image

Head to Container Image Builders in the Dashbaord and Click Create

Fill out the form including an email adress if you want a notification on a failed build.

At the main page for your GitHub repository click on Releases and click Draft a new release

You will find your published release at

Container Images

Make note of the Container Image Location for the Container Deploy

Container Deploy

Go to Container Deploy and click Create

Fill out the following fields:

  • Deployment Name - this will also be used to create the url for your container with a -app suffix
  • Container Image - for the workshop you will use ghcr.io/dartmouth/todo-demo:latest otherwise if you are creating your own add in the Container Image Location from above
  • Add Environment Variable - for this workshop you will add Variable Name: USER_NAME Variable Value: your_name
  • Add Secret - for this workshop you will be adding two secrets:
    • Secret Name: DATABASE_URL Secret Value: postgresql://admin:admin_password@hostname:5432/postgres where admin_password is the admin password you copied during db creation and hostname is the postgresql database hostname you also copied earlier (You can get the hostname by going back to the databases section of the dashboard)
    • Secret Name: TODOS_PASSWORD Secret Value: Create a password for the todos database that will be created
  • Ports: Streamlit listens on 8501
Paid Project Additional Options

If you provided a chart-string for your project you can change:

CPU Limit - how much CPU your application needes (this is a fraction of a CPU)

Memory Limit - how much memory is available to your application

Once you hit Create, in 5-10 minutes your application will be available at http://deployment_name-app.c.dartmouth.edu:8501.dartmouth.edu

If you are entering username/passwords or sensitive information into your application, we recommend adding encryption via SSL, so please reach out to research.computing@dartmouth.edu to get this set-up for you (we will also get you a standard domain name like todo.dartmouth.edu)

Steps for Deploying a Container on Dartmouth Dashboard

  • Create a Project. 📝
  • Create a Database Instance, noting connection string and admin password. 👀
  • If you aren't using an existing container image, create a container image. ✨
  • Create a Container Deployment, add environment variables, secrets and port. 🚋
  • Find your application at http://deployment_name:port.c.dartmouth.edu 🚀