diff --git a/provisioning/conda_env_requirements.yml b/provisioning/conda_env_requirements.yml index 13b8b57..64761c4 100644 --- a/provisioning/conda_env_requirements.yml +++ b/provisioning/conda_env_requirements.yml @@ -17,7 +17,3 @@ dependencies: - ipython - ipdb - thredds_crawler - - cartopy - - basemap-data-hires - - folium - - jupyter diff --git a/provisioning/roles/openwind/tasks/main.yml b/provisioning/roles/openwind/tasks/main.yml index e51ba1a..7560b25 100644 --- a/provisioning/roles/openwind/tasks/main.yml +++ b/provisioning/roles/openwind/tasks/main.yml @@ -49,58 +49,21 @@ # path: "{{ conda_dir }}/envs/{{ env_name }}/etc/conda/deactivate.d/env_vars.sh" # line: "unset PROJ_LIB={{ conda_dir }}/envs/{{ env_name }}/share/proj" - - name: openwind | create shell script to run jupyter notebook - file: - path: /home/vagrant/run_jupyter.sh - state: touch - mode: u=rwx,g=r,o=r - - - name: openwind | Set header in run_jupyter.sh script - lineinfile: - path: /home/vagrant/run_jupyter.sh - insertbefore: BOF - line: "#!/bin/bash" - - - name: openwind | Wait a little before activating env and starting jupyter - lineinfile: - path: /home/vagrant/run_jupyter.sh - line: sleep 60 - - - name: openwind | Line to activate virtual env in shell script - lineinfile: - path: /home/vagrant/run_jupyter.sh - line: "source {{ conda_dir }}/bin/activate {{ env_name }}" - - - name: openwind | Line to start jupyter in shell script - lineinfile: - path: /home/vagrant/run_jupyter.sh - line: "{{ conda_dir }}/envs/{{ env_name }}/bin/jupyter-notebook --ip=0.0.0.0 --no-browser --notebook-dir=/vagrant/notebooks/ --NotebookApp.token=vagrant" - - name: openwind | Set cron shell to bash cron: name: SHELL env: yes job: /bin/bash - - name: openwind | Add Jupyter Notebook to crontab + - name: openwind | Set up daily processing cron: - name: "Jupyter Notebook" - special_time: reboot - job: "/home/vagrant/run_jupyter.sh" - - - name: openwind | Check if Jupyter is running - shell: ps aux | grep jupyter | grep -v grep - ignore_errors: yes - changed_when: false - register: jupyter_status + name: "Daily processing" + special_time: daily + job: "{{ project_home }}/daily_sync.sh" - - name: openwind | Launch Jupyter Notebook - shell: "nohup /home/vagrant/run_jupyter.sh > /dev/null 2>&1 &" - when: jupyter_status.rc != 0 - - name: openwind | Create shell script for daily data sync and wind processing file: - path: /home/vagrant/daily_sync.sh + path: "{{ project_home }}/daily_sync.sh" state: touch mode: u=rwx,g=r,o=r @@ -126,43 +89,3 @@ # Process S1 wind {{ conda_dir }}/envs/{{ env_name }}/bin/python {{ project_home }}/{{ project_name }}/manage.py process_sentinel1_wind --date `date -d "yesterday 00:00" '+%Y-%m-%d'` - - # shell: "source activate {{ env_name }}; nohup {{ conda_dir }}/envs/{{ env_name }}/bin/jupyter-notebook --ip=0.0.0.0 --no-browser --notebook-dir=/vagrant/notebooks/ --NotebookApp.token=vagrant > /dev/null 2>&1 &" - - #- name: Nansat Setup Python | Check if numpy is imported - # shell: "nosetests test_import.py" - # args: - # chdir: "{{ shared_dir }}" - - #- name: openwind | Update/checkout Nansat - # git: repo=https://github.com/nansencenter/nansat - # dest="{{ dev_sources_dir }}/nansat/" - # version="{{ nansat_version }}" - # update=yes - # register: git_nansat - # tags: - # - update-nansat - # ignore_errors: no - # - #- name: openwind | Clean Nansat (always run to keep the pixel functions updated) - # shell: 'python setup.py clean --all' - # args: - # chdir: '{{ dev_sources_dir }}/nansat' - # tags: - # - update-nansat - # - #- name: openwind | Install Nansat (always run to keep the pixel functions updated) - # shell: 'python setup.py build_ext --inplace' - # args: - # chdir: '{{ dev_sources_dir }}/nansat' - # tags: - # - update-nansat - # - #- name: openwind | Create link from Python dist-packages to nansat - # file: path='{{ python_dist_packages }}/nansat' - # src='{{ dev_sources_dir }}/nansat/nansat' - # state=link - # force=yes - # - #- name: nansat | Create link from Python dist-packages to nansat_integration_tests - # diff --git a/provisioning/site.yml b/provisioning/site.yml index 1a127ac..1367af8 100644 --- a/provisioning/site.yml +++ b/provisioning/site.yml @@ -1,10 +1,10 @@ --- - hosts: openwind vars: - project_home: '/vagrant/lib' - project_name: 'project' + project_home: '/home/sarvind' + project_name: 'geospaas_project' env_name: 'py3openwind' - conda_dir: '/home/vagrant/anaconda' + conda_dir: "{{ project_home }}/anaconda" conda_env_update_if_present: True roles: @@ -13,6 +13,7 @@ django_project_name: '{{ project_name }}' django_conda_dir: '{{ conda_dir }}' django_env_name: '{{ env_name }}' + django_products_root: '/Data/sarvind' django_apps: - geospaas.vocabularies - geospaas.catalog