Skip to content

Commit

Permalink
fix(ansible): squashed fixes to ansible conda install
Browse files Browse the repository at this point in the history
  • Loading branch information
annehaley committed Apr 13, 2024
1 parent 400550b commit 8e82a8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_workers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
SECRETS_JSON=`jq -n '$ARGS.positional | map({ (.): env[.] }) | add' --args "${SECRETS_NAMES[@]}"`
jq --argjson secrets "$SECRETS_JSON" '{django_vars: (.+=$secrets)}' dev/prod.celery.env.json > extra_vars.json
INVENTORY=`python shapeworks_cloud/manage_workers.py start_all`
ansible-playbook -v --inventory "$INVENTORY" --extra-vars "@extra_vars.json" ./ansible/playbook.yml
ansible-playbook -vv --inventory "$INVENTORY" --extra-vars "@extra_vars.json" ./ansible/playbook.yml
- name: Stop GPU workers
if: always() # run this even if the above step fails
run: python shapeworks_cloud/manage_workers.py stop_gpus
24 changes: 4 additions & 20 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,17 @@
become_user: root
- name: Install Conda
ansible.builtin.shell: |
export PATH=/opt/conda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o /tmp/Miniconda3-latest-Linux-x86_64.sh
chmod 777 /tmp/Miniconda3-latest-Linux-x86_64.sh
/tmp/Miniconda3-latest-Linux-x86_64.sh -b -f -p /opt/conda
become: true
become_user: root
- name: Update Conda
ansible.builtin.shell: |
conda update -n base -c defaults conda
conda install pip
echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc
conda run /bin/bash -c
become: true
become_user: root
- name: Create ShapeWorks Conda Env
ansible.builtin.shell: |
cd /opt/shapeworks
source install_shapeworks.sh
conda clean -t -y
conda run -n shapeworks bin/bash -c
cd /opt/shapeworks && /opt/conda/bin/conda run /bin/bash -c "source install_shapeworks.sh"
echo "/opt/conda/bin/conda activate shapeworks" >> ~/.bashrc
args:
executable: /bin/bash
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.
Expand All @@ -103,10 +94,3 @@
chmod 777 /home/ubuntu/celery_project/dev/prod.celery.start.sh
become: true
become_user: root
- name: Restart celery service to pick up any changes
systemd:
state: restarted
daemon_reload: yes
name: celery
become: true
become_user: root

0 comments on commit 8e82a8f

Please sign in to comment.