{"action":"created","issue":{"url":"https://api.github.com/repos/larics/assisi-python/issues/27","labels_url":"https://api.github.com/repos/larics/assisi-python/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/larics/assisi-python/issues/27/comments","events_url":"https://api.github.com/repos/larics/assisi-python/issues/27/events","html_url":"https://github.com/larics/assisi-python/issues/27","id":100527788,"number":27,"title":"Separation of calibration procedure and main runtime code in deployment","user":{"login":"rmm-fcul","id":7782039,"avatar_url":"https://avatars.githubusercontent.com/u/7782039?v=3","gravatar_id":"","url":"https://api.github.com/users/rmm-fcul","html_url":"https://github.com/rmm-fcul","followers_url":"https://api.github.com/users/rmm-fcul/followers","following_url":"https://api.github.com/users/rmm-fcul/following{/other_user}","gists_url":"https://api.github.com/users/rmm-fcul/gists{/gist_id}","starred_url":"https://api.github.com/users/rmm-fcul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmm-fcul/subscriptions","organizations_url":"https://api.github.com/users/rmm-fcul/orgs","repos_url":"https://api.github.com/users/rmm-fcul/repos","events_url":"https://api.github.com/users/rmm-fcul/events{/privacy}","received_events_url":"https://api.github.com/users/rmm-fcul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-12T12:07:42Z","updated_at":"2015-08-13T07:06:01Z","closed_at":null,"body":"To run an experiment, we follow these steps:\r\n1. empty arena (no bees), lighting same as experiment (typically dark room)\r\n2. CASUs calibrate IR sensors (to establish a threshold for each sensor)\r\n3. main runtime code starts\r\n4. Bees can be placed in arena\r\n\r\n2 & 3 happen like this because they are part of the same program, but actually 3 could happen after 4.\r\n\r\nCan we separate the main runtime/user code from the calibration program?\r\nWe can run calibration, record the calibration levels to file, then stop program.  Then the main program executes, with levels already known.\r\n\r\n\r\nBenefits:\r\n- reset of user code while bees are still present (e.g., after correcting a mistake)\r\n- allows calibration code module to be shared more trivially\r\n- calibration levels are explicitly recorded\r\n\r\nDownsides:\r\n- every experiment generates 2 logs per CASU.\r\n\r\n\r\na) is it possible to run >1 program, in sequence, with fabric? \r\nb) is it possible to run the two programs independently? (Step 4 above is manual and takes a variable amount of time)\r\nc) could we put the location of the calibration data in the RTC file? (making assumptions generally bad, although it would be borderline acceptable to use \"/tmp/IRsensors.calibration\" or something, since we definitely don't want these values persisting between resets)"},"comment":{"url":"https://api.github.com/repos/larics/assisi-python/issues/comments/130560206","html_url":"https://github.com/larics/assisi-python/issues/27#issuecomment-130560206","issue_url":"https://api.github.com/repos/larics/assisi-python/issues/27","id":130560206,"user":{"login":"dmiklic","id":2772996,"avatar_url":"https://avatars.githubusercontent.com/u/2772996?v=3","gravatar_id":"","url":"https://api.github.com/users/dmiklic","html_url":"https://github.com/dmiklic","followers_url":"https://api.github.com/users/dmiklic/followers","following_url":"https://api.github.com/users/dmiklic/following{/other_user}","gists_url":"https://api.github.com/users/dmiklic/gists{/gist_id}","starred_url":"https://api.github.com/users/dmiklic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmiklic/subscriptions","organizations_url":"https://api.github.com/users/dmiklic/orgs","repos_url":"https://api.github.com/users/dmiklic/repos","events_url":"https://api.github.com/users/dmiklic/events{/privacy}","received_events_url":"https://api.github.com/users/dmiklic/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T07:06:01Z","updated_at":"2015-08-13T07:06:01Z","body":"Since calibration and the \"main program\" are actually two separate things, and the same calibration routine can (and probably will) be used with lots of different \"main programs\", for me the most natural solution is to do two consecutive deployments. The calibration routine would create a calibration file which would be used by the \"main program\". The only remaining problem is retrieving this calibration file (which would then be included in the deployment files of the main program). Implementing an automatic way to do this is something I could probably do by the end of the week.\r\n\r\nLet me know if this solution sounds ok to you, and I'll do my best to implement it by Sunday."}}