Commit 1a317dbd721766d152c98ddf46212541d1414859
1 parent
00bc9770
Exists in
master
and in
1 other branch
TODOs et modifs mineures
Showing
15 changed files
with
31 additions
and
19 deletions
Show diff stats
src/alert_manager/tasks.py
... | ... | @@ -77,6 +77,7 @@ class alert_listener(Task): |
77 | 77 | |
78 | 78 | with open(os.path.join(VOEVENTS_PATH, event_file), 'rb') as f: |
79 | 79 | voevent = voeventparse.load(f) |
80 | + # TODO: Faire un try/except pour gérer les mauvais fichiers | |
80 | 81 | self.create_related_request(voevent, event_file) |
81 | 82 | |
82 | 83 | def create_related_request(self, voevent, event_file): |
... | ... | @@ -91,10 +92,10 @@ class alert_listener(Task): |
91 | 92 | pyros_user = PyrosUser.objects.get(user__username="pyros") |
92 | 93 | scientific_program = ScientificProgram.objects.get(name="GRB") |
93 | 94 | |
94 | - | |
95 | 95 | alert = self.get_alert_attributes(voevent, event_file) |
96 | 96 | |
97 | 97 | if alert == None or StrategyObs.objects.filter(is_default=True).exists() == False: |
98 | + # TODO: Supprimer le fichier reçu ? Ou le stocker dans un dossier à part | |
98 | 99 | return |
99 | 100 | |
100 | 101 | alert.strat = StrategyObs.objects.filter(is_default=True)[0] | ... | ... |
src/alert_manager/templates/alert_manager/alerts.html
... | ... | @@ -12,19 +12,15 @@ |
12 | 12 | <div class="row"> |
13 | 13 | <h3>Default strategy</h3> |
14 | 14 | |
15 | -{# <form action="{% url 'change_default_strategy' %}" method="POST" id="strat_change_form">#} | |
16 | -{# {% csrf_token %}#} | |
17 | 15 | <input class="span2" id="default_strat" name="default_strat" type="hidden"> |
18 | 16 | <div class="dropdown"> |
19 | 17 | <button class="btn {{btn_type}} dropdown-toggle" type="button" data-toggle="dropdown">{{current_default}} <span class="caret"></span></button> |
20 | 18 | <ul class="dropdown-menu"> |
21 | 19 | {% for strat in strat_list %} |
22 | -{# <li onclick="$('#default_strat').val({{strat}});$('#strat_change_form').submit()"><a>{{ strat }}</a></li>#} | |
23 | 20 | <li><a href="{% url 'change_default_strategy' strat.id %}">{{ strat.name }}</a></li> |
24 | 21 | {% endfor %} |
25 | 22 | </ul> |
26 | 23 | </div> |
27 | -{# </form>#} | |
28 | 24 | |
29 | 25 | </div> |
30 | 26 | ... | ... |
src/alert_manager/tests.py
... | ... | @@ -101,7 +101,7 @@ class AlertListenerTestsCelery(TestCase): |
101 | 101 | def test_basic(self): |
102 | 102 | ''' |
103 | 103 | Used to test scripts/celery_test.sh |
104 | - Only work if the initial_fixture is on the prod DB (an only it) | |
104 | + Only work if the initial_fixture is on the celery test DB (an only it) | |
105 | 105 | ''' |
106 | 106 | Country.objects.create(name="TEEEEST") |
107 | 107 | self.assertEqual(Country.objects.count(), 2, "should be 2 countries") | ... | ... |
src/analyzer/tasks.py
... | ... | @@ -41,7 +41,7 @@ class analysis(Task): |
41 | 41 | # TODO: récupérer les bonne images dans le dossier analyzer/calibrations, et les appliquer |
42 | 42 | # renvoie le nom de l'image calibrée; penser à vérifier que les fichiers de calibration existent à cet endroit |
43 | 43 | # TODO: copier l'image dans le bon dossier pour le filesync (lien symbolique) |
44 | - return "toto.fitz" | |
44 | + return "toto.fits" | |
45 | 45 | |
46 | 46 | def do_analysis(self, new_img): |
47 | 47 | ''' | ... | ... |
src/common/RequestBuilder.py
... | ... | @@ -171,7 +171,8 @@ class RequestBuilder(): |
171 | 171 | |
172 | 172 | if settings.CELERY_TEST == False: |
173 | 173 | pass |
174 | - # TODO: mettre une condition de temps pour lancer le scheduling (il faut être nuit -2 min au minimum) | |
174 | + # TODO: uncomment | |
175 | + # mettre une condition de temps pour lancer le scheduling (il faut être nuit -2 min au minimum) | |
175 | 176 | # scheduler.tasks.scheduling.delay(first_schedule=True, alert=self.request.is_alert) # TODO : changer le first_schedule ... |
176 | 177 | |
177 | 178 | return self.request | ... | ... |
src/majordome/tasks.py
... | ... | @@ -27,7 +27,7 @@ class execute_sequence(Task): |
27 | 27 | |
28 | 28 | |
29 | 29 | def run(self, shs_pk): |
30 | - # on ne supprime JAMAIS un séquence en cours, donc je peux la virer des tasks dès le début | |
30 | + # on ne supprime JAMAIS une séquence en cours, donc je peux la virer des tasks dès le début | |
31 | 31 | TaskId.objects.filter(task_id=self.request.id).delete() |
32 | 32 | |
33 | 33 | shs = ScheduleHasSequences.objects.get(pk=shs_pk) |
... | ... | @@ -44,7 +44,7 @@ class execute_sequence(Task): |
44 | 44 | countdown = self.get_countdown(shs, sequence) |
45 | 45 | |
46 | 46 | if countdown > MAX_WAIT * DAILY_SECOND: |
47 | - scheduler.tasks.scheduling.delay(first_schedule=True, alert=False) # TODO : changer le first_schedule à False | |
47 | + scheduler.tasks.scheduling.delay(first_schedule=False, alert=False) | |
48 | 48 | return |
49 | 49 | |
50 | 50 | tel = Tel.TelescopeController() |
... | ... | @@ -85,7 +85,7 @@ class execute_sequence(Task): |
85 | 85 | try: |
86 | 86 | while plan_result.ready() == False: |
87 | 87 | print("not finished") |
88 | - time.sleep(4) | |
88 | + time.sleep(1) | |
89 | 89 | print("result : %s " % (plan_result.status,)) |
90 | 90 | except Exception as e: |
91 | 91 | print("exception : %s" % (str(e),)) |
... | ... | @@ -93,6 +93,7 @@ class execute_sequence(Task): |
93 | 93 | shs.save() |
94 | 94 | sequence.status = Sequence.CANCELLED |
95 | 95 | sequence.save() |
96 | + # TODO: rendre le quota à l'utilisateur | |
96 | 97 | return |
97 | 98 | |
98 | 99 | shs.status = Sequence.EXECUTED |
... | ... | @@ -138,6 +139,7 @@ class system_restart(Task): |
138 | 139 | Task called by the monitoring when there is no more problem. |
139 | 140 | Should just make a scheduling. |
140 | 141 | ''' |
142 | + | |
141 | 143 | def run(self): |
142 | 144 | time.sleep(5) |
143 | 145 | print("system_restart") | ... | ... |
... | ... | @@ -0,0 +1,8 @@ |
1 | +<?xml version="1.0" ?> | |
2 | +<request name="Bluuua bla" scientific_program="GRB" target_type="qsdqsd"> | |
3 | + <sequence duration="654655642.3" jd1="0E-8" jd2="0E-8" name="QQQS" target_coords="QsQS"> | |
4 | + <album detector="Visible camera" name="MyAlbumPhoto"> | |
5 | + <plan duration="6.0" filter="Second visble filter" name="New plan" nb_images="3"/> | |
6 | + </album> | |
7 | + </sequence> | |
8 | +</request> | ... | ... |
src/misc/templates/base.html
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | <div class="collapse navbar-collapse navbar-ex1-collapse"> |
48 | 48 | |
49 | 49 | <ul class="nav navbar-nav side-nav"> |
50 | - <li><a href="{% url "schedule_simulation" %}">Schedule</a></li> | |
50 | + <li><a href="{% url "current_schedule" %}">Schedule</a></li> | |
51 | 51 | <li><a href="{% url "system" %}">System</a></li> |
52 | 52 | <li><a href="{% url "alerts_list" %}">Alerts</a></li> |
53 | 53 | <li><a href="{% url "requests_list" %}">Routines</a></li> | ... | ... |
src/monitoring/tasks.py
src/observation_manager/tasks.py
... | ... | @@ -37,11 +37,11 @@ class execute_plan_vis(Task): |
37 | 37 | |
38 | 38 | cam.do("START") |
39 | 39 | |
40 | -# TODO: décommenter quand on aura un simulateur | |
41 | -# st = self.wait_camera_finished(cam) | |
40 | + st = self.wait_camera_finished(cam) | |
42 | 41 | |
43 | 42 | # TODO: récupérer les vraies images ? je fais quoi ? |
44 | 43 | time.sleep(1) |
44 | + # Penser qu'un plan peut créer plusieurs images (et analyser image par image) | |
45 | 45 | analysis.delay(plan_id) |
46 | 46 | message = 'Finished plan ' + str(plan_id) + ' execution' |
47 | 47 | Log.objects.create(agent='Observation manager', message=message) | ... | ... |
src/pyros/settings.py
... | ... | @@ -45,6 +45,9 @@ SECRET_KEY = '0*@w)$rq4x1c2w!c#gn58*$*u$w=s8uw2zpr_c3nj*u%qlxc23' |
45 | 45 | |
46 | 46 | # SECURITY WARNING: don't run with debug turned on in production! |
47 | 47 | DEBUG = True |
48 | + | |
49 | +# TODO: enelever le système actuel de simulation d'alerte, et le refaire sur la page principale des alertes | |
50 | +# Supprimer le vue associée (et le template) | |
48 | 51 | SIMULATION = False |
49 | 52 | |
50 | 53 | ALLOWED_HOSTS = ['localhost'] | ... | ... |
src/routine_manager/RequestSerializer.py
... | ... | @@ -133,7 +133,7 @@ class RequestSerializer(): |
133 | 133 | elif name == "duration": |
134 | 134 | seq.duration = Decimal(value) / 86400 |
135 | 135 | |
136 | - # TODO: faire des checks ?? j'imagine | |
136 | + # TODO: faire des checks ?? j'imagine, par exemple pour la cohérence des valeurs | |
137 | 137 | album_list = [] |
138 | 138 | self.sequences.append((seq, album_list)) |
139 | 139 | ... | ... |
src/routine_manager/views.py
... | ... | @@ -389,7 +389,7 @@ def submit_request(request, req_id, redir): |
389 | 389 | return redirect(action_request, req_id=req_id, action="view", status=-1, message=message) |
390 | 390 | |
391 | 391 | for seq in req.sequences.all(): |
392 | - seq.status = Sequence.OBSERVABLE # TODO: utiliser le monitoring | |
392 | + seq.status = Sequence.OBSERVABLE # TODO: utiliser le monitoring (regarder les conditions d'obseration pour dire si on met TBP ou OBS) | |
393 | 393 | seq.save() |
394 | 394 | req.submitted = True |
395 | 395 | req.save() |
... | ... | @@ -411,7 +411,7 @@ def unsubmit_request(request, req_id): |
411 | 411 | |
412 | 412 | req = Request.objects.get(id=req_id) |
413 | 413 | |
414 | -# TODO: Décommenter pour la production | |
414 | +# TODO: uncomment pour la production | |
415 | 415 | # if req.sequences.filter(Q(status=Sequence.EXECUTED) | Q(status=Sequence.EXECUTING)).exists(): |
416 | 416 | # message = "You can't unsubmit an request with executed sequences" |
417 | 417 | # return redirect(action_request, req_id=req_id, action="view", status=-1, message=message) |
... | ... | @@ -423,6 +423,7 @@ def unsubmit_request(request, req_id): |
423 | 423 | for seq in sequences: |
424 | 424 | seq.status = Sequence.COMPLETE |
425 | 425 | seq.save() |
426 | + # TODO: uncomment | |
426 | 427 | # scheduler.tasks.scheduling.delay(first_schedule=True, alert=False) # TODO : changer le first_schedule ... |
427 | 428 | |
428 | 429 | if req.complete == True: | ... | ... |
src/scheduler/tasks.py
... | ... | @@ -22,7 +22,7 @@ class scheduling(Task): |
22 | 22 | Log.objects.create(agent='Scheduler', message='Start schedule') |
23 | 23 | self.scheduler = Scheduler() |
24 | 24 | if first_schedule is True: |
25 | - self.determine_schedule_limits() | |
25 | + self.determine_schedule_limits() # DEV ONLY (en production, les night start / end seront passés en paramètre par le monitoring) | |
26 | 26 | self.scheduler.make_schedule(first_schedule) |
27 | 27 | |
28 | 28 | schedule = Schedule.objects.order_by("-created")[0] | ... | ... |
src/user_manager/forms.py
... | ... | @@ -20,7 +20,6 @@ class PyrosUserCreationForm(forms.ModelForm): |
20 | 20 | class Meta: |
21 | 21 | model = PyrosUser |
22 | 22 | fields = ('tel', 'laboratory', 'address') |
23 | -# fields = ('user.email', 'user_password', 'user_first_name', 'user_last_name', 'tel', 'laboratory', 'address') | |
24 | 23 | |
25 | 24 | def __init__(self, *args, **kwargs): |
26 | 25 | super(PyrosUserCreationForm, self).__init__(*args, **kwargs) | ... | ... |