Code Monkey home page Code Monkey logo

serratus-summary-api's Introduction

serratus-summary-api

Example routes

Local usage

Setup

Add file env.sh:

export SQL_USERNAME=web_api
export SQL_PASSWORD=serratus
# [optional] create/load virtualenv
pip install -r requirements.txt

Start server

bash run.sh

Test

bash test.sh

AWS Setup

Elastic Beanstalk

  • Application name: serratus-summary-api-flask
  • Environment
    • Web server environment
    • Name: serratus-summary-api
    • Platform: Python (3.7 running on 64bit Amazon Linux 2)
    • Sample app (will be overidden by CodePipeline deployment)

After creation:

  • Add load balancer listener
    • Port: 443
    • Protocol: HTTPS
    • SSL certificate: *.serratus.io
  • Processes
    • Health check path: /summary/nucleotide/run=ERR2756788
  • Environment variables
    • Add SQL_USERNAME, SQL_PASSWORD from to env.sh

CodePipeline

  1. Settings
    • Pipeline name: serratus-summary-api-flask
    • New service role
  2. Source stage
    • Source provider: GitHub (Version 1)
    • Select this repo/branch
    • Change detection: GitHub webhooks
  3. Build stage: skip
  4. Deploy stage
    • Provider: AWS Elastic Beanstalk
    • Region: us-east-1
    • Application/environment names from above

Route 53

  • A record for api.serratus.io -> Elastic Beanstalk endpoint

RDS

See https://github.com/ababaian/serratus/wiki/Serratus-SQL-Database-Management

Debugging

  • Disable caches: in config.py set CACHE_DEFAULT_TIMEOUT = 1 (timeout after 1 second)

TODO

  • /protein/*
  • /rdrp/*
  • handle timeouts e.g.

    DatabaseError: current transaction is aborted, commands ignored until end of transaction block

  • investigate CACHE_TYPE = 'filesystem' and CACHE_THRESHOLD

serratus-summary-api's People

Contributors

almosnow avatar lukepereira avatar victorlin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.