Git Product home page Git Product logo

devops's Introduction

Django CI CI to Docker Hub

DevOps

This is repository for the DevOps Engineering course in Innopolis University

Table of contents:

What is in this repo?

  • app_python folder contains python web app and necessary files for Docker
  • app_python/app_files folder contains the app itself, which shows current datetime in Europe/Moscow timezone. This app uses Django framework. It keeps datetimes of all requests to / in logs/access.txt file, accessable via /visits endpoint.
  • .github/workflows folder contains workflows for testing the app and publishing it to the docker hub
  • vagrant folder contains Vagrantfile for managing VM, which works on both VirtualBox and Google Cloud Platform
  • ansible folder contains playbooks and roles for provisioning the VM (installing docker and running image from dockerhub)
  • monitoring folder contains stuff necessary for grafana/promtail/loki/prometheus stack
  • k8s folder contains configs for kubernetes & helm, which also demonstrates work with charts, secrets, resource management, config maps, stateful sets, kube prometheus stack, and init containers

Python app

The simplest way is to use docker:
docker run -p 5000:5000 kezzyhko/devops

If you do not want to use docker for some reason, then clone the repo, install requirements.txt and run main.py:
git clone https://github.com/kezzyhko/devops.git
pip3 install -r ./devops/app_python/requirements.txt
python3 ./devops/app_python/app_files/main.py

By default, app is accessible on port 5000

Unit tests

The unit tests for this app are located at app_files/tests.py.
There are three tests, which test the datetime_view view, located in the app_files/views.py.

Vagrant

If you want to use it locally using VirtualBox, the following command will be enough:
vagrant up --provider=virtualbox

If you want to use it with Google Cloud, then you need to change constants in Vagrantfile, add necessary key files and then use the following command:
vagrant up --provider=google

Ansible

Ansible provisioning is automatically executed when using vagrant up <...>.
If you want to run it manually, use vagrant provision or configure ansible hosts and execute the playbook

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.