From d602ac3c85ef5f11503b08ca321f5f3890d2431a Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Tue, 7 Nov 2023 16:26:18 +0900 Subject: [PATCH 1/3] 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 00000000000..542ff46d5c0 --- /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 00000000000..27a898531b7 --- /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 lidar_centerpoint directory inside {{ data_dir }} + ansible.builtin.file: + path: "{{ data_dir }}/lidar_centerpoint" + mode: "755" + state: directory + +- name: Download lidar_centerpoint/pts_voxel_encoder_centerpoint.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_voxel_encoder_centerpoint.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_voxel_encoder_centerpoint.onnx" + mode: "644" + checksum: sha256:dc1a876580d86ee7a341d543f8ade2ede7f43bd032dc5b44155b1f0175405764 + +- name: Download lidar_centerpoint/pts_backbone_neck_head_centerpoint.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_backbone_neck_head_centerpoint.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_backbone_neck_head_centerpoint.onnx" + mode: "644" + checksum: sha256:3fe7e128955646740c41a25be0c8f141d5a94594fe79d7405fe2a859e391542e + +- name: Download lidar_centerpoint/pts_voxel_encoder_centerpoint_tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_voxel_encoder_centerpoint_tiny.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_voxel_encoder_centerpoint_tiny.onnx" + mode: "644" + checksum: sha256:2c53465715c1fd2e9dc5727ef3fca74f4cdf0538f74286b0946e219d0ca5693b + +- name: Download lidar_centerpoint/pts_backbone_neck_head_centerpoint_tiny.onnx + become: true + ansible.builtin.get_url: + url: https://awf.ml.dev.web.auto/perception/models/centerpoint/v2/pts_backbone_neck_head_centerpoint_tiny.onnx + dest: "{{ data_dir }}/lidar_centerpoint/pts_backbone_neck_head_centerpoint_tiny.onnx" + mode: "644" + checksum: md5:e4658325b70222f7c3637fe00e586b82 From 7de2ec70b1905feebfa53324220df425b2c708c4 Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Mon, 20 Nov 2023 11:25:06 +0900 Subject: [PATCH 2/3] add download models option to edge auto playbook --- ansible/playbooks/edge_auto.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/playbooks/edge_auto.yaml b/ansible/playbooks/edge_auto.yaml index 27b5a0bb983..7868c12b7be 100644 --- a/ansible/playbooks/edge_auto.yaml +++ b/ansible/playbooks/edge_auto.yaml @@ -13,6 +13,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 pre_tasks: - name: Verify OS ansible.builtin.fail: @@ -65,3 +69,5 @@ when: prompt_configure_network == 'y' - role: autoware.dev_env.netplan when: prompt_configure_network == 'y' + - role: download_models + when: prompt_download_models == 'y' From a2acc5663e233077708fab6d110de0f41e2493cb Mon Sep 17 00:00:00 2001 From: Benjamin Gilby Date: Mon, 20 Nov 2023 11:26:41 +0900 Subject: [PATCH 3/3] 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 27a898531b7..5307da02e98 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 lidar_centerpoint directory inside {{ data_dir }} + become: true ansible.builtin.file: path: "{{ data_dir }}/lidar_centerpoint" mode: "755"