Skip to content

Commit

Permalink
fix(ansible): run conda init in separate bash sessions as user ubuntu
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Apr 13, 2024
1 parent 637c99b commit fb045b4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,17 +75,15 @@
args:
executable: /bin/bash
become: true
become_user: root
become_user: ubuntu
- name: Install dependencies in ShapeWorks Conda Env
ansible.builtin.shell: |
/opt/conda/bin/conda init
/opt/conda/bin/conda activate shapeworks
pip install /home/ubuntu/celery_project
pip install /home/ubuntu/celery_project/swcc
/bin/bash -c "/opt/conda/bin/conda init"
/bin/bash -c "/opt/conda/bin/conda activate shapeworks && pip install /home/ubuntu/celery_project"
args:
executable: /bin/bash
become: true
become_user: root
become_user: ubuntu
# 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 fb045b4

Please sign in to comment.