This project is for the University of Oregon's CS 422 class.
As of August 5th, 2023, all previous deployements have since been shut down, this project can be deployed locally or in the cloud following the instructions below.
In the future the below improvements should be made to the project.
- Separate the DB from the web app so new version pushes of the app don't result in the database being reset.
- Full containerization of the web application so a VM isn't required.
- Addition of UO majors.
- Addition of UO minors.
- Addition of all UO courses.
- Dynamic pull of UO courses through the UO API Developer Portal.
This applicaiton has a default admin login with the below credentials. This is mainly for testing purposes and not intended for all users to use.
This can also be changed after initial deployment, but each reset will contain these crednetials unless removed from the import_courses.py
file where the user is initially loaded in.
Username: admin
Password: admin
This project can be deployed locally in two ways, one being using python to directly launch the Django framework and alternatively using Docker. It is recommended that all local builds be performed using Docker since it is OS independent.
This project can be built and deployed using the Django framework. The steps listed in this section are steps perform on the Windows OS, the commands may differ slightly for other OSs.
Requirements:
Steps:
- In the root of the repo install the necessary packages,
pip3 install -r requirements.txt
- Enter the "cs_degree_planner" directory,
cd cs_degree_planner
. - Migrate the databases,
python manage.py migrate
. - Import all courses,
python manage.py import_courses forecast/recommendedcourses.xlsx
. - Run the server,
python manage.py runserver
. By default the server runs at "localhost:8000".
This project can be built and deployed locally if one does not desire to build it in the cloud. Below are the steps to perform this build from the root directory of the cloned repository.
Requirements:
- Docker is installed
Steps:
- Verify Docker is running by typing
docker info
in the terminal. If docker returns an error then docker needs to be started. - In the root of the cloned repo, build an image of the application
docker build -t <tag-name> .
. - Run the image using
docker run -d -p <port>:80 <tag-name>
.
Now your build will be accessible at localhost:<port>
.
If you wish to stop the instance it can be stopped using docker stop $(docker ps -q)
.
This over time will lead to a build-up of docker containers that can be cleaned up using docker rm $(docker ps -qa)
.
NOTE: This will remove all stopped containers including the ones not part of <tag-name>
, reference the docker cli for more information.
This project was built and deployed using Google Cloud. Below are the steps to replicate Continuous Integration and Continuous Deployment (CI/CD) utilized in this project. Both methods for cloud run deployment and VM deployment are explained.
NOTE: For proper deployment explained in both instances some diviation from provided resources/tutorials will need to be performed. These diviations are not explained in the steps and it is highly encouraged that the command inputs mean.
Requirements:
- Google Cloud CLI
- Google cloud account
Steps:
Steps:
- Modify
cloudbuild.yaml
.- Remove or comment out the [VM] sections.
- Update the image to reference the appropriate region, repo, and image from the created artifact registry.
- If needed, update the region.
- Configure Google Cloud Build to trigger from git commits, ref.
This can be linked to either this repo or this repo can be forked and it can be linked to the clone repository.
NOTE: Ensure the
cloudbuild.yaml
file is used with the file location at/cloud/cloudbuild.yaml
.
Builds and deployents are then automatically performed after each git push to the repo.
Steps:
- Create a VM instance connected to a load balancer, ref.
- Modify the
cloudbuild.yaml
.- Remove or commend out all [Cloud Run] sections.
- Update the image to reference the appropriate container image.
- Update the app to reference the appropriate VM.
- Update the zone to reference the approrpiate zone.
It is recommended that a service account is created to manage auto deployment, ref. If this is done the build trigger will need to be updated with the created account. Reperform the build and if permissions are required update the service account with the appropriate permissions.