mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
1.5 KiB
1.5 KiB
What's going on?
- worker.rb connects to router and adds routes.
- client.rb connects to router which checks the routing table, proxies the request to one of the destinations and returns the response.
The idea here is that IronWorker backend can tell the router that it started a process and to start routing requests.
Usage
iron worker upload --name hello-sinatra --host YOURHOST treeder/hello-sinatra
Then hit the url:
http://router.iron.io/?rhost=YOURHOST
Todo
This is just a simple prototype. To get to production would need:
- Ability to start new workers based on some auto scaling scheme.
- Authentication (same as always).
Testing for reals on staging
1) Deploy router
Using DockerJockey:
dj run --on aws -i --name router -v "$(pwd)":/app -w /app -p 80:8080 treeder/golang-ubuntu:1.3.3on14.04 ./router
2) Update DNS
Update DNS entry router.iron.io to point to the newly launched server after dj deploy.
Or SimpleDeployer:
- start router.go on remote server (there's a test project on SD already:
- go build ./src/router; sudo ./router
- iron_worker upload -e staging --project-id 515b657bc731ff1e69000917 --host routertest-staging.irondns.info sinatra
- visit http://routertest.iron.io (or ruby client.rb)
- BOOM!
Deploying to production
- just deploy as normal from SD project
- use routertest.irondns.info for host