Team = 'Pyaneers'
Members = ['Andrew Baik', 'Jason Burns', 'Christopher Chapman', 'Alexander Stone']Gomokubot learns the game of gomoku using Google tensorflow.
win: five in a row
first move: black
mechanics: forcing moves: plays which line up four in a row, which force defensive moves by the other side, often for an extended time. Skilled players can read chains of these out to 40 moves. response: end forcing mechanics by playing interupting moves towards clusters of your own pieces that are already on the board, increading the chance for offensive opportunities.
-
Change directory into your newly created project.
cd Gomokubot
-
Create a Python virtual environment.
python3 -m venv env
-
Upgrade packaging tools.
env/bin/pip install --upgrade pip setuptools
-
Install the project in editable mode with its testing requirements.
env/bin/pip install -e ".[testing]"
-
Run your project's tests.
env/bin/pytest
-
Run your project.
env/bin/pserve development.ini
-
Create a new EC2 Instance
-
Set up an ssh configuration for the EC2 instance and connect to it. Note the rest of these instructions will be for an Ubuntu Server 16.x instance.
-
Update your EC2 Instance and install nginx, build-essential, python-dev and python3-pip.
-
Clone the repo into the src directory.
-
Navigate to the repo. Switch to either the development_aws branch(for a 15x15 board) or the s_aws_deploy branch(for a 5x5 board).
-
run pip3 install -e . --user to install all the neccessary files. In addition run pip3 install pytest.
-
go to src/Gomokubot/models/gmk_board.py and find the update in the DBBoard class. Change config_uri from 'development.ini' to 'production.ini'.
-
go to src/Gomokubot/views/board.py and change the first line in the try block of the update method of the BoardAPIView class from kwargs = json.loads(request.body) to kwargs = json.loads(request.body.decodes())
-
Make an Amazon RDS Postgres database and ensure that your ec2 instance can connect to it.
-
Go to src/production.ini and add the line sqlalchemy.url = postgres://DB_USER:PASSWORD@DB_ENDPOINT:5432/DB_NAME under the [app:main] section.
-
run initialize_gomokubot_db production.ini in src.
-
in ~ run mkdir logs; touch error.log access.log
-
Run sudo nano /etc/nginx/nginx.conf and delete the contents of that file and replace them with:
# nginx.conf user www-data; worker_processes 4; pid /var/run/nginx.pid; events { worker_connections 1024; # multi_accept on; } http { ## # Basic Settings ## sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; # server_tokens off; server_names_hash_bucket_size 128; # server_name_in_redirect off; include /etc/nginx/mime.types; default_type application/octet-stream; ## # Logging Settings ## access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ## # Gzip Settings ## gzip on; gzip_disable "msie6"; ## # Virtual Host Configs ## include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; }
-
run sudo nano /etc/nginx/conf.d/gomokubot.conf to create a project specific conf file for your nginx server. Paste the following into it:
# gomokubot.conf upstream gomokubot { server 127.0.0.1:8000; } server { listen 80; server_name (EC2 public DNS); access_log /home/ubuntu/.local/nginx.access.log; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; client_max_body_size 10m; client_body_buffer_size 128k; proxy_connect_timeout 60s; proxy_send_timeout 90s; proxy_read_timeout 90s; proxy_buffering off; proxy_temp_file_write_size 64k; proxy_pass http://gomokubot; proxy_redirect off; } }
-
Validate your settings with sudo nginx -t and look for the message that says the conf test is successful.
-
check that nginx is working with sudo service nginx status If it is not working run sudo service nginx restart
-
install gunicorn with pip3 install gunicorn --user
-
run sudo nano /etc/systemd/sytem/gunicorn.service to make a gunicorn config file. Put the following into it:
# gunicorn.service [Unit] Description=(your description) After=network.target [Service] User=ubuntu Group=www-data WorkingDirectory=/home/ubuntu/src ExecStart=/home/ubuntu/.local/bin/gunicorn --access-logfile /home/ubuntu/logs/access.log --error-logfile /home/ubuntu/logs/error.log -w 3 --log-level warning --paste production.ini [Install] WantedBy=multi-user.target
-
Run the following three commands: sudo systemctl enable gunicorn sudo systemctl start gunicorn sudo systemctl status gunicorn
- As a player, I like to be able to play against a computer
- As a player, I like to see computer learning
- As a player, I like to display the board on the web application while I play against computer
- As a developer, I like to access to play against computer
- As a developer, I like to transfer server data using json format
- As a developer, I like to store results to the database so that computer can learn from previous games
Fractalkine workflow; major level: squad, minor level: pairs, patch level: single. Conflict will be handled in the thunderdome, AKA the whiteboard.
Deployment: final product
⬆️
Master: successful development commits
⬆️
Developlemt: feature integration, code merging, and testing
⬆️⬆️⬆️
f_feature_specific_branches: feature development
06SEP18: Design
Game logic (Controller)
- validation of the victory
- Validation move
RESTful endpoints (Server/APIView)
- Post (new game)
- Put (send new point)
- Get (front-end for user)
ML(tensorflow, itertools)
Front-end
- Bare minimum of yellow background with black outlines, black and white rocks. text block


