From 75d9ede2fee3a84a37ba791f04aa5467f35a82a6 Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Tue, 7 Nov 2023 16:35:51 +0900 Subject: [PATCH 1/4] push new download logic for testing --- .../roles/download_models/defaults/main.yaml | 1 + ansible/roles/download_models/tasks/main.yaml | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 ansible/roles/download_models/defaults/main.yaml create mode 100644 ansible/roles/download_models/tasks/main.yaml diff --git a/ansible/roles/download_models/defaults/main.yaml b/ansible/roles/download_models/defaults/main.yaml new file mode 100644 index 0000000..542ff46 --- /dev/null +++ b/ansible/roles/download_models/defaults/main.yaml @@ -0,0 +1 @@ +data_dir: /opt/autoware/data diff --git a/ansible/roles/download_models/tasks/main.yaml b/ansible/roles/download_models/tasks/main.yaml new file mode 100644 index 0000000..661c2c3 --- /dev/null +++ b/ansible/roles/download_models/tasks/main.yaml @@ -0,0 +1,42 @@ +- name: Create data directory + ansible.builtin.file: + path: "{{ data_dir }}" + state: directory + +- name: Create tensorrt_yolox directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/tensorrt_yolox" + mode: "755" + state: directory + +- name: Download tensorrt_yolox/yolox-tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-tiny.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-tiny.onnx" + mode: "644" + checksum: sha256:471a665f4243e654dff62578394e508db22ee29fe65d9e389dfc3b0f2dee1255 + +- name: Download tensorrt_yolox/yolox-sPlus-opt.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.onnx + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.onnx" + mode: "644" + checksum: md5:bf3b0155351f90fcdca2626acbfd3bcf + +- name: Download tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/yolox-sPlus-opt.EntropyV2-calibration.table + dest: "{{ data_dir }}/tensorrt_yolox/yolox-sPlus-opt.EntropyV2-calibration.table" + mode: "644" + checksum: md5:c6e6f1999d5724a017516a956096701f + +- name: Download tensorrt_yolox/label.txt + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/label.txt + dest: "{{ data_dir }}/tensorrt_yolox/label.txt" + mode: "644" + checksum: sha256:3540a365bfd6d8afb1b5d8df4ec47f82cb984760d3270c9b41dbbb3422d09a0c From 7768136cff4d6f27a8cf3e01fd4c2135f1a326d4 Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Mon, 20 Nov 2023 11:04:44 +0900 Subject: [PATCH 2/4] add download_models as an optional task --- ansible/setup.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/setup.yaml b/ansible/setup.yaml index f7dfee4..4528253 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -18,6 +18,10 @@ prompt: |- [Warning] Do you want to configure the network? This configuration may overwrite the IP address of the specific network interface [y/N] private: false + - name: prompt_download_models + prompt: |- + [Warning] Do you want to download onnx models? [y/N] + private: false roles: - role: autoware - role: cuda @@ -34,3 +38,5 @@ when: prompt_configure_network == 'y' - role: netplan when: prompt_configure_network == 'y' + - role: download_models + when: prompt_download_models == 'y' \ No newline at end of file From c09ad93ad89f2ab724c8a598e614b73e71215253 Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Mon, 20 Nov 2023 11:27:19 +0900 Subject: [PATCH 3/4] give root privilege to download-models --- ansible/roles/download_models/tasks/main.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ansible/roles/download_models/tasks/main.yaml b/ansible/roles/download_models/tasks/main.yaml index 661c2c3..d7a9e5e 100644 --- a/ansible/roles/download_models/tasks/main.yaml +++ b/ansible/roles/download_models/tasks/main.yaml @@ -1,9 +1,11 @@ - name: Create data directory + become: true ansible.builtin.file: path: "{{ data_dir }}" state: directory - name: Create tensorrt_yolox directory inside {{ data_dir }} + become: true ansible.builtin.file: path: "{{ data_dir }}/tensorrt_yolox" mode: "755" From 2f1f10539b6e024fc2a07991992fdc0ee7f8661e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 06:50:12 +0000 Subject: [PATCH 4/4] style(pre-commit): autofix --- ansible/setup.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/setup.yaml b/ansible/setup.yaml index 4528253..a34937c 100644 --- a/ansible/setup.yaml +++ b/ansible/setup.yaml @@ -39,4 +39,4 @@ - role: netplan when: prompt_configure_network == 'y' - role: download_models - when: prompt_download_models == 'y' \ No newline at end of file + when: prompt_download_models == 'y'