Closed swastis10 closed 8 months ago
In the crontab file, I set /2 * python bin/generate_plots.py mode_purpose_share.ipynb default &> /var/log/log_file.log which will recalculate the files every 2 mins.
In which crontab file? the error seems to suggest that there is no crontab file present
FileNotFoundError: [Errno 2] No such file or directory: 'crontab'
Closing this since @swastis10 has "graduated"
@shankari I went through the entire project and realized that we are using Crontab.
In
docker-compose.dev.yml
,CRON_MODE=
is empty by default, manually opening the notebooks. We can make changes in the notebook parameters manually. If I set,CRON_MODE=TRUE
it will launch the container in cron mode. In the crontab file, I set*/2 * * * * python bin/generate_plots.py mode_purpose_share.ipynb default &> /var/log/log_file.log
which will recalculate the files every 2 mins.To test if the notebook is recalculated every 2 mins, I did
docker-compose -f docker-compose.dev.yml up --build
withCRON_MODE=TRUE
but nothing happens.Debugging steps:
docker exec -ti em-public-dashboard-notebook-server-1 bash
source setup/activate.sh && conda env update --name emission --file setup/environment36.notebook.additions.yml
to download all pip dependencies./usr/src/app/.docker/start_notebook.sh
. The logs for the same are:/usr/src/app Running crontab without user interaction, setting python path
Traceback (most recent call last): File "/root/miniconda-4.12.0/envs/emission/bin/devcron", line 8, in
sys.exit(main())
File "/root/miniconda-4.12.0/envs/emission/bin/devcron.py", line 47, in main
cron.run()
File "/root/miniconda-4.12.0/envs/emission/bin/devcron.py", line 259, in run
time.sleep(dt)
KeyboardInterrupt
Traceback (most recent call last):
File "/root/miniconda-4.12.0/envs/emission/bin/devcron", line 8, in
sys.exit(main())
File "/root/miniconda-4.12.0/envs/emission/bin/devcron.py", line 39, in main
crontab_data = open(args[0]).read()
FileNotFoundError: [Errno 2] No such file or directory: 'crontab'