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
Elliptic curve cryptography (ed25519) beginner tutorials in Python 3

ed25519_tutorials Elliptic curve cryptography (ed25519) beginner tutorials in Python 3 Instructions Just download the repo and read the tutorial files

6 Dec 27, 2022
the project for the most brutal and effective language learning technique

- "The project for the most brutal and effective language learning technique" (c) Alex Kay The langflow project was created especially for language le

Alexander Kaigorodov 7 Dec 26, 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
Mayan EDMS is a document management system.

Mayan EDMS is a document management system. Its main purpose is to store, introspect, and categorize files, with a strong emphasis on preserving the contextual and business information of documents.

3 Oct 02, 2021
Project documentation with Markdown.

MkDocs Project documentation with Markdown. View the MkDocs documentation. Project release notes. Visit the MkDocs wiki for community resources, inclu

MkDocs 15.6k Jan 02, 2023
Types that make coding in Python quick and safe.

Type[T] Types that make coding in Python quick and safe. Type[T] works best with Python 3.6 or later. Prior to 3.6, object types must use comment type

Contains 17 Aug 01, 2022
Poetry plugin to export the dependencies to various formats

Poetry export plugin This package is a plugin that allows the export of locked packages to various formats. Note: For now, only the requirements.txt f

Poetry 90 Jan 05, 2023
Python document object mapper (load python object from JSON and vice-versa)

lupin is a Python JSON object mapper lupin is meant to help in serializing python objects to JSON and unserializing JSON data to python objects. Insta

Aurélien Amilin 24 Nov 09, 2022
This repo provides a package to automatically select a random seed based on ancient Chinese Xuanxue

🤞 Random Luck Deep learning is acturally the alchemy. This repo provides a package to automatically select a random seed based on ancient Chinese Xua

Tong Zhu(朱桐) 33 Jan 03, 2023
Collection of Summer 2022 tech internships!

Collection of Summer 2022 tech internships!

Pitt Computer Science Club (CSC) 15.6k Jan 03, 2023
A web app builds using streamlit API with python backend to analyze and pick insides from multiple data formats.

Data-Analysis-Web-App Data Analysis Web App can analysis data in multiple formates(csv, txt, xls, xlsx, ods, odt) and gives shows you the analysis in

Kumar Saksham 19 Dec 09, 2022
Ultimaker Cura 2 Mooraker Upload Plugin

Klipper & Cura - Cura2MoonrakerPlugin Allows you to upload Gcode directly from Cura to your Klipper-based 3D printer (Fluidd, Mainsailos etc.) using t

214 Jan 03, 2023
Python-samples - This project is to help someone need some practices when learning python language

Python-samples - This project is to help someone need some practices when learning python language

Gui Chen 0 Feb 14, 2022
30 Days of google cloud leaderboard website

30 Days of Cloud Leaderboard This is a leaderboard for the students of Thapar, Patiala who are participating in the 2021 30 days of Google Cloud Platf

Developer Student Clubs TIET 13 Aug 25, 2022
The OpenAPI Specification Repository

The OpenAPI Specification The OpenAPI Specification is a community-driven open specification within the OpenAPI Initiative, a Linux Foundation Collabo

OpenAPI Initiative 25.5k Dec 29, 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
A document format conversion service based on Pandoc.

reformed Document format conversion service based on Pandoc. Usage The API specification for the Reformed server is as follows: GET /api/v1/formats: L

David Lougheed 3 Jul 18, 2022
A next-generation curated knowledge sharing platform for data scientists and other technical professions.

Knowledge Repo The Knowledge Repo project is focused on facilitating the sharing of knowledge between data scientists and other technical roles using

Airbnb 5.2k Dec 27, 2022
sphinx builder that outputs markdown files.

sphinx-markdown-builder sphinx builder that outputs markdown files Please ★ this repo if you found it useful ★ ★ ★ If you want frontmatter support ple

Clay Risser 144 Jan 06, 2023
Swagger Documentation Generator for Django REST Framework: deprecated

Django REST Swagger: deprecated (2019-06-04) This project is no longer being maintained. Please consider drf-yasg as an alternative/successor. I haven

Marc Gibbons 2.6k Jan 03, 2023