Code Monkey home page Code Monkey logo

rl_tournament's People

Contributors

gjp1203 avatar gpdwatkins avatar jamesbut avatar kncrane avatar nbarlowati avatar oruburos avatar tomaslaz avatar vakker avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rl_tournament's Issues

Battleground loses connection to RabbitMQ

A recent test run failed after a couple of Games, with the following output:

plark_battleground | 2021-02-18 14:36:57,613 [INFO] Battle begins!
plark_battleground | INFO:battleground_logger:Battle begins!
plark_battleground | WARNING:imageio_ffmpeg:IMAGEIO FFMPEG_WRITER WARNING: input image is not divisible by macro_block_size=16, resizing from (512, 412) to (512, 416) to ensure video compatibility with most codecs and players. To prevent resizing, make your input image divisible by the macro_block_size or set the macro_block_size to 1 (risking incompatibility).
plark_battleground | 2021-02-18 14:36:57,686 [INFO] Pelican's move
plark_battleground | INFO:battleground_logger:Pelican's move
plark_battleground | ERROR:pika.adapters.utils.io_services_utils:_AsyncBaseTransport._produce() failed, aborting connection: error=ConnectionResetError(104, 'Connection reset by peer'); sock=<socket.socket fd=30, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.21.0.5', 35426)>; Caller's stack:
plark_battleground | Traceback (most recent call last):
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 1097, in _on_socket_writable
plark_battleground |     self._produce()
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 820, in _produce
plark_battleground |     self._tx_buffers[0])
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 79, in retry_sigint_wrap
plark_battleground |     return func(*args, **kwargs)
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 861, in _sigint_safe_send
plark_battleground |     return sock.send(data)
plark_battleground | ConnectionResetError: [Errno 104] Connection reset by peer
plark_battleground | Traceback (most recent call last):
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 1097, in _on_socket_writable
plark_battleground |     self._produce()
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 820, in _produce
plark_battleground |     self._tx_buffers[0])
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 79, in retry_sigint_wrap
plark_battleground |     return func(*args, **kwargs)
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/utils/io_services_utils.py", line 861, in _sigint_safe_send
plark_battleground |     return sock.send(data)
plark_battleground | ConnectionResetError: [Errno 104] Connection reset by peer
plark_battleground | INFO:pika.adapters.utils.io_services_utils:_AsyncTransportBase._initate_abort(): Initiating abrupt asynchronous transport shutdown: state=1; error=ConnectionResetError(104, 'Connection reset by peer'); <socket.socket fd=30, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.21.0.5', 35426)>
plark_battleground | INFO:pika.adapters.utils.io_services_utils:Deactivating transport: state=1; <socket.socket fd=30, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.21.0.5', 35426)>
plark_battleground | ERROR:pika.adapters.base_connection:connection_lost: StreamLostError: ("Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')",)
plark_battleground | INFO:pika.connection:AMQP stack terminated, failed to connect, or aborted: opened=True, error-arg=StreamLostError: ("Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')",); pending-error=None
plark_battleground | INFO:pika.connection:Stack terminated due to StreamLostError: ("Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')",)
plark_battleground | INFO:pika.adapters.utils.io_services_utils:Closing transport socket and unlinking: state=2; <socket.socket fd=30, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.21.0.5', 35426)>
plark_battleground | ERROR:pika.adapters.blocking_connection:Unexpected connection close detected: StreamLostError: ("Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')",)
plark_battleground | Traceback (most recent call last):
plark_battleground |   File "run_match.py", line 14, in <module>
plark_battleground |     bg.play()
plark_battleground |   File "/rl_tournament/battleground/battleground.py", line 155, in play
plark_battleground |     game.play(match_id=self.match_id, video_file_path=video_filename)
plark_battleground |   File "/rl_tournament/battleground/battleground.py", line 400, in play
plark_battleground |     state, output = self.game_step(None)
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/plark_game/classes/newgame.py", line 103, in game_step
plark_battleground |     self.pelicanPhase()
plark_battleground |   File "/rl_tournament/battleground/battleground.py", line 324, in pelicanPhase
plark_battleground |     pelican_action = self.get_agent_action("PELICAN")
plark_battleground |   File "/rl_tournament/battleground/battleground.py", line 309, in get_agent_action
plark_battleground |     body=json.dumps(serialized_game_state),
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/blocking_connection.py", line 2248, in basic_publish
plark_battleground |     self._flush_output()
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/blocking_connection.py", line 1336, in _flush_output
plark_battleground |     self._connection._flush_output(lambda: self.is_closed, *waiters)
plark_battleground |   File "/usr/local/lib/python3.6/dist-packages/pika/adapters/blocking_connection.py", line 522, in _flush_output
plark_battleground |     raise self._closed_result.value.error
plark_battleground | pika.exceptions.StreamLostError: Stream connection lost: ConnectionResetError(104, 'Connection reset by peer')

Looking at pika/pika#1224 perhaps we can avoid this by disabling the "heartbeat" in pika.connection (not recommended), or putting an "interval" in

conn.process_data_events(time_limit=interval)

?

Documentation

  • Documentation for participants on how to create and upload their docker images.
  • Documentation on how to run the tournament.

Method for putting agents into Docker containers

  • Agent could be a zip file plus json metadata (if it is the output of a model), OR a python file, or all of these, if it has some programmatic logic.
  • Write Makefile with test (test that we get an action back from the agent).

Enable agents to be made into docker images, and tested.

A way for researchers to develop their agents in Docker containers:

  • Bash script or Makefile to put agents (zip files + json files, .py file?) into "Combatant" Docker container.
  • Include test to check that agents will work in environment, before uploading. (Give state, expect back an action).
  • Need way to communicate to Battle (and DB) the name of the agent and name of the team - naming convention for Docker image? Metadata inside Docker image?
  • How can we ensure people can only push images that they are allowed to (labels?)

How to decide when match is finished and do docker-compose down?

We need a way of stopping a match when all the games have been played. If we have "run_match.sh" as the command for the battleground container, then that container will exit after the match, but the combatants will continue waiting for messages.

Could have a process that periodically checks the database, to see if the number of games matches num_games?

Frontend

  • Front-end visualisation for tournament results.
  • Can make use of API that has endpoints to query database.
  • Show grid/table-like view of match results for each days tournament
  • Ideally have a way to click and see details of individual matches/games, and download logfiles or videos.

Overview

Bare minimum:

  • A way for researchers to develop their agents in Docker containers #7
  • DB for storing tournament results and logs
    • Design schema
    • Decide on technology (postgres+SQLAlchemy? Something new - data lakes?). Can we store logfiles as strings? (How big are they?)
  • Front end for researchers to see the contents of the DB
    • Flask? Azure webapps to host.
    • plot.ly for visualizations?
    • What to show?
      • Table with rows/columns for each team's agent
      • Knockout tournament tree diagram
      • Get back to logfiles (maybe)
      • Get access to Docker images (maybe)
  • End of the day tournament scheduler
    • Container orchestration
    • Cron job + bash script? Azure functions (python)?
  • Baseline agents
  • Battle code
    • Read/Write to DB
  • Infrastructure on Azure #11
  • Trial run
  • Paper? JOSS?

Deadlines

  • Main event is 1-12 March - need everything ready by then.
  • 19th February preview event
  • Ensure Azure environments for researchers can be setup, method for them to create containers is well established.
  • 26th February: overview event
    • Would be good to have everything ready (not necessarily polished).

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.