Closed RaXaR closed 14 years ago
I documented the process of getting pooled servers (that can be requisitioned),
d40146b781fb16eb5c3994b2b7e9242be5bfb8c4
I followed the instructions in readme-standalone.txt verbatim. the only thing I changed was CODE in server/settings.cfg and in the .py file. Here are my settings for both server and master. http://pastebin.com/a5dHXBWD
It still didn't work. Also, i tried to comment out line 48 in the above pastebin, that didn't help either. On the 'server instances' page the server is still listed as 'independent'
To debug the problem, insert some printouts in the instance_validator__models.py that you added. Specifically, one at the end, something like
print " validator loaded."
(so we know it loaded), and one in the function, before the return,
print "Testing", validation, validation == 'CODE'
Look for that output when the master runs.
I added those lines, but they don't appear anywhere. Alos, i'm running the server in 'production' mode.
The output from the master server console: http://pastebin.com/5b3tVDy2
Does it work in debug mode, just not in production?
If those lines don't appear, then perhaps you placed the plugin in the wrong directory. It should be in master_django/intensity/components, and have exactly the name specified in the docs.
There was a problem with my indentation, i fixed it.
I switched to debug mode, I the server outputs up to line 27 on http://pastebin.com/WSArg4fK, then i started a server instance.
I switched to production mode, the master server console outputs up to line 19 on http://pastebin.com/FYKCdiyT, then i started a server instance.
Looks like you didn't paste my suggested debug printouts, and just have something like
print "Testing function"
in there?
Here's the validator file: http://pastebin.com/KHZp41i7
And what's the output when you use the code I suggested?
The output is: http://pastebin.com/WSArg4fK in debug
And this http://pastebin.com/FYKCdiyT in production mode
That is still with your old debug printout. It doesn't show the compared values, as I said. Use what I suggested, this:
print "Testing", validation, validation == 'CODE'
(where 'CODE' is your code). That way we will be able to see exactly what the problem is, and fix it.
aaah ok, sorry, i misunderstood, my bad. I used the code you pasted above. The debug output is now: http://pastebin.com/ziynsUfF The production output is now: http://pastebin.com/uTNxNcff
Btw, no need for both debug and production, the results are the same (well, so far at least).
The output was correct - it returns true. So the mystery remains, we need to debug one level higher. In master_django/intensity/tracker/views.py, line 294 is where it calls the function we just debugged. Edit lines 295-305 (the area right after the call to validate_instance) to look like this:
print "vals:", validations
# If at least one positive validation, then validated
if len(validations) > 0 and reduce(
lambda x,y: x or y,
map(lambda result: result[1], validations)
):
print "Pooled!"
instance.mode = ServerInstance.MODE.Pooled
instance.session_id = make_uuid()
else:
print "Independent :("
instance.mode = ServerInstance.MODE.Independent
instance.activity = curr_activity
(Turns out the issue was that [Instances] force_asset_location was set in the master's settings.cfg)
I created a map (test01) using the Map Creation Wizard by cloning emptymap.tar.gz.
The asset and the activity is created. On the activity page the following message is displayed: "Map creation wizard made your map asset and activity, but could not find a server. Try to requisition one later for your new activity."
I go to the asset's overview and click the the "Requisition a server instance to run this activity" button, this gives the error message "Could not find a free server instance to run 'test01 v1.0'".
I get it to work by adding the following lines to /local/server/server.cfg: [Activity] force_activity_id = f668e677_24c7_4a63_a5fa_14209300c7d0
The id of the activity I found in the url on http://localhost:8080/tracker/activity/view/f668e677_24c7_4a63_a5fa_14209300c7d0/