Page 12 of 17

Re: AI Ladder, 0.3

Posted: 18 Oct 2009, 04:03
by hughperkins
aegis wrote:make it possible to run the calcengine with the same command from the same folder on the same computer multiple times with a single account and no configuration changes...
Should be possible using release 0.5. Note that each botrunner with the same name really should be identical, ie: same maps, mods and ais.

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 05:37
by aegis
hughperkins wrote:Note that each botrunner with the same name really should be identical, ie: same maps, mods and ais.
they're running from the exact same folder with the exact same operating system install.

also, the servers are ready except for installing the botrunner code. can your end push jobs to eight fast botrunners effectively?

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 12:18
by hoijui
as i understand it, each botrunner, even if it has the same name, would need a different writeable spring-data-dir, no?
mainly because of log and cache files (infolog and AI logs and so on).
is this a problem for your settup, aegis?

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 15:25
by hughperkins
hoijui wrote:as i understand it, each botrunner, even if it has the same name, would need a different writeable spring-data-dir, no?
mainly because of log and cache files (infolog and AI logs and so on).
is this a problem for your settup, aegis?
Hmmm, hoijui is right. The writable spring data directories need to be unique, per botrunner-instance.
they're running from the exact same folder with the exact same operating system install.
Yeah, from the point of view of the botrunner and website that should be fine. Each botrunner instance generates its own sessionid, and stores it in memory: it is never written to disk.

The config is essentially read-only.
also, the servers are ready except for installing the botrunner code. can your end push jobs to eight fast botrunners effectively?
Should be fine. The botrunners do a pull on the website, so they pull whenever they're ready.

You said each game takes about 20 seconds? So 16 machines is one request every 1.2 seconds? Even dreamhost can handle that I suspect ;-)

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 15:36
by hughperkins
For the writable spring-directory, perhaps you could use tmpfs, which just holds the files in memory? :

In /etc/fstab:

Code: Select all

tmpfs   /home/user/.spring        tmpfs   defaults        0       0
... then simply copy the persistent stuff from the writable spring-directory to some other directory, let's say, /home/user/persistent/.spring

... then when the computer boots, you can create a task in /etc/init.d, like for example /etc/init.d/setupspring, linked to by /etc/rc2.d/setupspring-S40 for example, which does:

Code: Select all

rsync -av /home/user/persistent/.spring/ /home/user/.spring

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 15:57
by hoijui
an alternative may be to use the env var 'SPRING_DATADIR' (colon separated list, like PATH). This has the highest priority, and should turn up as the writeable data dir when set.

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 16:00
by hughperkins
hoijui wrote:an alternative may be to use the env var 'SPRING_DATADIR' (colon separated list, like PATH). This has the highest priority, and should turn up as the writeable data dir when set.
Ah, so could do something like, in pseudo-python:

Code: Select all

writabledatadir = '/tmp/' + sessionid
os.path.makedir(writabledatadir)
sys.env['SPRING_DATADIR'] = writabledatadir
process.Popen('spring', ... etc ...
Edit: maybe could have a commandline option like:

Code: Select all

./botrunner.py --per-session-data-dir-prefix=/tmp/

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 16:29
by hoijui
yeah, thta sounds good :-)

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 17:58
by hughperkins
hoijui wrote:yeah, thta sounds good :-)
Well, it's a worst case.

The implication is that every time a botrunner is run, there will be a new directory....

If each machine can have it's own data directory, eg in tmpfs, that will probably be cleaner.

Re: AI Ladder, 0.5

Posted: 18 Oct 2009, 21:20
by aegis
already set up a local server for assigning unique names to each bot in case I couldn't use the same bot name on the website (also for proxying the bots to a single spring bot), so I can make this unique name only apply to the working spring directory. I'll set this up when I get home :)

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 03:31
by aegis
botrunner/utils/userinput.py uses sys and os but doesn't import them <_<

oh, and I get a segfault when botrunner runs, after configuring. awesome.

edit: unitsync.GetWritableDataDirectory() segfaults...

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:23
by hughperkins
aegis wrote:botrunner/utils/userinput.py uses sys and os but doesn't import them <_<
Corrected:

http://manageddreams.com/ailadder/downl ... .7.tar.bz2

corresponding git branch is "0.5"
unitsync.GetWritableDataDirectory() segfaults...
Works on my machine. Jaunty, python 2.6.2. What is different between your machine and my machine that could explain this?

Oh... hmmm, maybe unitsync_api.h? Do you want to try re-running generate and see if that works better?

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:25
by aegis
det and I worked it out, seems to be a bug with 64-bit returning char* pointers... in other news, I'll have my botrunners up as soon as I patch generate.py :)

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:31
by hughperkins
aegis wrote:det and I worked it out, seems to be a bug with 64-bit returning char* pointers... in other news, I'll have my botrunners up as soon as I patch generate.py :)
Great! Good work aegis. Can you send me the new generate.py once it's done, or patch the one in:

http://github.com/hughperkins/ailadder/tree/master

?

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:35
by aegis
I'll paste it here, since I haven't bothered getting pushing to git setup yet

edit: seems to be no more errors here, just errors in botrunner ;)
xmlrpclib.Fault: <Fault 1: "sqlalchemy.orm.exc.FlushError:New instance <BotRunnerSupportedMap at 0x-48816ed4> with identity key (<class 'core.tableclasses.BotRunnerSupportedMap'>, (3L, 7L)) conflicts with persistent instance <BotRunnerSupportedMap at 0x-48816e94>">

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:43
by hughperkins
aegis wrote:I'll paste it here, since I haven't bothered getting pushing to git setup yet
Ok, cool!

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:47
by aegis
I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:49
by hughperkins
aegis wrote:I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit
Ok, that sounds good!

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 05:51
by aegis
that error I pasted might be due to you saving an instance of an object to the same session twice?

edit: another error
http://manageddreams.com/ailadder/viewbotrunners.py

the first error appears to be something to do with my moderately large collection of maps, and doesn't make me happy :(

Re: AI Ladder, 0.5

Posted: 19 Oct 2009, 06:21
by aegis
also reloading the staging website broke it hard, yay.

*sigh* might run it locally so I don't need to forward debug code through git