observatorycontrolsystem / ocs_example

An example OCS project
GNU General Public License v3.0
4 stars 2 forks source link

Issues getting adaptive scheduler to launch #19

Open pgriffin17 opened 2 months ago

pgriffin17 commented 2 months ago

I'm trying to use the example repository to get an idea of the capabilities of OCS, but running into a permission error when initializing the adaptive scheduler. The traceback is below - it will launch if I simply throw a try/except around the with open(self.telescopes_file... lines (and similarly for the active instruments one), however I'm sure this is a poor way to solve this problem. Any alternative suggestions would be appreciated.


2024-06-20 09:22:00 Traceback (most recent call last):
2024-06-20 09:22:00   File "/venv/bin/adaptive-scheduler", line 8, in <module>
2024-06-20 09:22:00     sys.exit(main())
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/cli.py", line 220, in main
2024-06-20 09:22:00     scheduler_runner.run()
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/scheduler.py", line 700, in run
2024-06-20 09:22:00     rerun_required = self.run_once(rerun_required)
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/utils.py", line 272, in timed
2024-06-20 09:22:00     result = method(*args, **kwargs)
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/opentsdb_python_metrics/metric_wrappers.py", line 97, in wrapper
2024-06-20 09:22:00     return method(*args, **kwargs)
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/scheduler.py", line 721, in run_once
2024-06-20 09:22:00     self.network_interface.configdb_interface.update_configdb_structures()
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/configdb_connections.py", line 39, in update_configdb_structures
2024-06-20 09:22:00     self.update_telescope_info()
2024-06-20 09:22:00   File "/venv/lib/python3.9/site-packages/adaptive_scheduler/configdb_connections.py", line 71, in update_telescope_info
2024-06-20 09:22:00     with open(self.telescopes_file, 'w') as telescopes_cache:
2024-06-20 09:22:00 PermissionError: [Errno 13] Permission denied: 'data/telescopes.json'
jnation3406 commented 2 months ago

Sorry for the late reply, I was away on a trip for the last few weeks. The ocs_example docker-compose is volume mapping some local directories to store scheduling data/log files here. By default, its looking in the directory you are running it from in a ./data, ./logs, ./data/input, and ./data/output. If you create those directories locally and give them permissive permissions then it should be able to run and store files from the run in there. It would be a good idea in the future to modify the scheduler to log an error but continue if these directories don't exist though, since storing log files and data files aren't essential to the basic operation of the scheduler.