- ๐ญ Iโm currently working at Heroku, rebooting databases.
- ๐ฌ Ask me about ruby, postgres and travelling.
- ๐ซ How to reach me: [email protected]
beanieboi / docker-than-light Goto Github PK
View Code? Open in Web Editor NEWDocker Hackday 2015
Docker Hackday 2015
This should support calling
Connection info is "http://#{ship.addr}:#{ship.port}". This is assuming the addr we have stored is the HOST address not the container address, which I think it is...? This cannot be the swarm address.
Support a more complex and customizable simulation
After a user submits a form the God api should connect to one of the swarm nodes using the docker client, and create a proxy container to create the ship. Once this exists with zero and the container Id and host info, the god api should store that info in the ship model
These should include our samples as well as any community ones added via PR. This sound be linked to on the submission for so people dont just start redis
When a ship fires on another ship, the God api should determine
And then
Every time a ship moves sectors, or fires, or is destroyed, it should create a sector-wide event. These events should be sent out from the god api to all users viewing logs and be replayable.
We could just have an events model for this, but maybe there is a better way.
Maybe not replayable for mvp?
The goal here is to have this information populate in the /logs view as events occur, so as the God api mediates, it can dispatch event notifications. These are purely informational and non-functional.
This page should stream logs aggregated from the ship and the sector, (maybe two panels) returned via a websocket from the god api.
The god api will stream logs from the container via the docker client using the info stored for the ship when it was created, as well events popping in for the relevant sector
I borked it!
ActionController::RoutingError (uninitialized constant Application::ShipsController)
Unsure why this is happening, not doing anything weird with the ships controller that was not done with the dashboards controller.
2016-03-23T02:38:58.602152+00:00 app[web.1]: Started POST "/ships" for 72.182.15.101 at 2016-03-23 02:38:58 +0000
2016-03-23T02:38:58.604961+00:00 app[web.1]:
2016-03-23T02:38:58.604971+00:00 app[web.1]: ActionController::RoutingError (uninitialized constant Application::ShipsController):
2016-03-23T02:38:58.604972+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:263:in `const_get'
2016-03-23T02:38:58.604973+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:263:in `block in constantize'
2016-03-23T02:38:58.604974+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `each'
2016-03-23T02:38:58.604975+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `inject'
2016-03-23T02:38:58.604976+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/inflector/methods.rb:259:in `constantize'
2016-03-23T02:38:58.604977+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:70:in `controller_reference'
2016-03-23T02:38:58.604977+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:60:in `controller'
2016-03-23T02:38:58.604978+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:39:in `serve'
2016-03-23T02:38:58.604979+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:43:in `block in serve'
2016-03-23T02:38:58.604980+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `each'
2016-03-23T02:38:58.604980+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/journey/router.rb:30:in `serve'
2016-03-23T02:38:58.604981+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/routing/route_set.rb:817:in `call'
2016-03-23T02:38:58.604982+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:186:in `call!'
2016-03-23T02:38:58.604983+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/strategy.rb:164:in `call'
2016-03-23T02:38:58.604984+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/omniauth-1.3.1/lib/omniauth/builder.rb:63:in `call'
2016-03-23T02:38:58.604985+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/etag.rb:24:in `call'
2016-03-23T02:38:58.604985+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/conditionalget.rb:38:in `call'
2016-03-23T02:38:58.604986+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/head.rb:13:in `call'
2016-03-23T02:38:58.604987+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2016-03-23T02:38:58.604988+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/flash.rb:260:in `call'
2016-03-23T02:38:58.604988+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:225:in `context'
2016-03-23T02:38:58.604989+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/session/abstract/id.rb:220:in `call'
2016-03-23T02:38:58.604990+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/cookies.rb:560:in `call'
2016-03-23T02:38:58.604990+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/query_cache.rb:36:in `call'
2016-03-23T02:38:58.604992+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:653:in `call'
2016-03-23T02:38:58.604992+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
2016-03-23T02:38:58.604993+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:88:in `__run_callbacks__'
2016-03-23T02:38:58.604994+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
2016-03-23T02:38:58.604994+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/callbacks.rb:81:in `run_callbacks'
2016-03-23T02:38:58.604995+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
2016-03-23T02:38:58.604996+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
2016-03-23T02:38:58.604996+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
2016-03-23T02:38:58.604997+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
2016-03-23T02:38:58.604998+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/rack/logger.rb:38:in `call_app'
2016-03-23T02:38:58.604999+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/rack/logger.rb:20:in `block in call'
2016-03-23T02:38:58.604999+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2016-03-23T02:38:58.605000+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:26:in `tagged'
2016-03-23T02:38:58.605001+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/tagged_logging.rb:68:in `tagged'
2016-03-23T02:38:58.605001+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/rack/logger.rb:20:in `call'
2016-03-23T02:38:58.605006+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/request_id.rb:21:in `call'
2016-03-23T02:38:58.605006+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/methodoverride.rb:22:in `call'
2016-03-23T02:38:58.605007+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/runtime.rb:18:in `call'
2016-03-23T02:38:58.605008+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/activesupport-4.2.6/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
2016-03-23T02:38:58.605008+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/static.rb:120:in `call'
2016-03-23T02:38:58.605009+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/rack-1.6.4/lib/rack/sendfile.rb:113:in `call'
2016-03-23T02:38:58.605010+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/actionpack-4.2.6/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2016-03-23T02:38:58.605010+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/engine.rb:518:in `call'
2016-03-23T02:38:58.605011+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/railties-4.2.6/lib/rails/application.rb:165:in `call'
2016-03-23T02:38:58.605012+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/puma-3.1.1/lib/puma/configuration.rb:227:in `call'
2016-03-23T02:38:58.605013+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/puma-3.1.1/lib/puma/server.rb:561:in `handle_request'
2016-03-23T02:38:58.605013+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/puma-3.1.1/lib/puma/server.rb:406:in `process_client'
2016-03-23T02:38:58.605014+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/puma-3.1.1/lib/puma/server.rb:271:in `block in run'
2016-03-23T02:38:58.605015+00:00 app[web.1]: vendor/bundle/ruby/2.3.0/gems/puma-3.1.1/lib/puma/thread_pool.rb:111:in `block in spawn_thread'
2016-03-23T02:38:58.605016+00:00 app[web.1]:
2016-03-23T02:38:58.605016+00:00 app[web.1]:
Logs view should use application tempate and render logs in a 1000 row subsection
Ship sending a scan request for the sector or ships should lose some energy but receive lists of ships
OR details on a specific ship like health and power. This sohuld send a scan notification to the target ship
We need a public container we can run on a node in our cluster, which reaches out to the swarm cluster and performs privileged actions. Since no apis exist for this, and we will be remote this will have to be a container.
Container needs to have docker experimental client, and it'll have to be run with the DOCKER_HOST and certs for the swarm master node. Running it should execute the docker cluster change as needed.
These changes include
the image should be run with the following args, some of which are optional for remove:
Move is a combination of start and stop, and tt should execute the following changes:
verify current network is not desired network
docker rm -f CONTAINER_ID
docker run --publish-service CONTAINER_NAME.DESIRED_NETWORK --name CONTAINER_NAME -tid CONTAINER_IMAGE
return the new CONTAINER_ID and HOST_IP
Not part of MVP
This should pass down the initial ship state as well as the simulation rules
Everything a ship can do should take time
Make a simply list of appropriate time and energy costs for the different actions.
This should include globals such as starting health and energy, weapon damage, charge rates, max fire rates etc. These will be balanced as we go on
Depends on #6
This will only be used for pulling logs from specific containers, and for executing the experimental control container to create/move/destroy ships from the cluster
Depends on #6
Not part of MVP necessarily
I dont think this is done already (or if it is I dont have access)
Any time a ships health drops to zero, the container should be killed, and the ship should be marked as kill. The websocket should be closed and the user notified and invited to respawn
We need a sector seed, model and basic join between ships and sectors.
We will also need to facilitate "scanning" of sectors and of ships. Unsure if this should be on the ship/sector model though
We need to find a way to secure (or intentionally not fully secure) the api. Currently ships are hitting the api and being asked to log in. We can
As a ship, if I have sufficient energy (decide how much that is), and I make a request to the God api to move sectors, the God api should shut down my container and move me to a new sector, and start me up again.
Logs should not be interrupted (but maybe old logs are lost for now
Depends on #2
Not part of MVP
Currently due to the way caraina works we can't hit the containers directly since our master API is outside the private network. We need to stick a container proxy in, or assign public IPs to each container (meh).
Ship state updates should be included in state changes such as scanning and firing in the response to the ship, however if the ship does not act for a while there could be some drift in understanding.
Every 1 minute without action we should tell the ship what its current state is to sync understanding.
Not part of MVP
:( I cant figure it out, see branch minor fixes, tried limiting sidekiq conns but no luck
Depends on #6
We need to create a simple Go ship scaffold that meets the basic API requirements as defined in the README. This ship does not have to do anything, but must not be destroyed by the God api due to lack of responses.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.