Obmovies - A short guide on setting up the system and environment dependencies required for ob's Movies database

Related tags

Documentationobmovies
Overview

ob Movies

This is a short guide on setting up the system and environment dependencies required for ob's Movies database.

Your Mission

Greetings Earthling! You have been selected to test your skills among the Team Awesome, DevOps :)

This challenge contains a directory - ob-devopsday/obmovies - with a Python project and a mongoDB dataset dump (available on the releases section of the repo). The package dependencies for Python are resolved using pip. The project was built using Flask framework. The application has some errors/omissions that are purposefully made. Once you have solved the connection issue run pytest to confirm connectivity.

Challenges

  1. Solve the following tickets/TODOs in db.py:
    1. Paging,
    2. Faceted Search and
    3. User Management.
  2. Containerize obmovies webapp and deploy into a Kubernetes solution/tool of your choice.
  3. Use helm chart or daemonset templates to deploy the webapp.
Brownie points:
  • Create a CICD pipeline to build the app and deploy to your cluster.
  • Codify the creation of your cluster.

Movies Application Structure

Everything you will implement is located in the obmovies/db.py file, which contains all database interfacing methods. The API will make calls to db.py to interact with a MongoDB. You have the option of using a local mongo server or sign up for a free tiered Mongo Atlas account.

The unit tests in tests will verify these database access methods directly, without going through the API. The UI will run these methods in integration tests, and therefore requires the full application to be running.

The API layer is fully implemented, as is the UI. If you need to run on a port other than 5000, you can edit the index.html file in the build directory to modify the value of window.host.

Please do not modify the API layer in any way, movies.py and user.py under the obmovies/api directory. Doing so will most likely result in the frontend application failing to validate some of the labs.

Local Development Environment Configuration

MongoDB Atlas and Compass

Mongo Atlas offers a free tiered option that provides sample datasets. You will be using the mflix collection for this challenge. Optional: If you are interested in running a local mongoDB use the mongod-sampledata.gz available on the Releases tab in git

Sign up for a free-tiered Mongo Atlas account. Create a project and a cluster with a name of your choosing. During the creation of the cluster select "Load Sample Dataset". You will need to whitelist your IP address to gain access.

Virtualenv

Use virtualenv, to define your Python 3 environment. You are required to have a Python 3 installed in your workstation.

You can find the virtualenv installation procedure on the PyPA website.

Once you've installed Python 3 and virtualenv, you will have to setup a virtualenv environment:

  • Navigate to the obmovies python directory: cd obmovies
  • Create the virtual environment for obmovies: virtualenv -p YOUR_LOCAL_PYTHON3_PATH obmovies_venv
  • Activate the virtual environment: source obmovies_venv/bin/activate
  • You can deactivate the virtual environment with the following command: deactivate

Documentation: virtualenv installation

Python Library Dependencies

Once the Python 3 environment is activated, we need to install our python dependencies. Dependencies are defined in requirements.txt, and can be installed with the following command: pip install -r requirements.txt

Running the Application

In the obmovies directory there are two files, called dotini_unix and dotini_win.

Rename this file to .ini with the following command:

mv dotini_unix .ini  # on Unix
ren dotini_win .ini # on Windows

Once the file has been renamed, open it, and enter your Atlas or local mongo server connection string as directed in the comment. This is the information the driver will use to connect!

You can confirm connection to the database by running the unit test: pytest -m connection

To start the obmovies application, run the following command: python run.py

And then point your browser to: http://localhost:5000/

Running the Unit Tests

To run the unit tests for this challenge, you will use pytest. The challenges solved contains a module of unit tests that you can call individually with a command like the following: pytest -m LAB_UNIT_TEST_NAME

Each ticket will contain the command to run that ticket's specific unit tests.

When you are finished

  • You can submit your solution to [email protected]
  • Update README.MD so we know how to run your solution and the Kubernetes cluster solution/tool we should use.
  • Leave the git history in tact and don't fork this repo as other candidates could then start building on your solution 😉

Simple steps tp run this app

First

  • Docker - v18.09.7
  • Mk v1.17.0 running k8s 1.18

Second step :

  • Insert correct values and setup dotini_unix and rename to .ini ( as security measure it wont get uploaded to the public repo and ignored )

Third step:

  • cd obmovies && docker-compose up #can exit using ^+C
  • kubectl create -f deployment.yaml
A module filled with many useful functions and modules in various subjects.

Usefulpy Check out the Usefulpy site Usefulpy site is not always up to date Download and Import download and install with with pip download usefulpyth

Austin Garcia 1 Dec 28, 2021
Your Project with Great Documentation.

Read Latest Documentation - Browse GitHub Code Repository The only thing worse than documentation never written, is documentation written but never di

Timothy Edmund Crosley 809 Dec 28, 2022
Żmija is a simple universal code generation tool.

Żmija Żmija is a simple universal code generation tool. It is intended to be used as a means to generate code that is both efficient and easily mainta

Adrian Samoticha 2 Nov 23, 2021
Python-slp - Side Ledger Protocol With Python

Side Ledger Protocol Run python-slp node First install Mongo DB and run the mong

Solar 3 Mar 02, 2022
This is a repository for "100 days of code challenge" projects. You can reach all projects from beginner to professional which are written in Python.

100 Days of Code It's a challenge that aims to gain code practice and enhance programming knowledge. Day #1 Create a Band Name Generator It's actually

SelenNB 2 May 12, 2022
Read write method - Read files in various types of formats

一个关于所有格式文件读取的方法 1。 问题描述: 各种各样的文件格式,读写操作非常的麻烦,能够有一种方法,可以整合所有格式的文件,方便用户进行读取和写入。 2

2 Jan 26, 2022
Lightweight, configurable Sphinx theme. Now the Sphinx default!

What is Alabaster? Alabaster is a visually (c)lean, responsive, configurable theme for the Sphinx documentation system. It is Python 2+3 compatible. I

Jeff Forcier 670 Dec 19, 2022
A simple document management REST based API for collaboratively interacting with documents

documan_api A simple document management REST based API for collaboratively interacting with documents.

Shahid Yousuf 1 Jan 22, 2022
Documentation for GitHub Copilot

NOTE: GitHub Copilot discussions have moved to the Copilot Feedback forum. GitHub Copilot Welcome to the GitHub Copilot user community! In this reposi

GitHub 21.3k Dec 28, 2022
ACPOA plugin creation helper

ACPOA Plugin What is ACPOA ACPOA is the acronym for "Application Core for Plugin Oriented Applications". It's a tool to create flexible and extendable

Leikt Sol'Reihin 1 Oct 20, 2021
A simple XLSX/CSV reader - to dictionary converter

sheet2dict A simple XLSX/CSV reader - to dictionary converter Installing To install the package from pip, first run: python3 -m pip install --no-cache

Tomas Pytel 216 Nov 25, 2022
freeCodeCamp Scientific Computing with Python Project for Certification.

Polygon_Area_Calculator freeCodeCamp Python Project freeCodeCamp Scientific Computing with Python Project for Certification. In this project you will

Rajdeep Mondal 1 Dec 23, 2021
📚 Papers & tech blogs by companies sharing their work on data science & machine learning in production.

applied-ml Curated papers, articles, and blogs on data science & machine learning in production. ⚙️ Figuring out how to implement your ML project? Lea

Eugene Yan 22.1k Jan 03, 2023
Course Materials for Math 340

UBC Math 340 Materials This repository aims to be the one repository for which you can find everything you about Math 340. Lecture Notes Lecture Notes

2 Nov 25, 2021
Python solutions to solve practical business problems.

Python Business Analytics Also instead of "watching" you can join the link-letter, it's already being sent out to about 90 people and you are free to

Derek Snow 357 Dec 26, 2022
AiiDA plugin for the HyperQueue metascheduler.

aiida-hyperqueue WARNING: This plugin is still in heavy development. Expect bugs to pop up and the API to change. AiiDA plugin for the HyperQueue meta

AiiDA team 3 Jun 19, 2022
Netbox Dns is a netbox plugin for managing zone, nameserver and record inventory.

Netbox DNS Netbox Dns is a netbox plugin for managing zone, nameserver and record inventory. Features Manage zones (domains) you have. Manage nameserv

Aurora Research Lab 155 Jan 06, 2023
Repository for learning Python (Python Tutorial)

Repository for learning Python (Python Tutorial) Languages and Tools 🧰 Overview 📑 Repository for learning Python (Python Tutorial) Languages and Too

Swiftman 2 Aug 22, 2022
Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a Lets Code

🧾 lets-code-todo-list por Henrique V. Domingues e Josué Montalvão Projeto em Python colaborativo para o Bootcamp de Dados do Itaú em parceria com a L

Henrique V. Domingues 1 Jan 11, 2022
Python For Finance Cookbook - Code Repository

Python For Finance Cookbook - Code Repository

Packt 544 Dec 25, 2022