MySql Docker image creation + python code for access + and Database creation + deployment on Google Kubernetes Engine:
Goal of the project is to prepare the necessary configuration files (yaml, py, docker files,...) to deploy a sample DB in a container on Google Kubernetes Engine (instructions of deployment to be included).
The project is divided into multiple sections:
A. MySQL on docker:
1. Write necessary docker-compose files to Create a docker image with Mysql Server and sample Database. Sample DB to be created at the initialisation (sh or python script required) of the docker image and will have persistance and port expose.
Mysql Server version: 5.7
Users: admin with root access, pythonClient with CRUD access to non-admin tables
Sample DB details (tables, column names and data type for each column) to be provided.
2. Write instruction file to run it all
B. Python Mysql Access:
1. Create python script ([login to view URL]) for CRUD access to the DB (5 functions). A configuration file is needed (will contain db info: ip, user, pass, dbname). Each Function takes the filename as a parameter and what else is needed (table name, column name...).
sample: getData(configurationFileName, table, Key_ColumnName, Key_Value) will return a pandas Dataframe if successful or error code if not.
Needed functions: createTable, deleteTable, getData, putData, deleteData
all functions will receive or return data in Pandas DataFrame format.
2. create a sample code to access [login to view URL] (all functions)
C. Flask on docker:
[login to view URL] a basic Flask server ([login to view URL]) on docker image that uses [login to view URL] to access mysql db on the container (from A) with user access and the following routes (using get/post rest Api access):
createTable, deleteTable, getData, putData, deleteData.
All data returned should be in json format.
docker compose files and other configuration files needed in addition to python files.
2. create a sample python code to call the Flask server using requests module and test all functions (login, createTable, deleteTable, getData, putData, deleteData.). The function calling putData will upload an excel file into dataframe and send it to putData on app.py.
This code can be run from anywhere (not on the cluster or on google).
D. Google Kubernetes Engine deployment:
Create configuration files and instruction files to deploy Mysql and Flask on kubernetes (google Kubernetes Engine) assuming we are starting from scratch (cluster doesn’t exist).
All code should be documented (functions should have comments explain all variables and return values, and main part of the code).
Python 3.6+ should be used
All python code should have [login to view URL] using pipreqs
other skills required: Flask, Docker, Kubernetes, Google Kubernetes Engine