From 8ffe65a90ee6995df821e6d99ebd292729498014 Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Wed, 21 Aug 2024 14:25:16 +0000 Subject: [PATCH] ansible: update sgx set-up scripts --- ansible/sgx.yml | 2 +- ansible/tasks/code.yml | 6 +++--- ansible/tasks/fetch_docker_images.yml | 6 ------ ansible/tasks/sgx_setup.yml | 4 ++++ tasks/vm.py | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) delete mode 100644 ansible/tasks/fetch_docker_images.yml create mode 100644 ansible/tasks/sgx_setup.yml diff --git a/ansible/sgx.yml b/ansible/sgx.yml index 1405e42..99049e7 100644 --- a/ansible/sgx.yml +++ b/ansible/sgx.yml @@ -3,4 +3,4 @@ - hosts: all gather_facts: yes tasks: - - include_tasks: tasks/fetch_docker_images.yml + - include_tasks: tasks/sgx_setup.yml diff --git a/ansible/tasks/code.yml b/ansible/tasks/code.yml index 75568a7..45629ca 100644 --- a/ansible/tasks/code.yml +++ b/ansible/tasks/code.yml @@ -2,13 +2,13 @@ - name: "Create code dir" file: - path: "/home/{{ ansible_user }}/code" + path: "/home/{{ ansible_user }}/git" state: directory - name: "Clone repos" git: repo: "https://www.github.com/faasm/{{ item }}.git" - dest: "/home/{{ ansible_user }}/code/{{ item }}" + dest: "/home/{{ ansible_user }}/git/faasm/{{ item }}" depth: 1 update: yes recursive: no @@ -22,7 +22,7 @@ - name: "Clone specific Faasm submodules" shell: "git submodule update --init {{ item }}" args: - chdir: "/home/{{ ansible_user }}/code/faasm" + chdir: "/home/{{ ansible_user }}/git/faasm/faasm" with_items: - "clients/cpp" - "clients/python" diff --git a/ansible/tasks/fetch_docker_images.yml b/ansible/tasks/fetch_docker_images.yml deleted file mode 100644 index 0339886..0000000 --- a/ansible/tasks/fetch_docker_images.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- name: "Fetch the basic docker images" - shell: "docker compose pull" - args: - chdir: "/home/{{ ansible_user }}/code/faasm" diff --git a/ansible/tasks/sgx_setup.yml b/ansible/tasks/sgx_setup.yml new file mode 100644 index 0000000..9158459 --- /dev/null +++ b/ansible/tasks/sgx_setup.yml @@ -0,0 +1,4 @@ +--- + +- name: "Set WASM VM env. variable to SGX" + shell: "echo 'FAASM_WASM_VM=sgx' >> /home/{{ ansible_user }}/.bash_aliases" diff --git a/tasks/vm.py b/tasks/vm.py index 16b05d1..fa67763 100644 --- a/tasks/vm.py +++ b/tasks/vm.py @@ -262,7 +262,7 @@ def deallocate(ctx, name): Deallocates, i.e. powers down and deallocates compute resource for the given Azure VM so that it's not billed. """ - _vm_op("stop", name) + _vm_op("deallocate", name) @task