Skip to content

Commit 40b76c0

Browse files
authored
[ansible][nic_simulator] Re-generate py dependencies in deployment (sonic-net#8477)
Approach What is the motivation for this PR? Generate the nic_simulator gRPC Python dependencies in deployment. Signed-off-by: Longxiang Lyu lolv@microsoft.com How did you do it? How did you verify/test it? verified on dualtor-aa testbed Any platform specific information?
1 parent 0caeaad commit 40b76c0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

ansible/roles/vm_set/tasks/control_nic_simulator.yml

+9
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,22 @@
5050
- name: Set nic simulator source directory
5151
set_fact:
5252
nic_simulator_dir: "{{ (playbook_dir, 'dualtor', 'nic_simulator') | path_join }}"
53+
remote_nic_simulator_dir: "{{ (abs_root_path, 'nic_simulator') | path_join }}"
5354

5455
- name: Copy nic simulator to test server
5556
copy:
5657
src: "{{ nic_simulator_dir }}"
5758
dest: "{{ abs_root_path }}"
5859
force: yes
5960

61+
- name: Generate gRPC dependencies from the protocol buffer definitions
62+
shell:
63+
cmd: python3 -m grpc.tools.protoc -I. --python_out=. --grpc_python_out=. {{ item }}
64+
chdir: "{{ remote_nic_simulator_dir }}"
65+
loop:
66+
- nic_simulator_grpc_service.proto
67+
- nic_simulator_grpc_mgmt_service.proto
68+
6069
- name: Generate nic simulator systemd service file
6170
template:
6271
src: nic-simulator.service.j2

0 commit comments

Comments
 (0)