Skip to content

Instantly share code, notes, and snippets.

View jerowe's full-sized avatar

Jillian Rowe jerowe

View GitHub Profile
easyblock = 'Conda'
name = 'gencore_dev'
version = '1.0'
homepage = 'https://github.com/biosails/'
description = """ Live on the bleeding edge with gencore software. """
toolchain = {'name': 'dummy', 'version': ''}
import matplotlib.pyplot as plt
import numpy as np
from sklearn import datasets, linear_model, preprocessing
from sklearn.metrics import mean_squared_error, r2_score
import pandas as pd
import json
def parse_devstar_summary(summary_path):
"""
@jerowe
jerowe / python-flask-dockerfile.Dockerfile
Last active January 10, 2019 17:37
Build a flask app in a docker container
FROM continuumio/miniconda3:4.5.11
RUN apt-get update -y; apt-get upgrade -y
# You don't technically need these, but I get kind of twitchy if I don't have vim installed
RUN apt-get install -y vim-tiny vim-athena ssh
# Add a user and switch, using the default root user is BAD
RUN adduser --home /home/flask flask
@jerowe
jerowe / flask-app-environment.yml
Last active January 12, 2019 07:54
conda-env flask app
name: flask-app
channels:
- conda-forge
- defaults
dependencies:
- python=3.6
- flask-cors
- flask-restful
- ipython
- gunicorn
from flask import Flask
from flask import jsonify, request
from flask_cors import CORS, cross_origin
import json
app = Flask(__name__)
CORS(app, allow_headers=['Content-Type', 'Access-Control-Allow-Origin',
'Access-Control-Allow-Headers', 'Access-Control-Allow-Methods'])
#!/usr/bin/env bash
set -x -e
gunicorn --workers=2 --bind=0.0.0.0:5000 --keep-alive=2000 --timeout=2000 --log-level=debug flask_app:app
FROM continuumio/miniconda3:4.5.11
RUN apt-get update -y; apt-get upgrade -y
# You don't technically need these, but I get kind of twitchy if I don't have vim installed
RUN apt-get install -y vim-tiny vim-athena ssh
# Add a user and switch, using the default root user is BAD
RUN adduser --home /home/flask flask
version: '3'
services:
flask-app-server:
build:
context: flask_app
dockerfile: Dockerfile
ports:
- "5000:5000"
volumes:
@jerowe
jerowe / Dockerrun.aws.json
Created January 26, 2019 13:41
deploy-python-flask-docker-series-Dockerrun.aws.json
{
"AWSEBDockerrunVersion": 2,
"volumes": [
],
"containerDefinitions": [
{
"name": "flask-app-server",
"image": "quay.io/jerowe/flask-app-server:latest",
"update": true,
"essential": true,
@jerowe
jerowe / docker-compose.yml
Created February 6, 2019 13:19
Deploy a full stack flask and angular app with traefik
version: '3'
# Run as
# docker-compose build; docker-compose up -d
# Check with
# docker ps
# Then check the logs with
# docker logs --tail 50 $container_id
# docker-compose logs --tail 20 tf_counts