Skip to content

Commit

Permalink
Merge pull request #99 from ubccpsc310/cs310_2023w1
Browse files Browse the repository at this point in the history
2023W1/W2 Changes Everything tested and deployed in prod. Would be a good point for upstream to pull changes.
  • Loading branch information
rtholmes authored Feb 20, 2024
2 parents d2dee3d + dc642dd commit ba460f9
Show file tree
Hide file tree
Showing 53 changed files with 5,263 additions and 3,659 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ Instructions for getting started with Classy have been sorted into sections base
- [2. Hardware Requirements](/docs/tech-staff/hardware.md)
- [3. Installation](/docs/tech-staff/install.md)
- [3.1 Software Dependencies](/docs/tech-staff/install.md#software-dependencies)
- [3.2 Install Classy](/docs/tech-staff/install.md#install-classy)
- [3.2 Classy Installation](/docs/tech-staff/install.md#install-classy)
- [3.3 System Configuration](/docs/tech-staff/install.md#create-user-group)
- [3.4 Create SSL Certificates](/docs/tech-staff/install.md#create-ssl-certificates)
- [3.5 Configure Firewall Rules](/docs/tech-staff/install.md#create-firewall-rules)
- [4. Github Setup](/docs/tech-staff/githubsetup.md)
- [4. GitHub Setup](/docs/tech-staff/githubsetup.md)
- [5. Backup Configuration](/docs/tech-staff/backups.md)
- [6. Build/Start/Stop Classy](/docs/tech-staff/operatingclassy.md)
- [7. Patching](/docs/tech-staff/updates.md)
Expand All @@ -101,3 +101,4 @@ Instructions for getting started with Classy have been sorted into sections base
## License

[MIT](LICENSE)

162 changes: 5 additions & 157 deletions docs/courses/310.md
Original file line number Diff line number Diff line change
@@ -1,161 +1,9 @@
# CPSC 310

## Note: this document is stale; better docs exist [here](https://github.students.cs.ubc.ca/CPSC310/project-resources/blob/master/docs/README.md) and [here](https://github.students.cs.ubc.ca/CPSC310/classy-cs310-plugin).
## Note: this document is stale; better docs exist [here](https://github.students.cs.ubc.ca/CPSC310/project-resources/blob/master/docs/README.md) and [here](https://github.students.cs.ubc.ca/CPSC310/classy-cs310-plugin).

A brief set of instructions for configuring Classy for 310.

### Initial Setup

* Request that the tech staff provision a VM and configure classy (including all required `autobot` tokens and the `github.student` org and `admin/staff` teams) for the term.
* Visit the [classy instance](https://cs310.students.cs.ubc.ca), import the classlist (using the `Update Classlist` API button in the config tab), and provision the deliverables (at least `d0` as shown below).
* Provision some repositories.

<!--
* Request a VM from the tech staff by emailing `help@cs`.
* Request a GitHub org from the tech staff by emailing `help@cs`.
* In the org settings (under Member Privileges):
* `Allow members to delete or transfer repositories for this organization` should be `false`.
* `Allow members to change repository visibilities for this organization` should be `false`.
* `Allow forking of private repositories` should be `false`.
* Create a `staff` team; add all TAs to this team.
* Create an `admin` team; add all faculty and `autobot` to this team.
* Install Classy on the VM using the other instructions in this directory.
-->

### Monitoring Classy

The VM should have monitoring configured by default:

* Create tunnel on your machine: `ssh -L19999:localhost:19999 cs310.students.cs.ubc.ca`
* Connect: `http://localhost:19999`

### Configuring Classy

* Create your Deliverables (`d0`, `d1`, `d2`, `d3`, `d4`, and `project`). The two deliverables that will provision repositories are `d0` and `project`.

* `d0` deliverable settings:
* Deliverable Id: `d0`
* URL: https://github.com/ubccpsc/310/blob/<TERM BRANCH HERE>/project/Deliverable0.md
* Visible: `true` (`false` if you're not quite ready to deploy, can change later)
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_; due date for project (usually around Sept 16 @ 1800)
* Allow late AutoTest: `false`
* Grades Released: `false`
* Will Provision Repos: `true`
* Import URL: `https://github.students.cs.ubc.ca/CPSC310/bootstrap.git` (make sure links in `bootstrap/README.md` are up-to-date)
* Repo prefix: `''` (Repo name will be `d0_userXXX` for students, `d0_CWL` for staff)
* Team prefix: `''` (Team name will be `d0_userXXX` for students, `d0_CWL` for staff)
* Min size: `1`
* Max size: `1`
* Same lab: `true`
* Students make teams: `false`
* Will use AutoTest: `true`
* Use `Create New image` to build your docker image (or select one if it has previously been created).
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `` (blank)
* Custom Autotest Parameters: `{}`
* `d1` deliverable settings:
* Deliverable Id: `d1`
* URL: _deliverable description url_
* Visible: `true`
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_
* Grades Released: `false`
* Will Provision Repos: `false`
* Will use AutoTest: `true`
* Docker image name: `TBD: NICK`
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `` (blank)
* Custom Autotest Parameters: `{}` **Note**: to show both public and private tests, set this to `{feedbackMode: "combined"}`
* `d2` deliverable settings:
* Deliverable Id: `d2`
* URL: _deliverable description url_
* Visible: `true`
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_
* Grades Released: `false`
* Will Provision Repos: `false`
* Will use AutoTest: `true`
* Docker image name: `TBD: NICK`
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `d1`
* Custom Autotest Parameters: `{}` **Note**: to show both public and private tests, set this to `{feedbackMode: "combined"}`
* `d3` deliverable settings:
* Deliverable Id: `d3`
* URL: _deliverable description url_
* Visible: `true`
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_
* Grades Released: `false`
* Will Provision Repos: `false`
* Will use AutoTest: `true`
* Docker image name: `TBD: NICK`
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `d1, d2`
* Custom Autotest Parameters: `{}` **Note**: to show both public and private tests, set this to `{feedbackMode: "combined"}`
* `d4` deliverable settings:
* Deliverable Id: `d4`
* URL: _deliverable description url_
* Visible: `true`
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_
* Grades Released: `false`
* Will Provision Repos: `false`
* Will use AutoTest: `true`
* Docker image name: `TBD: NICK`
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `` (no longer used)
* Custom Autotest Parameters: `{}`
* `project` deliverable settings:
* Deliverable Id: `project`
* URL: _deliverable description url_
* Visible: `false`
* Rubric: `{}`
* Custom: `{}`
* Open: _open date_; first day of class is fine
* Close: _close date_
* Grades Released: `false`
* Will Provision Repos: `true`
* Import URL: `https://github.ugrad.cs.ubc.ca/CPSC310-2018W-T1/bootstrap.git` (should be updated each term)
* Team prefix: `team` (`team_project_` will be prepended)
* Repo prefix: '' (blank) (`project_` will be prepended)
* Min size: `2`
* Max size: `2`
* Same lab: `true`
* Students make teams: `true`
* Will use AutoTest: `true`
* Docker image name: `cpsc310image`
* Container timeout: `300` (5 minutes)
* Student Delay: `43200` (12 hours)
* Regression Deliverables: `` (blank)
* Custom Autotest Parameters: `{}`

# Provisioning repos

* Visit `Manage Repositories` in the classy Config tab.
* If you want initial grading on all the repos you provision, be sure to set the `Default deliverable` in the config tab first.
* Select the deliverable you want to provision, and then the repos you want to provision (I would start with one, but if you're feeling lucky do them all).
* This will create the repo and give staff access to it, but _not_ the students.
* This task will take a long time (~10-15 seconds per repo), you can't close the browser while this is happening.
* You can watch progress using the Classy toast, or just visit the GitHub dashboard for the term to see repos show up.
* When you're happy with the repositories that have been provisioned you can release them to the students.
* This might require refreshing the `Provision & Release` results (do this by just toggling the deliverable dropdown).
* Select the repos you want to release and release them. This is a fast task (a few seconds at most per repository).
* Students should then have access to the repo.
* Make sure the `Default deliverable` is set in the config tab so that AutoTest runs on all pushes.
### Viewing with the database (changes strongly discouraged)

* Configure your SSH keys on `remote` and `cs310`
* Open an SSH tunnel: ssh -J remote.cs.ubc.ca cs310.students.cs.ubc.ca -L 27017:127.0.0.1:27017
* With Robo3T: connect to `localhost:27017`. Do not use SSH tunnel (in Robo) and just connect as if local.
16 changes: 2 additions & 14 deletions docs/courses/sdmm.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# SDMM DevOps

Host: [https://sdmm.cs.ubc.ca](https://sdmm.cs.ubc.ca)

### Update running instance:

To deploy new changes on SDMM, follow these steps:
## The project component of the SDMM is not offered anymore as of January 2024. These can be ignored and removed.

1. `sudo su w-sdmm`
2. `cd /opt/classy`
3. `git pull`
4. `docker build -t classy:base .`
5. `docker compose -f docker compose.yml -f docker compose.sdmm.yml up --detach --build portal autotest`

### Configuration

* If you want access to the admin dashboard, add your GitHub user to the `staff` team within the sdmm GitHub organization.
Host: [https://sdmm.cs.ubc.ca](https://sdmm.cs.ubc.ca)
10 changes: 10 additions & 0 deletions docs/developer/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Local Development Fork Setup](#local-development-fork-setup)
- [Remote Setup of a Fork](#remote-setup-of-a-fork)
- [Modifying Classy on Your Fork](#modifying-classy-on-your-fork)
- [Running Local Tests](#running-local-tests)
- [Main repos](#main-repos)
- [Goals](#goals)
- [Pulling changes from `root/main` into `fork/main`](#pulling-changes-from-rootmain-into-forkmain)
Expand Down Expand Up @@ -93,6 +94,15 @@ During the term, `ubccpsc/classy` will only receive critical bug fixes so course

Custom changes can be made to code in your fork, but the custom changes should **NOT** be pushed back to the root `Classy` repository, unless it is a needed feature.

## Running Local Tests

Both AutoTest and Classy have extensive test suites. While these will be run by CI, during development you usually want to run them locally.
To do this you need to do two things:
1. Ensure you have a local mongo instance running (see `DB_URL` in `.env`).
In a terminal, run: `docker run -p 27017:27017 mongo`
1. Have a test profile in your IDE that runs the tests. In Webstorm, this is done by creating a Mocha target with node options `--require dotenv/config -r tsconfig-paths/register` as the node options and the test directory pointed to the relevant test parent for the project. You will also want to set `Compile typescript` as a before launch action.
1. Ensure you have a valid `.env` file in the root of the project. You can copy the `.env.example` file and fill in the values.

## Main repos

* `ubccpsc/classy/main` (hereby `root`) is the core project that repos pull stable code from
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
"@types/fs-extra": "5.0.0",
"@types/jszip": "3.1.6",
"@types/mocha": "2.2.44",
"@types/mongodb": "^3.6.20",
"@types/node": "^18.11.18",
"@types/node-fetch": "^2.5.5",
"@types/restify": "8.5.5",
Expand Down
Loading

0 comments on commit ba460f9

Please sign in to comment.