run-tests.yml 1.32 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
- name: Run RCCL Tests
  hosts: all
  become: yes
  any_errors_fatal: true
  vars_files:
    - vars.yml

  tasks:
    - name: Create temp dir on remote host
      ansible.builtin.file:
        path: /tmp/{{ container_name }}/rccl-tests
        state: directory

    - name: Sync files to remote host
      ansible.posix.synchronize:
        src: "{{ playbook_dir }}/rccl-tests/"
        dest: /tmp/{{ container_name }}/rccl-tests/

    - name: Copy files into container
      ansible.builtin.shell: |
        docker cp /tmp/{{ container_name }}/rccl-tests/. {{ container_name }}:{{ work_dir }}
        docker cp /tmp/{{ container_name }}/rccl-tests/mpirun_rccltest {{ container_name }}:/usr/local/bin/mpirun_rccltest
        docker exec {{ container_name }} chmod +x /usr/local/bin/mpirun_rccltest

    - name: Run tests
      ansible.builtin.shell: |
        docker exec -e SSH_PORT={{ ssh_port | string }} \
          -w {{ work_dir }} \
          {{ container_name }} \
          bash {{ work_dir }}/{{ test_script }} 2>&1
      delegate_to: "{{ groups['all'][0] }}"
      run_once: true
      register: result

    - name: Show output
      ansible.builtin.debug:
        msg: "{{ result.stdout_lines }}"
      run_once: true

    - name: Cleanup temp dir
      ansible.builtin.file:
        path: /tmp/{{ container_name }}
        state: absent