Skip to content

Commit

Permalink
fix(ansible): install app dependencies in conda env
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Apr 13, 2024
1 parent 6e64216 commit 23126cb
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@
- name: Save environment variables
ansible.builtin.shell: |
echo "{{ django_vars }}" > /home/ubuntu/celery_project/.env
- name: Install swcc
pip:
name: /home/ubuntu/celery_project/swcc
editable: true
virtualenv: /opt/celery
become: true
become_user: root
- name: Install shapeworks prerequisites
apt:
name:
Expand Down Expand Up @@ -72,11 +65,16 @@
- name: Create ShapeWorks Conda Env
ansible.builtin.shell: |
cd /opt/shapeworks && /opt/conda/bin/conda run /bin/bash -c "source install_shapeworks.sh"
echo "/opt/conda/bin/conda activate shapeworks" >> ~/.bashrc
echo "/opt/conda/bin/conda activate shapeworks" >> /home/ubuntu/.bashrc
args:
executable: /bin/bash
become: true
become_user: root
- name: Install dependencies in ShapeWorks Conda Env
ansible.builtin.shell: |
/opt/conda/bin/conda run shapeworks pip install /home/ubuntu/celery_project/
become: true
become_user: root
# This is required because composed_configurations attempts to create the staticfiles directory in the python installation directory while being imported.
# The python installation on the EC2 worker belongs to root, but the Celery worker runs as celery, so it does not have permission to create the directory.
# The (dumb) solution is to create the directory with the correct permissions in advance.
Expand Down

0 comments on commit 23126cb

Please sign in to comment.