Skip to content

Commit 1e9ef96

Browse files
maryamtahhanclaude
andcommitted
fix: address CodeRabbit review comments and fetch directory issue
- Fix vllm CLI flag format from --no_enable_prefix_caching to --no-enable-prefix-caching - Improve SSH security by using StrictHostKeyChecking=accept-new instead of no - Add API key source resolution (env_var, file_path, vault_var, prompt) with no_log protection - Add test_type validation in benchmark_embedding role - Mask HF_TOKEN in logs for benchmark_guidellm host execution - Add collection_id partition to results path for run-level organization - Replace ansible.builtin.fetch with ansible.posix.synchronize for directory transfers Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Maryam Tahhan <mtahhan@redhat.com>
1 parent 7fc8ecf commit 1e9ef96

File tree

10 files changed

+90
-19
lines changed

10 files changed

+90
-19
lines changed

automation/test-execution/ansible/embedding-core-sweep.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@
5151

5252
tasks:
5353
- name: Fetch all core sweep results
54-
ansible.builtin.fetch:
54+
ansible.posix.synchronize:
5555
src: "{{ bench_config.results_dir }}/core-sweep/"
5656
dest: "{{ playbook_dir }}/../../results/embedding-models/core-sweep-{{ test_run_id }}/"
57-
flat: false
57+
mode: pull
58+
recursive: true
5859

5960
- name: Display results location
6061
ansible.builtin.debug:

automation/test-execution/ansible/inventory/group_vars/all/infrastructure.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# These affect all test runs regardless of model or workload type
77

88
# SSH configuration
9-
ansible_ssh_common_args: "-o StrictHostKeyChecking=no"
9+
ansible_ssh_common_args: "-o StrictHostKeyChecking=accept-new"
1010

1111
# Platform setup options
1212
platform_setup:

automation/test-execution/ansible/inventory/group_vars/all/test-workloads.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test_configs:
3131
backend: "openai-completions"
3232
vllm_args:
3333
- "--dtype=bfloat16"
34-
- "--no_enable_prefix_caching"
34+
- "--no-enable-prefix-caching"
3535
kv_cache_space: "40GiB"
3636

3737
# Chat workload (short input, short output)
@@ -42,7 +42,7 @@ test_configs:
4242
backend: "openai-chat"
4343
vllm_args:
4444
- "--dtype=bfloat16"
45-
- "--no_enable_prefix_caching"
45+
- "--no-enable-prefix-caching"
4646
kv_cache_space: "40GiB"
4747

4848
# Code generation workload (long input, long output)
@@ -53,7 +53,7 @@ test_configs:
5353
backend: "openai-completions"
5454
vllm_args:
5555
- "--dtype=bfloat16"
56-
- "--no_enable_prefix_caching"
56+
- "--no-enable-prefix-caching"
5757
kv_cache_space: "60GiB"
5858

5959
# RAG workload (very long input, short output)
@@ -64,5 +64,5 @@ test_configs:
6464
backend: "openai-completions"
6565
vllm_args:
6666
- "--dtype=bfloat16"
67-
- "--no_enable_prefix_caching"
67+
- "--no-enable-prefix-caching"
6868
kv_cache_space: "80GiB"

automation/test-execution/ansible/llm-benchmark-auto.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,10 +235,11 @@
235235
dest: "{{ bench_config.results_dir }}/{{ test_model | replace('/', '__') }}/{{ workload_type }}/{{ core_configuration.name }}/test-metadata.json"
236236

237237
- name: Fetch results to local machine
238-
ansible.builtin.fetch:
238+
ansible.posix.synchronize:
239239
src: "{{ bench_config.results_dir }}/{{ test_model | replace('/', '__') }}/{{ workload_type }}/{{ core_configuration.name }}/"
240240
dest: "{{ playbook_dir }}/../../../results/llm/{{ test_model | replace('/', '__') }}/{{ workload_type }}-{{ test_run_id }}/"
241-
flat: false
241+
mode: pull
242+
recursive: true
242243

243244
- name: Display results location
244245
ansible.builtin.debug:

automation/test-execution/ansible/llm-core-sweep-auto.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,11 @@
178178
tasks:
179179
- block:
180180
- name: Fetch all core sweep results
181-
ansible.builtin.fetch:
181+
ansible.posix.synchronize:
182182
src: "{{ bench_config.results_dir }}/{{ test_model | replace('/', '__') }}/{{ workload_type }}/"
183183
dest: "{{ playbook_dir }}/../../../results/llm/{{ test_model | replace('/', '__') }}/{{ workload_type }}-{{ test_run_id }}/"
184-
flat: false
184+
mode: pull
185+
recursive: true
185186

186187
- name: Display results location
187188
ansible.builtin.debug:

automation/test-execution/ansible/llm-core-sweep.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,11 @@
8080

8181
tasks:
8282
- name: Fetch all core sweep results
83-
ansible.builtin.fetch:
83+
ansible.posix.synchronize:
8484
src: "{{ bench_config.results_dir }}/{{ test_model | replace('/', '__') }}/{{ workload_type }}/"
8585
dest: "{{ playbook_dir }}/../../../results/llm/{{ test_model | replace('/', '__') }}/{{ workload_type }}-{{ test_run_id }}/"
86-
flat: false
86+
mode: pull
87+
recursive: true
8788

8889
- name: Display results location
8990
ansible.builtin.debug:

automation/test-execution/ansible/playbooks/common/tasks/setup-vllm-api-key.yml

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,76 @@
66
- name: Setup vLLM API key for external endpoints
77
when: vllm_endpoint.external.api_key.enabled | default(false) | bool
88
block:
9+
- name: Get API key from environment variable
10+
ansible.builtin.set_fact:
11+
vllm_api_key_resolved: "{{ lookup('env', vllm_endpoint.external.api_key.env_var) }}"
12+
when:
13+
- vllm_endpoint.external.api_key.source | default('value') == 'env_var'
14+
- vllm_endpoint.external.api_key.env_var is defined
15+
no_log: true
16+
17+
- name: Get API key from file
18+
ansible.builtin.slurp:
19+
src: "{{ vllm_endpoint.external.api_key.file_path }}"
20+
register: vllm_api_key_file_content
21+
when:
22+
- vllm_endpoint.external.api_key.source | default('value') == 'file_path'
23+
- vllm_endpoint.external.api_key.file_path is defined
24+
no_log: true
25+
26+
- name: Set API key from file content
27+
ansible.builtin.set_fact:
28+
vllm_api_key_resolved: "{{ vllm_api_key_file_content.content | b64decode | trim }}"
29+
when:
30+
- vllm_endpoint.external.api_key.source | default('value') == 'file_path'
31+
- vllm_api_key_file_content is defined
32+
no_log: true
33+
34+
- name: Get API key from Ansible vault
35+
ansible.builtin.set_fact:
36+
vllm_api_key_resolved: "{{ vllm_endpoint.external.api_key.vault_var }}"
37+
when:
38+
- vllm_endpoint.external.api_key.source | default('value') == 'vault_var'
39+
- vllm_endpoint.external.api_key.vault_var is defined
40+
no_log: true
41+
42+
- name: Prompt for API key
43+
ansible.builtin.pause:
44+
prompt: "Enter your vLLM API key"
45+
echo: false
46+
register: vllm_api_key_prompt
47+
when:
48+
- vllm_endpoint.external.api_key.source | default('value') == 'prompt'
49+
no_log: true
50+
51+
- name: Set API key from prompt
52+
ansible.builtin.set_fact:
53+
vllm_api_key_resolved: "{{ vllm_api_key_prompt.user_input }}"
54+
when:
55+
- vllm_endpoint.external.api_key.source | default('value') == 'prompt'
56+
- vllm_api_key_prompt is defined
57+
no_log: true
58+
59+
- name: Use direct value if no source specified
60+
ansible.builtin.set_fact:
61+
vllm_api_key_resolved: "{{ vllm_endpoint.external.api_key.value }}"
62+
when:
63+
- vllm_endpoint.external.api_key.source | default('value') == 'value'
64+
- vllm_endpoint.external.api_key.value is defined
65+
no_log: true
66+
967
- name: Validate API key configuration
1068
ansible.builtin.assert:
1169
that:
12-
- vllm_endpoint.external.api_key.value is defined
13-
- vllm_endpoint.external.api_key.value is not none
14-
- vllm_endpoint.external.api_key.value | length > 0
70+
- vllm_api_key_resolved is defined
71+
- vllm_api_key_resolved is not none
72+
- vllm_api_key_resolved | length > 0
1573
fail_msg: "API key value is required when api_key.enabled is true"
1674
success_msg: "API key configuration validated"
1775

1876
- name: Set vLLM API key fact
1977
ansible.builtin.set_fact:
20-
vllm_api_key: "{{ vllm_endpoint.external.api_key.value }}"
78+
vllm_api_key: "{{ vllm_api_key_resolved }}"
2179
no_log: true
2280

2381
- name: Display API key status

automation/test-execution/ansible/roles/benchmark_embedding/tasks/main.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
# Benchmark Embedding Role - Main Entry Point
33
# Runs embedding model benchmarks using vllm-bench
44

5+
- name: Validate test_type
6+
ansible.builtin.assert:
7+
that:
8+
- test_type is defined
9+
- test_type in ['baseline', 'latency', 'all']
10+
fail_msg: "Invalid test_type '{{ test_type | default('undefined') }}'. Must be one of: baseline, latency, all"
11+
success_msg: "test_type validated: {{ test_type }}"
12+
513
- name: Run baseline performance test (throughput sweep)
614
ansible.builtin.include_tasks: baseline.yml
715
when: test_type == 'baseline' or test_type == 'all'

automation/test-execution/ansible/roles/benchmark_guidellm/tasks/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@
233233
register: guidellm_host_result
234234
changed_when: true
235235
failed_when: false
236+
no_log: true
236237
when: not (use_guidellm_container | bool)
237238

238239
# ============================================================================

automation/test-execution/ansible/roles/results_collector/tasks/collect-test-results.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
- name: Fetch test results to controller
1414
ansible.posix.synchronize:
1515
src: "{{ bench_config.results_dir }}/"
16-
dest: "{{ playbook_dir }}/../../../results/benchmark-results/{{ inventory_hostname }}/"
16+
dest: "{{ playbook_dir }}/../../../results/benchmark-results/{{ inventory_hostname }}/{{ collection_id }}/"
1717
mode: pull
1818
recursive: true
1919
when: results_dir_stat.stat.exists
2020

2121
- name: Display results collection status
2222
ansible.builtin.debug:
23-
msg: "{{ 'Results fetched from ' + bench_config.results_dir + ' to results/benchmark-results/' + inventory_hostname + '/' if results_dir_stat.stat.exists else 'No results directory found' }}"
23+
msg: "{{ 'Results fetched from ' + bench_config.results_dir + ' to results/benchmark-results/' + inventory_hostname + '/' + collection_id + '/' if results_dir_stat.stat.exists else 'No results directory found' }}"

0 commit comments

Comments
 (0)