Skip to content

Commit

Permalink
Merge pull request #23 from Lindharden/notes
Browse files Browse the repository at this point in the history
Notes
  • Loading branch information
bitknox authored Feb 19, 2023
2 parents 6e80676 + b06bba2 commit 70abc57
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
12 changes: 11 additions & 1 deletion notes/lecture02_containerization.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,17 @@ February 07 and 10, 2023

First of all we ran our test suite to see whether the tests pass or not. Here we have some tests that fail. To fix all of these tests, we had to change the string encoding.

For our refactoring we decided to use the language GO. We choose this language as it's much faster than Python, and because we wanted to learn it. We installed an GO SQL package on the system, and imported it into our application. This allows us to query the database using `sql.open()`. Then we wanted to update our test suite to support our GO application. We had to update the flask HTML templates to work with GO. Here we had to change the expression declarations from using the following syntax: `{% expression %}` to `{{expression}}`. We then changed the templates to use some new controllers and routes we created for handling different tasks. We created controllers, routes and middleware as described in this blog by Jes Fink-Jensen: <https://betterprogramming.pub/how-to-create-a-simple-web-login-using-gin-for-golang-9ac46a5b0f89>.
For our refactoring we decided to use the language GO. The flask application for minitwit uses HTML rendering for the different pages, and therefore we wanted to use an development language which also supports this. Other than that we need to be able to connect to an database.

There exists many web development languages which does both of these things. We, however, decided to use Go as it lives up to our requirements. Other than that:
- Go has better performance compared to Python web applications.
- It has concurrency support that allows for efficient use of system resources and request handling, useful for scalability.
- Type safety helps catching errors while developing, which helps ensure reliable and maintainable code.

(reasons why Go is superior to Python:
<https://www.asapdevelopers.com/golang-vs-python/>)

We installed an GO SQL package on the system, and imported it into our application. This allows us to query the database using `sql.open()`. Then we wanted to update our test suite to support our GO application. We had to update the flask HTML templates to work with GO. Here we had to change the expression declarations from using the following syntax: `{% expression %}` to `{{expression}}`. We then changed the templates to use some new controllers and routes we created for handling different tasks. We created controllers, routes and middleware as described in this blog by Jes Fink-Jensen: <https://betterprogramming.pub/how-to-create-a-simple-web-login-using-gin-for-golang-9ac46a5b0f89>.


## Step 2: Containerize ITU-MiniTwit with Docker
Expand Down
25 changes: 25 additions & 0 deletions notes/lecture03_virtualization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Lecture 3: Provision of local and remote virtual machines
Week 7, 2023

## New github setup

Before we started on any work this week, we decided to make some changes to our Github repository. The first thing we did was that we started utilizing the 'issues' feature in Git. This is very similar to many other Kanban tools like *Jira* or *Trello*, where we can create backlog items known as *issues*, and then assign each other to different tasks.

The reason we decided on picking Github issues over other Kanban solutions, was because of the tight integration between Git and the Kanban board itself. Github issues allow us to natively link and mention different things inside of our Github repository, such as branches. It's also much simpler to just use one platform for everything, instead of having to switch back and forth between different platforms while working. Meanwhile Github issues support all of the features we need, such as:
- Creating issues/backlog items.
- Creating milestones, and linking issues to milestones.
- Assigning authors to different issues.

We also changed some rules in our Github repository such that no one can push directly to the main branch. From now on everything has to be implemented on separate branches and then we have to create pull requests, which have to be peer-reviewed, before the content can be merged into the main branch.

## Step 1: Implement an API for the simulator in your ITU-MiniTwit.

To implement the API for the simulator, we went through the simulator file [minitwit_sim_api.py](https://github.com/itu-devops/lecture_notes/blob/master/sessions/session_03/API_Spec/minitwit_sim_api.py), and looked at all the routes we have to implement. We then created the issue [Feature: Implement the endpoints for the simulator](https://github.com/Lindharden/DevOps/issues/13), and some sub-issues which are described inside the main issue.

We then implemented the required controllers and handlers, to support all the new API calls.

## Step 2: Continue refactoring of your ITU-MiniTwit.

We created some issues for the missing features in our application (not related to simulation).

We then created a Vagrant file for our application and deployed the application here: <http://164.90.223.49:8080/public>

0 comments on commit 70abc57

Please sign in to comment.