/cpr-dev-mfwolffe

Primary LanguageShellMIT LicenseMIT

cpr-dev

Dev Container config for development of MusicCPR to support simpler onboarding either via (remote) GitHub Codespaces or (local) docker container (unless it ends up too expensive or too slow).

Setup

  1. ensure that you have a fork of both the frontend repository and the backend repositories in THIS github organization (Lab-Lab-Lab):
    1. frontend
      1. so you should have a repo at almost EXACTLY this url https://github.com/Lab-Lab-Lab/CPR-Music-YOURUSERNAME
        • for example mine is https://github.com/Lab-Lab-Lab/CPR-Music-hcientist
    2. backend
      1. so you should have a repo at almost EXACTLY this urlhttps://github.com/Lab-Lab-Lab/CPR-Music-Backend-YOURUSERNAME
        • for example mine is https://github.com/Lab-Lab-Lab/CPR-Music-Backend-hcientist
  2. click the green "Use this template" button on this repository to create a new repository for your own development on this project, but create it also in this organization (Lab-Lab-Lab) so that you'll have $free access to the codespace
    1. in the dropdown for the Owner, choose Lab-Lab-Lab
    2. you will need to name it something different than just cpr-dev, i suggest just adding a suffix to the repo name, e.g. cpr-dev-hcientist.
    3. probably make the repository public
  3. in the resulting repo, you need to replace Lab-Lab-Lab/CPR-Music Lab-Lab-Lab/CPR-Music-Backend and with your github repo names in the following files:
    1. .devcontainer/devcontainer.json
    2. scripts/setup.sh
  4. commit those changes to your cpr-dev-YOURUSERNAME reopsitory.
  5. On your computer, install the GitHub CLI if you haven't already.
  6. On your computer, install Docker if you haven't already.

Usage

In-browser Codespace

  1. click the green Code button on your cpr-dev repository
  2. select the Codespaces tab in the resulting popover
  3. If you already have a codespace, click on it to launch it.
  4. Else, if you have no codespace for this repo, click the green Create codespace on main button

Local Container

  1. using its HTTPS url clone your cpr-dev-USERNAME repository to your local machine
  2. press the do everything hotkey Ctrl+Shift+P (or on macOS command+shift+P), type reopen, and then select Dev Containers: Reopen in Container

Resources

I'm unsure what info will help do this well, but here's where i'm looking first:

  1. CS 159 S24 Codespace demo I threw together
  2. vscode's doc about "remote python development" (they made it for flask, which isn't what we're doing, but it shows port forwarding which we will probably need)
  3. some person's django dev codespace
  4. someone's codespace for django with postgres
  5. possible example?

Questions

  1. should we setup backend that's deployed somewhere (e.g. dev.musiccpr.org or similar) to accept requests from frontend running locally and/or in codespace?
    1. in which case should we start by creating only a codespace/devcontainer for frontend?
  2. it seems like maybe sqlite supports everything we need for local, so should we revert to suggesting student devs/newbs/everyone use sqlite in local?

Notes

Tradeoffs

  1. to do in-browser development in a codespace, we need to have the cpr-dev, frontend, and backend repos all forked (well, i guess cpr-dev isn't exactly a "fork") within Lab-Lab-Lab, for EACH developer...
  2. in-browser sucks on a bad connection...