Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

15 Commits

Folders and files

Repository files navigation

DevOps Practices with basic python app

Name: Aayusha Regmi

This project demonstrates a simple DevOps workflow using GitHub and Linux basics. For task 1, the hello.py script was made executable and run as part of the initial repository setup.

1. Git & GitHub Setup

Made script executable with:

chmod +x ./hello.py

Output:

Task 1 output

2. Linux & Scripting Basics

Created scripts/sysinfo.sh to print the current user, current date, and disk usage.

Run:

chmod +x ./scripts/sysinfo.sh
./scripts/sysinfo.sh

Output:

Task 1 output

3. Docker Basics

Installed Docker with:

sudo apt update
sudo apt install -y docker.io

Checked Docker status with:

sudo systemctl status docker

Allowed the current user to run Docker without sudo:

sudo usermod -aG docker $USER
newgrp docker

Built and ran the container with:

docker build -t devops-hello .
docker run --rm devops-hello

Output:

Task 3 output

4. CI/CD with GitHub Actions

Created .github/workflows/ci.yml to run python hello.py automatically on every push.

Output:

Click the badge to view the most recent pipeline run in GitHub Actions.

CI

5. Job Deployment with Nomad

Created nomad/hello.nomad to run the Docker container as a Nomad service job with minimal CPU and memory.

Install Nomad:

sudo apt update
sudo apt install -y unzip
curl -fsSL https://releases.hashicorp.com/nomad/1.9.0/nomad_1.9.0_linux_amd64.zip -o nomad.zip
unzip nomad.zip
sudo mv nomad /usr/local/bin/
nomad version

Run:

nomad job run nomad/hello.nomad

Check status:

sudo systemctl status nomad
nomad job status hello

Output:

Task 5 output

6. Monitoring with Grafana Loki

Started Loki locally with Docker and viewed logs from the container or Nomad allocation.

See monitoring/loki_setup.txt for the setup command and log viewing commands.

Output:

docker ps
curl http://localhost:3100/ready
docker logs promtail
sudo docker run --rm hello-image:latest

Screenshot:

Task 6 output

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages