[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4586: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4588: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4589: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
[phpBB Debug] PHP Warning: in file /includes/functions.php on line 4590: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3765)
AI Challenge Forums • View topic - Duplicating the aichallenge website locally

It is currently Wed Sep 20, 2017 6:13 pm Advanced search

Duplicating the aichallenge website locally

Topics about starter packages, visualizer or any other third party tools.
Please submit new language requests in the Language Request Forum.

Re: Duplicating the aichallenge website locally

Postby McLeopold » Wed Oct 26, 2011 3:17 am

Something could be gumming up the system. Do a mysqldump. Jump on IRC if you want to chat.
McLeopold
Contest Organizer
 
Posts: 262
Joined: Sun Sep 19, 2010 3:31 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 3:18 am

pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 3:21 am

SERVER:

* Install Ubuntu 11.04 (Not 11.10 - everything is set up specifically for 11.04).
*
* sudo apt-get install git
* sudo useradd -d /home/contest -m -s /bin/bash contest
* Go to system settings->Users and Groups,
and set the password for user 'contest' to 'contest' (Enable Account).
Also set the account type to "Administrator".
* close the terminal and open a new one (just to be sure the above settings are active).
* sudo su - contest
* edit /etc/hosts and add:
127.0.0.1 aichallenge

(or whatever hostname you want)
* sudo hostname aichallenge
* cd ~
* git clone https://github.com/aichallenge/aichallenge.git
* cd aichallenge
* git submodule init
* git submodule update
* Some programming languages didn't download/build correctly for me:
If you dont' require all languages, open setup/retrieve_languages.py and comment out
all lines between "sources = [" and "]" - so it should effectively read "sources = []".
Leave in any lines you really need - in my case I was only really interested in python, perl and java.

* cd ~/aichallenge
* sudo python setup/server_setup.py
- Are you sure you want to continue? yes
- Only install system packages? no
- Contest username [contest] - push ENTER to accept default
- Database root password? - Leave blank
- Confirm database root password? - leave blank
- Contest database username [contest] - push ENTER
- Contest database password: contest
- Confirm contest database password: contest
- Name of contest database [aichallenge] - push ENTER
- accept defaults for root dir, source repo, uploads, maps & replays
- hostname is whatever you set above (aichallenge)
- Make contest site the default website? yes
- Run setup as configured above? yes

Everything will now be installed.

* You will probably want automatic account activation:
Edit ~/aichallenge/website/process_registration.php
Change line 65 to '$send_email = 0;' (without quotes)

This file also controls other signup requirements.
I chose to lower the required username and password lengths to minimum of 3,
and allowed email to be blank. With a basic understanding of php you should be able to see how to do this.

* Congratulations - you are now finished setting up the server.
Open a browser, and go to 'localhost'.
You should be able to create accounts, and submit bots.
However, nothing will "happen" until you install one or more workers (see below).
pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 3:23 am

WORKER:
* cd ~/aichallenge
* edit setup/worker_setup.py and remove as many languages as you dont need from
install_extra_distribution_languages() - some of these wouldn't install.
Also go down to install_all_languages(options) and comment out all the "install_" lines
below install_extra_distribution_languages().
Obviously leave any that you really need - I was only interested in python, perl and java so I ignored most others.
The reason was that some languages failed to install on my first attempts, so commenting these lines out reduces your chance of failure.


* sudo apt-get install curl
* sudo su -
* curl http://127.0.0.1/api_server_setup.php?|sh
* The worker will now be installed. It takes about 25 minutes. Fingers crossed...
* The worker will start running once installed.
pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 3:25 am

FINAL SETUP:
* It may be useful to install phpmyadmin to manage the database manually.
Only if you know what you're doing! If you break it, its really difficult to
set it up again, since the setup scripts assume you are setting up from scratch
and they will fail if things are already partially set up. I learnt the hard way.

IF you do install anything else on the server, make sure it is secure!

* Add maps to database, as follows:
* Download the tools from http://aichallenge.org/using_the_tools.php
* Extract the tools and go to tools/maps/
* Copy the maze, multi_hill_maze, and random_walk folders to ~/maps
* now go to ~/aichallenge/manager
* ./add_maps_to_database.py

ALMOST DONE:
* Open a browser and point it to 'localhost'. You should see the ai challenge
website running locally on your machine.
* Add some players and bots
* The bots should compile automatically if a worker is running.
* To check if a worker is running, do 'ps aux | grep worker' and look for:
'python worker.py -t -n 0'. Only 1 worker is required.

* go to ~/aichallenge/setup
* sudo ./update_visualizer.sh
(not sure if this is required, but it seemed like a good idea)

IMPORTANT: Games will not automatically start running due to a bug in the sql code.

* go to ~/aichallenge/sql
* open 2_generate_matchup.sql in your favourite editor
* change line 182 to:
select avg(tg.game_count) * 1.1 + 1
* save and exit
* mysql -u contest -p -D aichallenge < 2_generate_matchup.sql
(password is contest)

* Now do the same change in opponent.sql (line 237). save and exit
* mysql -u contest -p -D aichallenge < opponent.sql
* You should now see some games running...

Things should "just work" after that.

And we're done. Good luck!

NOTES:
* There are some game parameters in aichallenge/website/server_info.php
Things like number of turns, turntime etc - update these per your requirements.
pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 3:48 am

....and its stopped again!! It continued until all bots had played 2 games, then it stopped.

Adding more users/bots doesn't make any difference now.

This is so frustrating - why wont it run games?

Something is broken in the default install. I have 11 users/bots and no games running. The worker calls api_get_task and just gets an empty response.

If anyone knows what to change, let me know.
pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 4:19 am

pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby pixel8r » Wed Oct 26, 2011 6:52 am

Just a quick follow-up...

I now have 18 users in my system and it is running very nicely.

There are no changes to the prior howto in this thread - just that at the end of it you need to create more users.
Keep creating users until things start to happen :-)
pixel8r
Captain
 
Posts: 28
Joined: Mon Oct 24, 2011 10:19 am

Re: Duplicating the aichallenge website locally

Postby aboeing » Thu Oct 27, 2011 11:51 am

Awesome, thanks for the instructions, I'll let you know how I go.
aboeing
Lieutenant
 
Posts: 16
Joined: Fri Oct 21, 2011 2:00 pm

Re: Duplicating the aichallenge website locally

Postby kornork » Thu Oct 27, 2011 6:41 pm

It would be awesome if all this was packaged up into a vm image.
kornork
Cadet
 
Posts: 8
Joined: Thu Oct 27, 2011 4:54 am

PreviousNext

Return to Starter Packages & Tools

Who is online

Users browsing this forum: No registered users and 1 guest

cron