Skip to content

Instantly share code, notes, and snippets.

View gandroz's full-sized avatar

Guillaume Androz gandroz

View GitHub Profile
@gandroz
gandroz / docker-compose.yml
Last active August 14, 2020 19:00
Docker compose file to deploy MLflow tracking server
version: '3.3'
services:
db:
restart: always
image: mysql/mysql-server:5.7.28
container_name: mlflow_db
expose:
- "3306"
networks:
@gandroz
gandroz / nginx.conf
Created January 10, 2020 14:22
Nginx configuration file
# Define the user that will own and run the Nginx server
user nginx;
# Define the number of worker processes; recommended value is the number of
# cores that are being used by your server
worker_processes 1;
# Define the location on the file system of the error log, plus the minimum
# severity to log messages for
error_log /var/log/nginx/error.log warn;
# Define the file that will store the process ID of the main NGINX process
@gandroz
gandroz / mlflow.conf
Last active January 10, 2020 19:30
MLflow server configuration
# Define the parameters for a specific virtual host/server
server {
# Define the server name, IP address, and/or port of the server
listen 80;
# Define the specified charset to the “Content-Type” response header field
charset utf-8;
# Configure NGINX to reverse proxy HTTP requests to the upstream server (uWSGI server)
location / {
@gandroz
gandroz / Dockerfile
Created January 10, 2020 14:25
Docker file for MLflow
FROM python:3.7-slim-buster
# Install python packages
RUN pip install mlflow boto3 pymysql
@gandroz
gandroz / Dockerfile
Created January 10, 2020 14:26
Dockerfile for nginx
FROM nginx:1.17.6
# Remove default Nginx config
RUN rm /etc/nginx/nginx.conf
# Copy the modified Nginx conf
COPY nginx.conf /etc/nginx
# Copy proxy config
COPY mlflow.conf /etc/nginx/sites-enabled/
@gandroz
gandroz / app.py
Created February 21, 2020 21:24
gitlab_snippet
def squares(x):
# Perform calculus
y = x**2
return y
if __name__ == "__main__":
print(f"The square of 10 is: {squares(10)}")
@gandroz
gandroz / test.py
Created February 21, 2020 21:25
gitlab_snippet
"""
Unit testing of the automatic batch processing application
"""
import unittest
from src.app import squares
class AppTests(unittest.TestCase):
def test_app(self):
"""Simple Tests"""
@gandroz
gandroz / .gitlab-ci.yml
Created February 21, 2020 21:26
gitlab_snippet
image: python:3.6-slim
before_script:
- python -V # Print out python version for debugging
stages:
- test
test_job:
stage: test
@gandroz
gandroz / buildspec.yml
Created April 9, 2020 02:19
buildspec yaml file
version: 0.2
phases:
install:
runtime-versions:
python: 3.8
pre_build:
commands:
- apt-get install -y python3-venv
- python3.6 -m venv test_venv
@gandroz
gandroz / codebuild.json
Created April 9, 2020 02:26
codebuild json builder file
{
"name": "Dummy Project Tests",
"description": "Script for CodeBuild creation",
"source": {
"type": "BITBUCKET",
"location": "https://bitbucket.org/myself/dummy_project.git",
"gitCloneDepth": 1,
"auth": {
"type": "OAUTH",
"resource": "arn:aws:codebuild:ca-central-1:123456789:token/bitbucket"