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
Service for visualisation of high dimensional for hydrosphere

hydro-visualization Service for visualization of high dimensional for hydrosphere DEPENDENCIES DEBUG_ENV = bool(os.getenv("DEBUG_ENV", False)) APP_POR

hydrosphere.io 1 Nov 12, 2021
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
An interview engine for businesses, interview those who are actually qualified and are worth your time!

easyInterview V0.8B An interview engine for businesses, interview those who are actually qualified and are worth your time! Quick Overview You/the com

Vatsal Shukla 1 Nov 19, 2021
An MkDocs plugin to export content pages as PDF files

MkDocs PDF Export Plugin An MkDocs plugin to export content pages as PDF files The pdf-export plugin will export all markdown pages in your MkDocs rep

Terry Zhao 266 Dec 13, 2022
Documentation of the QR code found on new Austrian ID cards.

Austrian ID Card QR Code This document aims to be a complete documentation of the format used in the QR area on the back of new Austrian ID cards (Per

Gabriel Huber 9 Dec 12, 2022
Data-science-on-gcp - Source code accompanying book: Data Science on the Google Cloud Platform, Valliappa Lakshmanan, O'Reilly 2017

data-science-on-gcp Source code accompanying book: Data Science on the Google Cloud Platform, 2nd Edition Valliappa Lakshmanan O'Reilly, Jan 2022 Bran

Google Cloud Platform 1.2k Dec 28, 2022
Generate YARA rules for OOXML documents using ZIP local header metadata.

apooxml Generate YARA rules for OOXML documents using ZIP local header metadata. To learn more about this tool and the methodology behind it, check ou

MANDIANT 34 Jan 26, 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
Automatically open a pull request for repositories that have no CONTRIBUTING.md file

automatic-contrib-prs Automatically open a pull request for repositories that have no CONTRIBUTING.md file for a targeted set of repositories. What th

GitHub 8 Oct 20, 2022
Numpy's Sphinx extensions

numpydoc -- Numpy's Sphinx extensions This package provides the numpydoc Sphinx extension for handling docstrings formatted according to the NumPy doc

NumPy 234 Dec 26, 2022
Rust Markdown Parsing Benchmarks

Rust Markdown Parsing Benchmarks This repo tries to assess Rust markdown parsing

Ed Page 1 Aug 24, 2022
A complete kickstart devcontainer repository for python3

A complete kickstart devcontainer repository for python3

Viktor Freiman 3 Dec 23, 2022
This repository outlines deploying a local Kubeflow v1.3 instance on microk8s and deploying a simple MNIST classifier using KFServing.

Zero to Inference with Kubeflow Getting Started This repository houses all of the tools, utilities, and example pipeline implementations for exploring

Ed Henry 3 May 18, 2022
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
This is the data scrapped of all the pitches made up potential startup's to established bussiness tycoons of India with all the details of Investments made, equity share, Name of investor etc.

SharkTankInvestor This is the data scrapped of all the pitches made up potential startup's to established bussiness tycoons of India with all the deta

Subradip Poddar 2 Aug 02, 2022
Pydantic model generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources.

datamodel-code-generator This code generator creates pydantic model from an openapi file and others. Help See documentation for more details. Supporte

Koudai Aono 1.3k Dec 29, 2022
Repository for tutorials, examples and starter scripts for using the MTU HPC cluster

MTU-HPC-Starter Repository for tutorials, examples and starter scripts for using the MTU HPC cluster Connecting to the MTU HPC cluster Within the coll

1 Jan 31, 2022
FxBuzzly - Buzzly.art links do not embed in Discord, this fixes them (rudimentarily)

fxBuzzly Buzzly.art links do not embed in Discord, this fixes them (rudimentaril

Dania Rifki 2 Oct 27, 2022
Speed up Sphinx builds by selectively removing toctrees from some pages

Remove toctrees from Sphinx pages Improve your Sphinx build time by selectively removing TocTree objects from pages. This is useful if your documentat

Executable Books 8 Jan 04, 2023
💡 Catatan Materi Bahasa Pemrogramman Python

Repository catatan kuliah Andika Tulus Pangestu selama belajar Dasar Pemrograman dengan Python.

0 Oct 10, 2021