Giter VIP home page Giter VIP logo

app-runner's Introduction

App Runner

A self-hosted platform-as-a-service that hosts web apps written in Java, Clojure, NodeJS, Python, golang, Scala and .NET Core. Designed to be simple to deploy behind a firewall, on corporate intranets or at home. Once running, tell App Runner the Git URL of a web app and it will automatically build and host it for you, with support to auto-deploy on every git push.

Features

  • Host your own Platform as a Service: you just need Java 8, plus optional build tools (Maven, Leinigen, Scala/SBT, go compiler, NodeJS/NPM, Gradle, Python 2 or 3, .NET Core SDK).
  • Deploy web apps with no build servers or deploy scripts needed: tell AppRunner the Git URL and it will automatically build and host it.
  • Auto deploy on source control change when using post-commit hooks
  • Zero downtime deployment: when changes are being deployed, a new instance is built, tests are run, and the app is started. Only when the new instance is running will it be made live.
  • An optional dashboard which links to all your apps making it easy to find, add, and deploy.
  • Horizontally scale individual app runners across multiple machines with App Runner Router

Who is this for?

App Runner is especially useful for people or teams who are creating many little web applications and want the convenience of a platform such as Heroku but cannot use an external service.

Change log

  • 2.3.0 Breaking golang change: it now uses go modules. Also, the default branch no longer needs to be called master
  • 2.2.0 Bug fixes, particularly the one where apps were sometimes not shutting down.
  • 2.1.0 Added let's encrypt (and other ACME server) support for free HTTPS certs (see sample-config.properties for instructions)
  • 1.6.0 Added GET/POST/DELETE /api/v1/apps/{name}/data endpoints to manipulate an app's data directory.
  • 1.5.6 Added backup info to the apps API and added app name validation
  • 1.5.4 Added optional config for handling proxy timeouts: apprunner.proxy.idle.timeout (default 30000ms) apprunner.proxy.total.timeout (default 60000ms).
  • 1.5.1 Fixed bug where sometimes creating a new app it would say there are no suitable runners, even though there are. Also added lastBuild and lastSuccessfulBuild to the app API to provide information about when and what was built (the git commit info is included).
  • 1.4.0 Added a PUT /apps/{name} method to change the GIT URL of an app, and made it so POSTing an app to /apps that already exists returns a 400 error. Also fixed the return type (to application/json) for POST /apps. There is also --app-name=your-app-name passed as a command line parameter to Node apps, mostly to aid in finding which app is which when looking at running processes.
  • 1.3.4 GoLang support
  • 1.2.2 Support for HTTPS (see the sample config file for more info). This is also the first version that HTTPS can be used on the app runner router (or other reverse proxies).
  • 1.1.0 Optional support for Scala and better reporting of versions of tools such as java, node, lein etc. When adding a new app, it is immediately cloned and an error is returned if it cannot be cloned or this instance does not support the project type.
  • 1.0.7 Optional backup support: specify a Git URL in the config (appserver.backup.url) to have the data directory backed up to a git repo once an hour.

Running locally

Run com.danielflower.apprunner.RunLocal.main from your IDE. This will use the settings in sample-config.properties. Upon startup, it will try to download, build, and deploy the application specified in the config. Launch the URL that is logged on startup see the hosted sample app.

Deploying

You need to have a Windows or Linux server available with Java 8 or later and one or more build tools installed. One or more of Maven, Gradle, Leiningen, NodeJS with NPM, Scala with SBT, GoLang, Python 2 or 3.

It's easiest if each tool is available to run from the path, but you can point to specific paths by setting paths in your config file.

Download the latest version of App Runner from Maven central

Run with java -jar app-runner-{version}.jar /path/to/config.properties

See sample-config.properties for sample configuration. The local directory in this repo also has sample start scripts and logging configuration.

Build Status

Contribute

You will also need to provide M2_HOME=/path/to/maven/home before you run source code and test cases.

app-runner's People

Contributors

caca0513 avatar cosm1c avatar danielflower avatar dependabot[bot] avatar jackkcwong avatar janerikazhang avatar lawrenceching avatar leeworrall avatar mepants avatar michaeldeluna avatar ninj avatar stephenrbenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

app-runner's Issues

Apprunner on Kubernetes

Daniel, not sure Kubernetes is an option in your current $work, I am submitting this issue simply for ideas.

The current apprunner solves CICD problems to a virtual machine. However, most enterprises move their workload to Kubernetes to host their applications. it looks like a good idea to have a similar tool in k8s that solves the deployment and setup overhead so developers can deploy code as fast as possible to a live environment.

Most of the components should still work in the current apprunner architecture

  • I suppose we do not need apprunner-router which should be replaced by ingress gateway & K8s Service
  • APPs can be distributed to k8s worker nodes and have multiple instances to get high availabilities(using deployments).

Can't startup the app runner home

After downloading the source code and had tried to startup the app runner home, it hints the below error message. It seems that the Maven runner doesn't work.
Could you kindly us on how to configure the Maven and Java provider?

com.danielflower.apprunner.runners.UnsupportedProjectTypeException: No app runner found for app-runner-home
at com.danielflower.apprunner.runners.AppRunnerFactoryProvider.runnerFor(AppRunnerFactoryProvider.java:54)
at com.danielflower.apprunner.AppEstate.addApp(AppEstate.java:63)
at com.danielflower.apprunner.App.start(App.java:71)
at com.danielflower.apprunner.App.main(App.java:191)
at com.danielflower.apprunner.RunLocal.main(RunLocal.java:10)

github clone during app creation is not reliable

When using the API to create an app, if the GitHub repository is very new (eg. Created by the same process that calls the API) it seems there is a timing issue which causes the HEAD branch not to be found.

The creation fails with the API returning:
Response code 400

{
 "message": "Could not clone git repository: Remote branch 'HEAD' not found in upstream origin",
"gitUrl": "(SSH URL of new repo)"
}

The failure would appear to occur in AppManager.java in the create(..) method at the point of the Git.cloneRepository()

It would be useful to have the option to wait/retry the clone.

Unfortunately it is unlikely a reliable test case could be created for recreation of the issue.

M2_HOME

setting M2_HOME inside config.properties does not seem to work - it only works if M2_HOME is exported as an environment variable.

How to remove App

I am newbie on app-runner.
I have created some apps for test, and want to remove them, but can not find the delete button on the webpage. could you please advise?

Can I use wsgi server in python web apps?

For python web apps it is usually run behind a wsgi server like gunicorn which uses child processes to serve concurrent requests.
But the python sample app seems to suggest not to use child processes in app runner. Or is this just peculiar to Flask?

#Set debug=False and threaded=True to prevent Flask forking a child process that doesn't get shut down

Fail to startup in centOS with 'connection refuse'

Tried to start it in a centOS7 but got below error, any idea?
appRunner.txt

11:39:19.727 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED @134008ms org.eclipse.jetty.io.ManagedSelector@38353cb4 id=0 keys=0 selected=0
11:39:19.727 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED @134009ms org.eclipse.jetty.client.AbstractHttpClientTransport$ClientSelectorManager@272fd214
11:39:19.727 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED @134009ms org.eclipse.jetty.client.http.HttpClientTransportOverHTTP@57471333
11:39:19.727 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED @134009ms org.eclipse.jetty.client.HttpClient@524bd875
11:39:20.245 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - org.eclipse.jetty.client.HttpClient@524bd875 added {HttpDestination[http://localhost:42557]@6606349c,queue=0,pool=null,MANAGED}
11:39:20.250 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - starting HttpDestination[http://localhost:42557]@6606349c,queue=0,pool=null
11:39:20.258 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.ContainerLifeCycle - HttpDestination[http://localhost:42557]@6606349c,queue=0,pool=DuplexConnectionPool@3531ffd3[c=0/64,a=0,i=0] added {DuplexConnectionPool@3531ffd3[c=0/64,a=0,i=0],POJO}
11:39:20.260 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.component.AbstractLifeCycle - STARTED @134541ms HttpDestination[http://localhost:42557]@6606349c,queue=0,pool=DuplexConnectionPool@3531ffd3[c=0/64,a=0,i=0]
11:39:20.267 [pool-4-thread-1] DEBUG org.eclipse.jetty.client.HttpClient - Created HttpDestination[http://localhost:42557]@6606349c,queue=0,pool=DuplexConnectionPool@3531ffd3[c=0/64,a=0,i=0]
11:39:20.282 [pool-4-thread-1] DEBUG org.eclipse.jetty.client.HttpDestination - Queued HttpRequest[GET /app-runner-home/ HTTP/1.1]@640ae19a for HttpDestination[http://localhost:42557]@6606349c,queue=1,pool=DuplexConnectionPool@3531ffd3[c=0/64,a=0,i=0]
11:39:20.285 [pool-4-thread-1] DEBUG org.eclipse.jetty.client.AbstractConnectionPool - Connection 1/64 creation
11:39:20.311 [pool-4-thread-1] DEBUG org.eclipse.jetty.util.thread.QueuedThreadPool - queue org.eclipse.jetty.util.SocketAddressResolver$Async$$Lambda$48/1724759036@7d72bf0e
11:39:20.323 [HttpClient@1380702325-68] DEBUG org.eclipse.jetty.util.thread.QueuedThreadPool - run org.eclipse.jetty.util.SocketAddressResolver$Async$$Lambda$48/1724759036@7d72bf0e
11:39:20.333 [HttpClient@1380702325-68] DEBUG org.eclipse.jetty.util.SocketAddressResolver - Resolved localhost in 0 ms
11:39:20.374 [HttpClient@1380702325-68] DEBUG org.eclipse.jetty.io.ManagedSelector - Queued change org.eclipse.jetty.io.ManagedSelector$Connect@39733ca5 on org.eclipse.jetty.io.ManagedSelector@38353cb4 id=0 keys=0 selected=0
11:39:20.378 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop woken up from select, 0/0 selected
11:39:20.378 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Running action org.eclipse.jetty.io.ManagedSelector$Connect@39733ca5
11:39:20.379 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop waiting on select
11:39:20.379 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop woken up from select, 1/1 selected
11:39:20.379 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - selected sun.nio.ch.SelectionKeyImpl@3b93f80f org.eclipse.jetty.io.ManagedSelector$Connect@39733ca5
11:39:20.381 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.client.HttpClientTransport - Could not connect to HttpDestination[http://localhost:42557]@6606349c,queue=1,pool=DuplexConnectionPool@3531ffd3[c=1/64,a=0,i=0]
11:39:20.381 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Queued change org.eclipse.jetty.io.ManagedSelector$Connect@4f2579e7 on org.eclipse.jetty.io.ManagedSelector@38353cb4 id=0 keys=1 selected=1
11:39:20.381 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Running action org.eclipse.jetty.io.ManagedSelector$Connect@4f2579e7
11:39:20.381 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop waiting on select
11:39:20.381 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop woken up from select, 1/1 selected
11:39:20.382 [HttpClient@1380702325-68] DEBUG org.eclipse.jetty.util.thread.QueuedThreadPool - ran org.eclipse.jetty.util.SocketAddressResolver$Async$$Lambda$48/1724759036@7d72bf0e
11:39:20.382 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - selected sun.nio.ch.SelectionKeyImpl@6b52a38c org.eclipse.jetty.io.ManagedSelector$Connect@4f2579e7
11:39:20.384 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.client.HttpClientTransport - Could not connect to HttpDestination[http://localhost:42557]@6606349c,queue=1,pool=DuplexConnectionPool@3531ffd3[c=1/64,a=0,i=0]
11:39:20.396 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.client.AbstractConnectionPool - Connection 1/64 creation failed
java.net.ConnectException: 拒绝连接
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.eclipse.jetty.io.SelectorManager.doFinishConnect(SelectorManager.java:320)
at org.eclipse.jetty.io.ManagedSelector.processConnect(ManagedSelector.java:418)
at org.eclipse.jetty.io.ManagedSelector.access$1000(ManagedSelector.java:60)
at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.processSelected(ManagedSelector.java:350)
at org.eclipse.jetty.io.ManagedSelector$SelectorProducer.produce(ManagedSelector.java:244)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:147)
at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produce(ExecuteProduceConsume.java:97)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:672)
at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:590)
at java.lang.Thread.run(Thread.java:748)
11:39:20.412 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.client.HttpExchange - Failed HttpExchange@52c407a2 req=COMPLETED/java.net.ConnectException: 拒绝连接@4e42d053 res=COMPLETED/java.net.ConnectException: 拒绝连接@4e42d053: req=true/rsp=true {}
11:39:20.419 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.client.HttpExchange - Aborting while queued HttpExchange@52c407a2 req=COMPLETED/java.net.ConnectException: 拒绝连接@4e42d053 res=COMPLETED/java.net.ConnectException: 拒绝连接@4e42d053: {}
11:39:20.430 [pool-4-thread-1] INFO com.danielflower.apprunner.runners.Waiter - Waiting for start up of app-runner-home
11:39:20.430 [HttpClient@1380702325-67] DEBUG org.eclipse.jetty.io.ManagedSelector - Selector loop waiting on select

OCaml support

I've forked the repo with the intent of adding OCaml / opam support to AppRunner.

Looking at @mepants Rust changes as a prototype - is this reasonable?

One thought did strike me - in the same way restabuild simplifies everything down to executing build.sh, we could imagine an app-runner app with a generic build.sh & run.sh to avoid having to implement language support in the core. Anything that can be built with a script and run with a script would then be in scope, rather than individual languages. The environment conventions would remain ofc.

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.