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
Documentation and issues for Pylance - Fast, feature-rich language support for Python

Documentation and issues for Pylance - Fast, feature-rich language support for Python

Microsoft 1.5k Dec 29, 2022
CoderByte | Practice, Tutorials & Interview Preparation Solutions|

CoderByte | Practice, Tutorials & Interview Preparation Solutions This repository consists of solutions to CoderByte practice, tutorials, and intervie

Eda AYDIN 6 Aug 09, 2022
NetBox plugin that stores configuration diffs and checks templates compliance

Config Officer - NetBox plugin NetBox plugin that deals with Cisco device configuration (collects running config from Cisco devices, indicates config

77 Dec 21, 2022
Credit EDA Case Study Using Python

This case study aims to identify patterns which indicate if a client has difficulty paying their installments which may be used for taking actions such as denying the loan, reducing the amount of loa

Purvi Padliya 1 Jan 14, 2022
A hack to run custom shell commands when building documentation on Read the Docs.

readthedocs-custom-steps A hack to run custom steps when building documentation on Read the Docs. Important: This module should not be installed outsi

Niklas Rosenstein 5 Feb 22, 2022
level2-data-annotation_cv-level2-cv-15 created by GitHub Classroom

[AI Tech 3κΈ° Level2 P Stage] κΈ€μž κ²€μΆœ λŒ€νšŒ νŒ€μ› μ†Œκ°œ κΉ€κ·œλ¦¬_T3016 λ°•μ •ν˜„_T3094 μ„μ§„ν˜_T3109 손정균_T3111 μ΄ν˜„μ§„_T3174 μž„μ’…ν˜„_T3182 Overview OCR (Optimal Character Recognition) 기술

6 Jun 10, 2022
Template repo to quickly make a tested and documented GitHub action in Python with Poetry

Python + Poetry GitHub Action Template Getting started from the template Rename the src/action_python_poetry package. Globally replace instances of ac

Kevin Duff 89 Dec 25, 2022
graphical orbitational simulation of solar system planets with real values and physics implemented so you get a nice elliptical orbits. you can change timestamp value or scale from source code idc.

solarSystemOrbitalSimulation graphical orbitational simulation of solar system planets with real values and physics implemented so you get a nice elli

Mega 3 Mar 03, 2022
A set of Python libraries that assist in calling the SoftLayer API.

SoftLayer API Python Client This library provides a simple Python client to interact with SoftLayer's XML-RPC API. A command-line interface is also in

SoftLayer 155 Sep 20, 2022
An ongoing curated list of OS X best applications, libraries, frameworks and tools to help developers set up their macOS Laptop.

macOS Development Setup Welcome to MacOS Local Development & Setup. An ongoing curated list of OS X best applications, libraries, frameworks and tools

Paul Veillard 3 Apr 03, 2022
Valentine-with-Python - A Python program generates an animation of a heart with cool texts of your loved one

Valentine with Python Valentines with Python is a mini fun project I have coded.

Niraj Tiwari 4 Dec 31, 2022
Count the number of lines of code in a directory, minus the irrelevant stuff

countloc Simple library to count the lines of code in a directory (excluding stuff like node_modules) Simply just run: countloc node_modules args to

Anish 4 Feb 14, 2022
OpenAPI Spec validator

OpenAPI Spec validator About OpenAPI Spec Validator is a Python library that validates OpenAPI Specs against the OpenAPI 2.0 (aka Swagger) and OpenAPI

A 241 Jan 05, 2023
Plugins for MkDocs.

Plugins for MkDocs and Python Markdown pip install neoteroi-mkdocs This package includes the following plugins and extensions: Name Description Type m

35 Dec 23, 2022
Yet Another MkDocs Parser

yamp Motivation You want to document your project. You make an effort and write docstrings. You try Sphinx. You think it sucks and it's slow -- I did.

Max Halford 10 May 20, 2022
advance python series: Data Classes, OOPs, python

Working With Pydantic - Built-in Data Process ========================== Normal way to process data (reading json file): the normal princiople, it's f

Phung HΖ°ng Binh 1 Nov 08, 2021
A markdown wiki and dashboarding system for Datasette

datasette-notebook A markdown wiki and dashboarding system for Datasette This is an experimental alpha and everything about it is likely to change. In

Simon Willison 19 Apr 20, 2022
1.3k Jan 08, 2023
This contains timezone mapping information for when preprocessed from the geonames data

when-data This contains timezone mapping information for when preprocessed from the geonames data. It exists in a separate repository so that one does

Armin Ronacher 2 Dec 07, 2021
Autolookup GUI Plugin for Plover

Word Tray for Plover Word Tray is a GUI plugin that automatically looks up efficient outlines for words that start with the current input, much like a

Kathy 3 Jun 08, 2022