Giter Club home page Giter Club logo

openshift-flask-api's Introduction

Openshift Flask Api

This is a simple backend service that combines two api services into one easy to use api.

Model Api

The first api is a model service in which you can make predictions off of a model. This backend is customized to use a solar prediction model. A source to image builder named nachlass is used to convert the model into a REST api. More information on the model iteself can be can be found at its GitHub reop.

You can deploy the model with these commands.

oc new-app quay.io/gkrumbach07/nachless:latest-6~https://github.com/Gkrumbach07/solar_forecaster \
	--build-env S2I_SOURCE_NOTEBOOK_LIST=03-model-training.ipynb \
	--name=model

oc expose svc/model

Next take note of the model url that you just exposed. You can get this address by using the oc get command. To save the address for later commands, use the command bellow.

MODEL_URL=http://$(oc get route/model -o jsonpath='{.spec.host}')

Weather API

This is a third party api service named ClimaCell. You can sign up for free at https://www.climacell.co/pricing/. You will need to find your api key to be able to use this backend service.

Deployment

To run this on Openshift you can run this command in the CLI terminal. Notice we used $MODEL_URL variable name from the command we ran before.

oc new-app centos/python-36-centos7~https://github.com/Gkrumbach07/openshift-flask-api.git \
	-e API_KEY=D0nTsT3Almyk3y \
	-e REACT_APP_MODEL_URL=$MODEL_URL \
	--name=backend

oc expose svc/backend

openshift-flask-api's People

Contributors

gkrumbach07 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.