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.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...
AI Ladder, 0.5
Moderators: hoijui, Moderators
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.3
Re: AI Ladder, 0.5
they're running from the exact same folder with the exact same operating system install.hughperkins wrote:Note that each botrunner with the same name really should be identical, ie: same maps, mods and ais.
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
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?
mainly because of log and cache files (infolog and AI logs and so on).
is this a problem for your settup, aegis?
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Hmmm, hoijui is right. The writable spring data directories need to be unique, per botrunner-instance.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?
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.they're running from the exact same folder with the exact same operating system install.
The config is essentially read-only.
Should be fine. The botrunners do a pull on the website, so they pull whenever they're ready.also, the servers are ready except for installing the botrunner code. can your end push jobs to eight fast botrunners effectively?
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

- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
For the writable spring-directory, perhaps you could use tmpfs, which just holds the files in memory? :
In /etc/fstab:
... 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:
In /etc/fstab:
Code: Select all
tmpfs /home/user/.spring tmpfs defaults 0 0
... 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
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.
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Ah, so could do something like, in pseudo-python: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.
Code: Select all
writabledatadir = '/tmp/' + sessionid
os.path.makedir(writabledatadir)
sys.env['SPRING_DATADIR'] = writabledatadir
process.Popen('spring', ... etc ...
Code: Select all
./botrunner.py --per-session-data-dir-prefix=/tmp/
Re: AI Ladder, 0.5
yeah, thta sounds good 

- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Well, it's a worst case.hoijui wrote:yeah, thta sounds good
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
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
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...
oh, and I get a segfault when botrunner runs, after configuring. awesome.
edit: unitsync.GetWritableDataDirectory() segfaults...
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Corrected:aegis wrote:botrunner/utils/userinput.py uses sys and os but doesn't import them <_<
http://manageddreams.com/ailadder/downl ... .7.tar.bz2
corresponding git branch is "0.5"
Works on my machine. Jaunty, python 2.6.2. What is different between your machine and my machine that could explain this?unitsync.GetWritableDataDirectory() segfaults...
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
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 :)
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Great! Good work aegis. Can you send me the new generate.py once it's done, or patch the one in: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 :)
http://github.com/hughperkins/ailadder/tree/master
?
Re: AI Ladder, 0.5
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
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>">
- Attachments
-
- unitsync.zip
- (6.65 KiB) Downloaded 16 times
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Ok, cool!aegis wrote:I'll paste it here, since I haven't bothered getting pushing to git setup yet
Re: AI Ladder, 0.5
I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit
- hughperkins
- AI Developer
- Posts: 836
- Joined: 17 Oct 2006, 04:14
Re: AI Ladder, 0.5
Ok, that sounds good!aegis wrote:I'll check out your sqlalchemy implementation, maybe restructure or fix it a bit
Re: AI Ladder, 0.5
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
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
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
*sigh* might run it locally so I don't need to forward debug code through git