An open API service indexing awesome lists of open source software.

https://github.com/mostafa-wael/goviolin

Complete deployment and pipeline for the GoViolin opensource project
https://github.com/mostafa-wael/goviolin

devops docker docker-compose golang helm jenkins kubernetes terraform

Last synced: 4 months ago
JSON representation

Complete deployment and pipeline for the GoViolin opensource project

Awesome Lists containing this project

README

          

GoViolin is a helpful way to practice violin written in Go. Listen to any scale or arpeggio with a few mouse clicks. Play along to improve your intonation.
# Use GO Locally
drawing

Build, run and test Go locally:
- Initialize the module:
- `go mod init github.com/Rosalita/GoViolin`
- `go mod tidy`
- `go mod vendor`
- Build a runnable binary: `go build -o runnable.o .`
- Run the binary: `./runnable.o`
- Run the tests: `go test ./...`
---
# Docker
drawing

The Docker image is based on the concept of multi-stage build. We use a builder stage to build the runnable binary and another light weight stage to run it. The final image using this approach is very small; less than the original image by a factor of 5!
- Build the Docker image: `docker build -t mostafaw/goviolin:latest .`
- Run the Docker image: `docker run -p 3000:8080 mostafaw/goviolin:latest`
---
# Docker Compose
drawing

We have used Docker compose here to encapsulate the parameters passed during running the docker image.
- Docker compose: `docker-compose -f docker-compose.yaml up`
---
# Jenkins
![image](https://user-images.githubusercontent.com/56788883/175832347-652d700b-16e1-4b43-8fc2-30f39a86a287.png)

The pipeline supports three stages: Run the tests, Build the image and Push the image to Docker Hub. It also supports sending emails with the pipeline status. The pipeline can be easily configured by specifying parameters when running it.
- Run Jenkins: `sudo systemctl start jenkins` on port `8080`
- Get status(e.g.: password) from Jenkins: `sudo systemctl status jenkins`
- Stop Jenkins: `sudo systemctl stop jenkins`
---
# Kubernetes
drawing

Deploy & access a service in kubernetes:
- Start the local cluster: `minikube start`
- Create the deployment `kubectl apply -f deployment.yaml `
- Create the service: `kubectl apply -f service.yaml`
- Get the URL: `minikube service goviolin-service --url`
- Expose the port (optional): `minikube tunnel`

---
# Helm
drawing

Use helm charts to manage k8s manifests
- Install the chart: `helm install goviolin-chart ./goviolin-chart`
- Update the chart values: `helm upgrade --install goviolin-chart ./goviolin-chart`
- Get the URL: `minikube service goviolin-chart --url`
---
# Provisioning using Terraform
drawing

- Deploy the infrastructure: `terraform apply`
- Destroy the infrastructure: `terraform destroy`
- Stop the instance: `./stop-connection.sh GoViolin`
- Start the instance: `./start-connection.sh GoViolin`