From e579659699b4571a69990efc5861914e4701a4f6 Mon Sep 17 00:00:00 2001 From: Yujun Zhang Date: Sat, 22 Apr 2017 22:19:27 +0800 Subject: Unify workdir - use role variable `workdir` - download dependencies to remote workdir with checksum Change-Id: I2a7991e014e365fec532520c2b57a3fe480914d8 Signed-off-by: Yujun Zhang --- .../ansible_roles/unixbench/defaults/main.yml | 12 ---------- resources/ansible_roles/unixbench/tasks/main.yml | 26 ++++++++++++++-------- resources/ansible_roles/unixbench/vars/main.yml | 12 ++++++++++ 3 files changed, 29 insertions(+), 21 deletions(-) delete mode 100644 resources/ansible_roles/unixbench/defaults/main.yml create mode 100644 resources/ansible_roles/unixbench/vars/main.yml (limited to 'resources/ansible_roles/unixbench') diff --git a/resources/ansible_roles/unixbench/defaults/main.yml b/resources/ansible_roles/unixbench/defaults/main.yml deleted file mode 100644 index d1facef5..00000000 --- a/resources/ansible_roles/unixbench/defaults/main.yml +++ /dev/null @@ -1,12 +0,0 @@ -############################################################################# -# Copyright (c) 2017 ZTE Corporation and others. -# -# All rights reserved. This program and the accompanying materials -# are made available under the terms of the Apache License, Version 2.0 -# which accompanies this distribution, and is available at -# http://www.apache.org/licenses/LICENSE-2.0 -############################################################################# - -cwd: "{{ ansible_env.HOME }}/qtip/unixbench" -iterations: 1 -parallel_copies: 1 \ No newline at end of file diff --git a/resources/ansible_roles/unixbench/tasks/main.yml b/resources/ansible_roles/unixbench/tasks/main.yml index 58f0608d..ff2c3534 100644 --- a/resources/ansible_roles/unixbench/tasks/main.yml +++ b/resources/ansible_roles/unixbench/tasks/main.yml @@ -9,29 +9,37 @@ - name: make unixbench working directory file: - path: "{{ cwd }}" + path: "{{ workdir }}" state: directory -- name: download unixbench source code - unarchive: - src: https://github.com/kdlucas/byte-unixbench/archive/v5.1.3.tar.gz - dest: "{{ cwd }}" - remote_src: yes +- name: downloading unixbench source code + get_url: + url: https://github.com/kdlucas/byte-unixbench/archive/v5.1.3.tar.gz + dest: "{{ workdir }}" + checksum: "sha256:3a6bb00f270a5329682dff20fd2c1ab5332ef046eb54a96a0d7bd371005d31a3" + +- name: extracting unixbench source code + # TODO(yujunz) unarchive may not work with long path (local: macOS, workdir: /root/qtip-workdir-20170423-0836/) + command: "tar zxf byte-unixbench-5.1.3.tar.gz" + args: + chdir: "{{ workdir }}" + creates: byte-unixbench-5.1.3 - name: build UnixBench command: "make" args: - chdir: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench" + chdir: "{{ workdir }}/byte-unixbench-5.1.3/UnixBench" + creates: Run - name: run whetstone and dhrystone shell: "./Run -i {{ iterations }} -c {{ parallel_copies }} dhrystone whetstone" args: - chdir: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench" + chdir: "{{ workdir }}/byte-unixbench-5.1.3/UnixBench" - name: synchronize test results to local synchronize: mode: pull - src: "{{ cwd }}/byte-unixbench-5.1.3/UnixBench/results/" + src: "{{ workdir }}/byte-unixbench-5.1.3/UnixBench/results/" dest: "{{ qtip_results }}/unixbench" use_ssh_args: yes diff --git a/resources/ansible_roles/unixbench/vars/main.yml b/resources/ansible_roles/unixbench/vars/main.yml new file mode 100644 index 00000000..8fc1e0d2 --- /dev/null +++ b/resources/ansible_roles/unixbench/vars/main.yml @@ -0,0 +1,12 @@ +############################################################################# +# Copyright (c) 2017 ZTE Corporation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Apache License, Version 2.0 +# which accompanies this distribution, and is available at +# http://www.apache.org/licenses/LICENSE-2.0 +############################################################################# + +workdir: "{{ qtip_workdir }}/unixbench" +iterations: 1 +parallel_copies: 1 -- cgit 1.2.3-korg