Skip to content

Commit

Permalink
Backport ansible script updates
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Gu <jiaweig3@illinois.edu>
  • Loading branch information
tylergu committed Aug 15, 2023
1 parent 5d402a8 commit 07d4ea7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 52 deletions.
50 changes: 7 additions & 43 deletions scripts/ansible/acto.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,51 +4,15 @@

tasks:

- name: Clean up previous acto repo
file:
path: /tmp/acto
state: absent

- name: Download acto repo
local_action:
module: ansible.builtin.git
archive: /tmp/acto.tar.gz
clone: yes
dest: /tmp/acto
repo: git@github.com:xlab-uiuc/acto.git
version: main
run_once: true

- name: Get the home directory
become: false
command: echo $HOME
register: home

- name: Copy Acto archive to remote
ansible.builtin.copy:
src: /tmp/acto.tar.gz
dest: "{{ home.stdout }}"

# - name: Ansible delete file glob
# find:
# paths: "{{ home.stdout }}/acto"
# patterns: "*"
# register: files_to_delete

# - name: Ansible remove file glob
# file:
# path: "{{ item.path }}"
# state: absent
# with_items: "{{ files_to_delete.files }}"

- name: create Acto dir
become: false
ansible.builtin.file:
path: "{{ home.stdout }}/acto"
path: "{{ home.stdout }}/workdir/acto"
state: directory

- name: open archive
ansible.builtin.unarchive:
copy: true
dest: "{{ home.stdout }}/acto"
src: /tmp/acto.tar.gz
- name: clone Acto repo
become: false
ansible.builtin.git:
dest: "{{ home.stdout }}/workdir/acto"
repo: https://github.com/xlab-uiuc/acto.git
version: main
8 changes: 4 additions & 4 deletions scripts/ansible/configure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
- name: Install go
import_playbook: go.yaml

- name: Install go
- name: Install docker
import_playbook: docker.yaml

- name: Install acto
import_playbook: acto.yaml

- name: Install python
import_playbook: python.yaml

Expand All @@ -36,6 +39,3 @@

- name: Install htop
import_playbook: htop.yaml

- name: Install acto
import_playbook: acto.yaml
2 changes: 2 additions & 0 deletions scripts/ansible/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ PYTHON_PKGS:
- jsonschema
- jsonpatch
- pandas
- tabulate
- pydantic
TMPFS_SIZE: 350G
8 changes: 7 additions & 1 deletion scripts/ansible/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
state: present
update_cache: yes

- name: Get the home directory
become: false
command: echo $HOME
register: home

- name: Install python packages using pip
pip:
name: "{{ PYTHON_PKGS }}"
# Implication: this script should happen after acto.yml
requirements: "{{ home.stdout }}/workdir/acto/requirements.txt"
state: present
8 changes: 4 additions & 4 deletions scripts/ansible/tmpfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
command: echo $HOME
register: home

- name: create Acto dir
- name: create work dir
become: false
ansible.builtin.file:
path: "{{ home.stdout }}/acto"
path: "{{ home.stdout }}/workdir"
state: directory

- name: Mount the spare partition on acto dir
ansible.posix.mount:
path: "{{ home.stdout }}/acto"
path: "{{ home.stdout }}/workdir"
fstype: ext4
src: /dev/sda4
state: mounted

- name: Change ownership of acto dir
ansible.builtin.file:
path: "{{ home.stdout }}/acto"
path: "{{ home.stdout }}/workdir"
mode: "u=rwx,g=rwx,o=rwx"
state: directory

0 comments on commit 07d4ea7

Please sign in to comment.