Skip to content

Commit 199ba5e

Browse files
committed
Updated website. TODO: deployment page
1 parent 665e926 commit 199ba5e

14 files changed

Lines changed: 340 additions & 172 deletions

docs/A_using_verviz.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/B_veriviz.md

Whitespace-only changes.

docs/C_sylvia.md

Whitespace-only changes.

docs/D_seif.md

Whitespace-only changes.
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
# All about Deployment
2-
3-
Veriviz utilizes [UNC Cloud Apps](https://cloudapps.unc.edu/) to host and deploy the service. UNC Cloud Apps runs on OKD(OpenShift Kubernetes Distribution).
4-
5-
## What is Kubernetes?
6-
7-
ON a high level, Kubernetes is a service that allows your application to be run in a virtual enviroment with its own operating system. You can think of it as what a container is to Docker on your local machine, that's essentially what a pod is on a Kubernetes deployment. This is defined by a Dockerfile in your project which OKD uses to create your pod and which your code is processed in run on.
8-
9-
## How does deploying on Kubvernetes work
10-
11-
The OKD Deployment process works as follow:
12-
13-
1. Being notified of CI successfully passing all tests on main and receiving a webhook callback
14-
2. A BuildConfig begins a new Build by pulling repository and building a Docker image
15-
3. The Docker image is pushed to an ImageStream
16-
4. The ImageStream notifies a Deployment that a new image is available
17-
5. The Deployment spins up a new Pod (Container) based on the image
18-
6. Once the new Pod is available, it turns off the old Pod running the previous version
19-
20-
*Credit to Kris Jordan and his [website](https://comp423-25s.github.io/resources/backend-architecture/3-ci-cd/#why-cicd-matters) for this information*
21-
22-
## Continous Inegration, Continous Deployment
23-
24-
CI/CD(Continous Integration/Continous Deployment) refers to the automatied process of re-deploying a service when new changes are made.
25-
26-
- **Continous Integration** refers to the process of verifying tests are passed ebfore deployment. So for example, after a commit to main is made, Tests you write will be automatically run on your new code. If these tests pass, great! they will now be handed over to continous deployement and if not, your project will not be re-deployed and you will have to iterate on your code until they pass.
27-
28-
- The second step of CI/CD **Continous Deployment**. This referrs to the process of automitcally redploying your service to reflect the changes you made to it. In a full CI/CD pipeline, once your project has passed the tests, it is then deployed.
29-
30-
**In Veriviz**, **Continous Integration** is **NOT** used. This meand once new changes are refelected in the main branch, it will be redployed to OKD, rebuilt, and up and running. There are no tests to verify your work. This can be added in the future but is not nessarily needed. What this means in a nutshell is, when you make changes to the verviz repo or any of the other services such as SEIF or Sylvia, the changes will automitically be reflected in the service with no need for manual deployment but also, no tests will verify what you did is correct. Don't worry though, if your code results in a failed deployment, OKD will revert to the last built pod and the service will still run on the old code.
31-
32-
1+
# All about Deployment
2+
3+
Veriviz utilizes [UNC Cloud Apps](https://cloudapps.unc.edu/) to host and deploy the service. UNC Cloud Apps runs on OKD(OpenShift Kubernetes Distribution).
4+
5+
## What is Kubernetes?
6+
7+
ON a high level, Kubernetes is a service that allows your application to be run in a virtual enviroment with its own operating system. You can think of it as what a container is to Docker on your local machine, that's essentially what a pod is on a Kubernetes deployment. This is defined by a Dockerfile in your project which OKD uses to create your pod and which your code is processed in run on.
8+
9+
## How does deploying on Kubvernetes work
10+
11+
The OKD Deployment process works as follow:
12+
13+
1. Being notified of CI successfully passing all tests on main and receiving a webhook callback
14+
2. A BuildConfig begins a new Build by pulling repository and building a Docker image
15+
3. The Docker image is pushed to an ImageStream
16+
4. The ImageStream notifies a Deployment that a new image is available
17+
5. The Deployment spins up a new Pod (Container) based on the image
18+
6. Once the new Pod is available, it turns off the old Pod running the previous version
19+
20+
*Credit to Kris Jordan and his [website](https://comp423-25s.github.io/resources/backend-architecture/3-ci-cd/#why-cicd-matters) for this information*
21+
22+
## Continous Inegration, Continous Deployment
23+
24+
CI/CD(Continous Integration/Continous Deployment) refers to the automatied process of re-deploying a service when new changes are made.
25+
26+
- **Continous Integration** refers to the process of verifying tests are passed ebfore deployment. So for example, after a commit to main is made, Tests you write will be automatically run on your new code. If these tests pass, great! they will now be handed over to continous deployement and if not, your project will not be re-deployed and you will have to iterate on your code until they pass.
27+
28+
- The second step of CI/CD **Continous Deployment**. This referrs to the process of automitcally redploying your service to reflect the changes you made to it. In a full CI/CD pipeline, once your project has passed the tests, it is then deployed.
29+
30+
**In Veriviz**, **Continous Integration** is **NOT** used. This meand once new changes are refelected in the main branch, it will be redployed to OKD, rebuilt, and up and running. There are no tests to verify your work. This can be added in the future but is not nessarily needed. What this means in a nutshell is, when you make changes to the verviz repo or any of the other services such as SEIF or Sylvia, the changes will automitically be reflected in the service with no need for manual deployment but also, no tests will verify what you did is correct. Don't worry though, if your code results in a failed deployment, OKD will revert to the last built pod and the service will still run on the old code.
31+
32+
Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
# How to Deploy
2-
3-
## Setting up CD for a service
4-
5-
In the root of your project, set up a `.github/workflows` directory and make a file called `cicd.yml` result in a full path of `ROOT/.github/workflows/cicd.yml`
6-
7-
### "What is cicd.yml"
8-
9-
This file tells github a few things. We have not gotten to secrets yet but we will soon. IN a nutshell, a secret is seomthing we will give to our OKD deployment and define in our Github Repo.
10-
- The `.github/workflow` directory is a special directory that when github sees, it knows to look in here for rules for CD
11-
- ```
12-
on:
13-
push:
14-
branches: [ main ]
15-
pull_request:
16-
branches: [ main ]
17-
```
18-
Tells github to send our secret to OKD on a push to` main`(commit) or a pull request to `main`. We will later define this in our deployment but for now this is all you need to know
19-
20-
21-
Below is an example from verviz of the `cicd.yml` file. As you can see `.yml` files are very human readable and easy to follow.
22-
``` { .yaml .copy}
23-
name: NAME-OF-YOUR-PROJECT-HERE
24-
25-
on:
26-
push:
27-
branches: [ main ]
28-
pull_request:
29-
branches: [ main ]
30-
31-
jobs:
32-
cd-frontend:
33-
name: "Continuous Deployment - Veriviz"
34-
runs-on: ubuntu-latest
35-
36-
steps:
37-
- uses: actions/checkout@v4
38-
39-
- name: Trigger OKD Build for Veriviz
40-
run: |
41-
curl -X POST ${{ secrets.CD_BUILD_WEBHOOK_FRONTEND}}
42-
cd-backend:
43-
name: "Continuous Deployment - Backend"
44-
runs-on: ubuntu-latest
45-
steps:
46-
- uses: actions/checkout@v4
47-
- name: Trigger OKD Build for Veriviz Backend
48-
run: |
49-
curl -X POST ${{ secrets.CD_BUILD_WEBHOOK_VERIVIZ_BACKEND }}
1+
# How to Deploy
2+
3+
## Setting up CD for a service
4+
5+
In the root of your project, set up a `.github/workflows` directory and make a file called `cicd.yml` result in a full path of `ROOT/.github/workflows/cicd.yml`
6+
7+
### "What is cicd.yml"
8+
9+
This file tells github a few things. We have not gotten to secrets yet but we will soon. IN a nutshell, a secret is seomthing we will give to our OKD deployment and define in our Github Repo.
10+
- The `.github/workflow` directory is a special directory that when github sees, it knows to look in here for rules for CD
11+
- ```
12+
on:
13+
push:
14+
branches: [ main ]
15+
pull_request:
16+
branches: [ main ]
17+
```
18+
Tells github to send our secret to OKD on a push to` main`(commit) or a pull request to `main`. We will later define this in our deployment but for now this is all you need to know
19+
20+
21+
Below is an example from verviz of the `cicd.yml` file. As you can see `.yml` files are very human readable and easy to follow.
22+
``` { .yaml .copy}
23+
name: NAME-OF-YOUR-PROJECT-HERE
24+
25+
on:
26+
push:
27+
branches: [ main ]
28+
pull_request:
29+
branches: [ main ]
30+
31+
jobs:
32+
cd-frontend:
33+
name: "Continuous Deployment - Veriviz"
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Trigger OKD Build for Veriviz
40+
run: |
41+
curl -X POST ${{ secrets.CD_BUILD_WEBHOOK_FRONTEND}}
42+
cd-backend:
43+
name: "Continuous Deployment - Backend"
44+
runs-on: ubuntu-latest
45+
steps:
46+
- uses: actions/checkout@v4
47+
- name: Trigger OKD Build for Veriviz Backend
48+
run: |
49+
curl -X POST ${{ secrets.CD_BUILD_WEBHOOK_VERIVIZ_BACKEND }}
5050
```

docs/Getting Started/A_repo_structure.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/contributing.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Contributing
2+
3+
## Contributing to the Verviz Website
4+
5+
### Getting Started
6+
7+
1. **Fork and Clone**: Fork the Veriviz repository and/or clone it locally.
8+
2. **Devcontainer Setup**: For a consistent development environment, check out [using devcontainers](devcontainers.md).
9+
3. **Create a Branch**: Work on your feature or bug fix in a new branch, e.g., `git checkout -b feature/amazing-feature`.
10+
4. **Test and Verify**: Ensure everything runs locally before opening a PR.
11+
- If you’d like to deploy changes or see how deployment works, see [How to Deploy](how_to_deploy.md).
12+
!!! note "Cloning Sylvia and/or SEIF"
13+
While not neseary, it is recommended to run things locally to test the full pipeline and your new code works. To tests the entirerty of the pipeline, it is recommended to clone Sylvia and/or SEIF to run these locally as well. Check out below for how to run these locally.
14+
15+
### Running on your local machine
16+
17+
#### Running Veriviz
18+
19+
1. `cd frontend`
20+
2. Run `npm install` to verify everything is installed
21+
3. Run `npm run dev`. Now the frontend is up and running on localhost.
22+
4. `cd ../backend`
23+
5. Run `npm install` to verify everything is installed
24+
6. Run `node server.js`. Now the backend is up and running on localhost.
25+
26+
#### Running Sylvia
27+
28+
1.
29+
30+
31+
## MkDocs and Contributing to Verviz Docs
32+
33+
### What is MkDocs?
34+
35+
**MkDocs** is a static site generator built for project documentation.
36+
It uses Markdown files for content and a single `mkdocs.yml` for config. Read more about mkdocs on their [offical documentation website](https://www.mkdocs.org/).
37+
38+
### Contributing to Verviz Docs
39+
40+
1. **Fork or clone** the Veriviz documentation.
41+
2. `ctrl + shft + p`( `cmd + shft + p` on mac) and select `reopen in devcontainer. For more information or if not working see [using devcontainers](devcontainers.md)
42+
43+
Now automatically, when you commit remotely to the main branch or sucesfully pull request, the website will automatically deploy and reflect your changes. Below are some common tasks that will help you get started.
44+
45+
### Common Tasks
46+
47+
- **Add a new doc**: create `new_topic.md` in `docs/` and link it in `mkdocs.yml`.
48+
- **Preview changes**: run `mkdocs serve` to check them locally.
49+
- **Publish**: push to `main` if the pipeline is set to deploy.
50+
!!! note "On `mkdocs.yml"
51+
The `mkdocs.yml` file defines configuration for the mkdocs site in a human readable format. To add your new file to the view of the website, look in the `mkdocs.yml` file, look for the `nav` section and and your file with a relative path. For example, if i craeted `hello.md` in `/docs/intros/hello.md`, in the `nav` section i would include:
52+
```
53+
nav:
54+
- intros:
55+
- NAME HERE(ex. Hello): intros/hello.md
56+
```
57+
Lines changed: 70 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,70 @@
1-
# What are Devcontainers and why are they useful?
2-
3-
A Devcontainer utilizes Docker to create a virtual environment while developing your project. For example, I can specify a Dev container to run an Ubuntu Linux environment with python installed and no matter which machine I want to work on the project with(ie. windows, mac, etc.), I will have a consistent enviroment throughout.
4-
5-
A Dev Container ensures your development environment is consistent and works with whatever machine may be running it. It makes collabration easy and saves a lot of time. It's best practice and in short it solves the issue of "but it works on my machine". Additionally, we want to use the **OKD CLI**, which is incredibly easy and consistent to have form a devcontainer, but complicated and issue prone to dowload on your own machine
6-
7-
## Using DevContainers
8-
9-
As you will see in Veriviz, there is a predefined devcontainer. Running it is the most important thing but if you would like to learn more and how to create one, read the `Creating a Devcontainer` section below.
10-
11-
!!! note "Prerequisties"
12-
- **Docker** is strictly nesseary to run a devcontainer and needs to be dowloaded. Check out [here](https://www.docker.com/products/docker-desktop/) for download information(The free version is recommended).
13-
- **VsCode** is highly recommended. This tutorial will assume you are using VsCode and using any other code editor for a devcontainer will require your own research.
14-
- The **Dev Containers Extension in VsCode** is needed as well
15-
16-
### Re-opening in a devcontainer
17-
18-
Reopening the project in a dev container can be done with `Ctrl+Shift+P`(or `Cmd+Shift+P` on Mac) and typing "Dev Containers: Reopen in Container" and selecting that option. It's that simple!
19-
20-
!!! note "Pop-Up"
21-
You also may see a pop up in VSCode on the bottom right hand side of your screen roughly stating **"Would you like to reopen this project in a dev container?"** which you can **click yes to to achieve the same result.**
22-
23-
## Creating a Devcontainer
24-
25-
As outlined earlier a devcontainer is extremly useful for collaboration and just a good qualit yof life thing to have for a repo.
26-
27-
1. In VS Code, open your project via its root directory
28-
2. Install Dev Containers extension in VS Code
29-
3. create a ```.devcontainer``` directory in the root of your project which is the `rust-intro` directory we just made
30-
```{.yaml .copy}
31-
mkdir .devcontainer
32-
```
33-
This tells the VsCode devcontainers extension there is a devcontainer and it will know to look here
34-
4. Use VS Code and create a file named ```devcontainer.json``` inside of the ```.devcontainer``` directory. This is where you will define what your devcontainer's skeleton. Look below for an example for a basic `Rust` container.
35-
36-
``` { .yaml .copy}
37-
{
38-
"name": "Rust Intro",
39-
"image": "mcr.microsoft.com/devcontainers/rust:latest",
40-
"customizations": {
41-
"vscode":{
42-
"settings": {},
43-
"extensions":["rust-lang.rust-analyzer"]
44-
}
45-
},
46-
"postCreateCommand": "",
47-
}
48-
```
49-
Here's what everything does
50-
51-
* **```name:```** This is what your dev container will be named
52-
53-
- **```image:```** The docker image to use, in this case we will be using a preconfigured image for rust by microsoft
54-
55-
- **```customizations:```** Adds configurations like VS Code extensions ensuring other developers have them too. ```rust-lang.rust-analyzer``` is the standard language server for rust development in vs code.
56-
57-
- **```postCreateCommand:```** A command to run after the container is created. In our case, we don't include anything but you could create a seperate file with a bash command to run and link it here. When the container is built, that command will be run!
58-
59-
Et Voila, it is done. IN case you wanted to use a custom image form a Dockerfile of your own, no problem, just make the dockerfile and include the path in the json. See [here](https://code.visualstudio.com/docs/devcontainers/containers) for some more documentation on devcontainers.
60-
61-
1+
# What are Devcontainers and why are they useful?
2+
3+
A **Devcontainer** uses Docker to create a virtual environment while developing your
4+
project. For example, you can run an Ubuntu environment with Python installed, and
5+
no matter which machine (Windows, macOS, or Linux) you use, you’ll have a **consistent
6+
setup**.
7+
8+
**Benefits**:
9+
- Avoid "it works on my machine" issues.
10+
- Simplify collaboration.
11+
- Effortlessly include tools (like the **OKD CLI**) without manual installs.
12+
13+
## Using DevContainers
14+
15+
As you will see in Veriviz, there is a predefined devcontainer. Running it is the most important thing but if you would like to learn more and how to create one, read the `Creating a Devcontainer` section below.
16+
17+
!!! note "Prerequisties"
18+
- **Docker** is strictly nesseary to run a devcontainer and needs to be dowloaded. Check out [here](https://www.docker.com/products/docker-desktop/) for download information(The free version is recommended).
19+
- **VsCode** is highly recommended. This tutorial will assume you are using VsCode and using any other code editor for a devcontainer will require your own research.
20+
- The **Dev Containers Extension in VsCode** is needed as well
21+
22+
### Re-opening in a devcontainer
23+
24+
1. Press **Ctrl+Shift+P** (or **Cmd+Shift+P** on Mac) in VS Code.
25+
2. Choose **"Dev Containers: Reopen in Container"**.
26+
3. VS Code reopens in your dev environment automatically.
27+
28+
!!! note
29+
Sometimes, VS Code prompts **"Reopen folder to develop in a container?"**.
30+
Clicking **"Reopen"** achienves the same result.
31+
32+
## Creating a Devcontainer
33+
34+
As outlined earlier a devcontainer is extremly useful for collaboration and just a good quality of life thing to have for a repo. Below is an **Example** devcontainer steup for Rust that is **not used in verviz** but just her eto provide an example of how to set up a devcontainer.
35+
36+
1. In VS Code, open your project via its root directory
37+
2. Install Dev Containers extension in VS Code
38+
3. create a ```.devcontainer``` directory in the root of your project which is the `rust-intro` directory we just made
39+
```{.yaml .copy}
40+
mkdir .devcontainer
41+
```
42+
This tells the VsCode devcontainers extension there is a devcontainer and it will know to look here
43+
4. Use VS Code and create a file named ```devcontainer.json``` inside of the ```.devcontainer``` directory. This is where you will define what your devcontainer's skeleton. Look below for an example for a basic `Rust` container.
44+
45+
``` { .yaml .copy}
46+
{
47+
"name": "Rust Intro",
48+
"image": "mcr.microsoft.com/devcontainers/rust:latest",
49+
"customizations": {
50+
"vscode":{
51+
"settings": {},
52+
"extensions":["rust-lang.rust-analyzer"]
53+
}
54+
},
55+
"postCreateCommand": "",
56+
}
57+
```
58+
Here's what everything does
59+
60+
* **```name:```** This is what your dev container will be named
61+
62+
- **```image:```** The docker image to use, in this case we will be using a preconfigured image for rust by microsoft
63+
64+
- **```customizations:```** Adds configurations like VS Code extensions ensuring other developers have them too. ```rust-lang.rust-analyzer``` is the standard language server for rust development in vs code.
65+
66+
- **```postCreateCommand:```** An optional script to run on container creation
67+
68+
For more info, see [VS Code’s Devcontainers docs](https://code.visualstudio.com/docs/devcontainers/containers).
69+
70+

0 commit comments

Comments
 (0)