Git Product home page Git Product logo

18w-si32's People

Contributors

gabeboning avatar paul-spangfort avatar robinjayaswal avatar tongxu1996 avatar tongxu96 avatar

Stargazers

 avatar  avatar  avatar

Watchers

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

Forkers

robinjayaswal

18w-si32's Issues

Ability to register/login

Users should have ability to sign up and sign in on the front-end.

Includes implementing a client-side session manager or something like that. The API returns a token from the registration and login endpoints which is the auth, to be used as a bearer token.

Worker download and run with bot code from internet

In working towards running tasks from the server, the worker should build/run a bot from a python file. For this task, just use a public .py hosted anywhere and implement the build process incorporating a downloaded file.

Endpoint for uploading game results

In terms of data modeling, I'm not sure how we want to store this. Maybe a game entry in the db stores some stats, and a url for the actual file log of the game?

Standardize response bodies

What should the responses from the API look like? Do we want to include meta information?

As things stand...
I've started using an "updatedRecords" property on requests that create/modify records. On requests to fetch data, the response is (in most places) just the data itself.

UI to list bots

User should be able to see a list of their existing bots

Endpoint exists at /bots

Implement dirtiness checking for when to fire requests

Most of our front-end data will be pretty static. We should keep track of whether a request is needed instead of firing off requests every time a page is visited.

I think we can couple this with a "lastUpdatedDate" or something like that for the backend, so the backend only queries and returns things that have been modified since the front-end last pulled.

Need to call `self.proc.stdin.flush()` after writing to subprocess

Right now we do

def write(self, line):
  self.proc.stdin.write(line.encode())

But this is not registered by the subprocess since we are not calling flush. This causes us to hang when we try to read from subprocess, since it is still waiting for input to its stdin.

Docs page

Just get some sample docs up for MVP.

Create markdown file with exact json for command array

What does the server expect players to be sending?

initial suggestion:

[
  {
     unitId: id,
     command: (number corresponding to command),
     direction: (if move was to move, what angle),
     square: (if move was to build, what square)
  }
]

have to manually make the child workers

After running make, still get

robinjayaswal 18w-si32/worker (python3) $ ./start.sh 
Unable to find image 'si32-child-bot:latest' locally
Unable to find image 'si32-child-bot:latest' locally
docker: Error response from daemon: pull access denied for si32-child-bot, repository does not exist or may require 'docker login'.
See 'docker run --help'.
b''
docker: Error response from daemon: pull access denied for si32-child-bot, repository does not exist or may require 'docker login'.
See 'docker run --help'.
b''

For now just manually built the child bot, Makefile skills are rusty and could not see from cursory glance why the child process was not getting run as part of make all.

cd child && docker build -t si32-child-bot .

Endpoint for getting task

Workers need an endpoint they can hit to get a new task, that returns with all information needed to run a game.

For dev purposes at least, if there's no next requested task, just select two random bots and have them fight.

Have worker import game engine

We should split out the game engine, and then just have the worker include the game as part of the docker build process

UI to list matches

User should be able to see the matches they have created or are part of.

Endpoint exists at /matches

Standardize errors

We need some koa middleware to catch/standardize error status codes and response bodies when there are errors.

As I see it, routes should throw new CorrectErrorType("what went wrong"), and the middleware set status codes/the body depending on what the error type was.

Worker hit endpoint for next task

Implement ability to actually run the next task the server wants to happen. Hit the next task endpoint on the API, fetch, build, and run a game with user-provided code. Call the API endpoint to upload a game's results.

Depends on API endpoint for tasks and ability to download/run bot code.

Define internal terms specifically in a new markdown file

We should all agree on exact definitions of what we are talking about (and exact classes/code we are referring to) when we say 'worker', 'game engine', 'bots' vs 'players', etc. These can be updated as our architecture changes, but as we go we should agree on working definitions.

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.