ansible-runner icon indicating copy to clipboard operation
ansible-runner copied to clipboard

add flag to prevent writing artifacts stdout / stderr

Open chrismeyersfsu opened this issue 3 years ago • 0 comments

There is no way to prevent runner from writing to the stdout / stderr files in the artifacts directory https://github.com/ansible/ansible-runner/blob/devel/ansible_runner/runner.py#L150

Receptor also, effectively, writes the results of stdout to a file. This seems redundant & requires double the IOPS. Receptor needs to write stdout to disk to provide the resilience that it does to network performance. Runner should be made to allow for buffering of stdout/stderr in memory rather than on-disk.

Runner output vs. Receptor output

bash-4.4# pwd
/tmp/pdd_wrapper_4_3y98c646/awx_4_ee72yf9i/artifacts/4
bash-4.4# cat stdout
[WARNING]: You are running the development version of Ansible. You should only
run Ansible from "devel" if you are modifying the Ansible engine, or trying out
features under development. This is a rapidly changing source of code and can
become unstable at any point.
[WARNING]: You are running the development version of Ansible. You should only
run Ansible from "devel" if you are modifying the Ansible engine, or trying out
features under development. This is a rapidly changing source of code and can
become unstable at any point.

PLAY [Test playbook to sleep for a specified interval] *************************

TASK [sleep for a specified interval] ******************************************


bash-4.4# cd /tmp/receptor/awx_1/5cSFD0Qx/
bash-4.4# cat stdout
{"status": "starting", "runner_ident": "4", "command": ["podman", "run", "--rm", "--tty", "--interactive", "--workdir", "/runner/project", "-v", "/tmp/pdd_wrapper_4_3y98c646/awx_4_ee72yf9i:/runner:Z", "--env-file", "/tmp/pdd_wrapper_4_3y98c646/awx_4_ee72yf9i/artifacts/4/env.list", "--quiet", "--name", "ansible_runner_4", "--user=root", "quay.io/ansible/awx-ee:0.3.0", "ansible-playbook", "-u", "root", "-i", "/runner/inventory/hosts", "-e", "@/runner/env/extravars", "sleep.yml"], "env": {"LAUNCHED_BY_RUNNER": "1", "AWX_ISOLATED_DATA_DIR": "/runner/artifacts/4", "ANSIBLE_FORCE_COLOR": "True", "ANSIBLE_HOST_KEY_CHECKING": "False", "ANSIBLE_INVENTORY_UNPARSED_FAILED": "True", "ANSIBLE_PARAMIKO_RECORD_HOST_KEYS": "False", "AWX_PRIVATE_DATA_DIR": "/tmp/pdd_wrapper_4_3y98c646/awx_4_ee72yf9i", "JOB_ID": "4", "INVENTORY_ID": "1", "PROJECT_REVISION": "4b5995d36f3f50b91cd31de2c728f8b3b2e949ab", "ANSIBLE_RETRY_FILES_ENABLED": "False", "MAX_EVENT_RES": "700000", "AWX_HOST": "https://towerhost", "ANSIBLE_SSH_CONTROL_PATH_DIR": "/runner/cp", "ANSIBLE_COLLECTIONS_PATHS": "/runner/requirements_collections:~/.ansible/collections:/usr/share/ansible/collections", "ANSIBLE_ROLES_PATH": "/runner/requirements_roles:~/.ansible/roles:/usr/share/ansible/roles:/etc/ansible/roles", "ANSIBLE_STDOUT_CALLBACK": "awx_display", "RUNNER_OMIT_EVENTS": "False", "RUNNER_ONLY_FAILED_EVENTS": "False"}, "cwd": "/runner/project"}
{"status": "running", "runner_ident": "4"}
{"event": "verbose", "uuid": "311a9697-d6af-4428-8cff-1e2d4cd7f09c", "counter": 1, "stdout": "\u001b[1;35m[WARNING]: You are running the development version of Ansible. You should only\u001b[0m", "start_line": 0, "end_line": 1, "runner_ident": "4", "created": "2021-06-10T13:54:31.466440"}
{"event": "verbose", "uuid": "9922dd67-935b-49c7-9345-c8151b49c80a", "counter": 2, "stdout": "\u001b[1;35mrun Ansible from \"devel\" if you are modifying the Ansible engine, or trying out\u001b[0m", "start_line": 1, "end_line": 2, "runner_ident": "4", "created": "2021-06-10T13:54:31.473250"}
{"event": "verbose", "uuid": "67b33b0d-7671-4053-bd42-3cef8d1db85d", "counter": 3, "stdout": "\u001b[1;35mfeatures under development. This is a rapidly changing source of code and can\u001b[0m", "start_line": 2, "end_line": 3, "runner_ident": "4", "created": "2021-06-10T13:54:31.477528"}
{"event": "verbose", "uuid": "9c16515b-4dbf-42d3-9e17-31b26bcbfca7", "counter": 4, "stdout": "\u001b[1;35mbecome unstable at any point.\u001b[0m", "start_line": 3, "end_line": 4, "runner_ident": "4", "created": "2021-06-10T13:54:31.481309"}
{"event": "verbose", "uuid": "05e3454a-d707-4d5b-a4a1-43c8191f1f32", "counter": 5, "stdout": "\u001b[1;35m[WARNING]: You are running the development version of Ansible. You should only\u001b[0m", "start_line": 4, "end_line": 5, "runner_ident": "4", "created": "2021-06-10T13:54:32.176464"}
{"event": "verbose", "uuid": "0c93e6ad-4087-4705-9720-2b84ceb39ded", "counter": 6, "stdout": "\u001b[1;35mrun Ansible from \"devel\" if you are modifying the Ansible engine, or trying out\u001b[0m", "start_line": 5, "end_line": 6, "runner_ident": "4", "created": "2021-06-10T13:54:32.182893"}
{"event": "verbose", "uuid": "06297647-e04b-4ec8-bf26-386b27c8e2b0", "counter": 7, "stdout": "\u001b[1;35mfeatures under development. This is a rapidly changing source of code and can\u001b[0m", "start_line": 6, "end_line": 7, "runner_ident": "4", "created": "2021-06-10T13:54:32.186829"}
{"event": "verbose", "uuid": "0a8a40a4-4c87-4990-89c8-11d3a3c110af", "counter": 8, "stdout": "\u001b[1;35mbecome unstable at any point.\u001b[0m", "start_line": 7, "end_line": 8, "runner_ident": "4", "created": "2021-06-10T13:54:32.190766"}
{"uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "counter": 9, "stdout": "", "start_line": 8, "end_line": 8, "runner_ident": "4", "event": "playbook_on_start", "job_id": 4, "pid": 25, "created": "2021-06-10T13:54:32.650496", "event_data": {"playbook": "sleep.yml", "playbook_uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "uuid": "53b550dd-fe1a-4d3b-97de-033b35556248"}}
{"uuid": "82f75423-77f1-efee-a2d0-000000000006", "counter": 10, "stdout": "\r\nPLAY [Test playbook to sleep for a specified interval] *************************", "start_line": 8, "end_line": 10, "runner_ident": "4", "event": "playbook_on_play_start", "job_id": 4, "pid": 25, "created": "2021-06-10T13:54:32.653027", "parent_uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "event_data": {"playbook": "sleep.yml", "playbook_uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "play": "Test playbook to sleep for a specified interval", "play_uuid": "82f75423-77f1-efee-a2d0-000000000006", "play_pattern": "all", "name": "Test playbook to sleep for a specified interval", "pattern": "all", "uuid": "82f75423-77f1-efee-a2d0-000000000006"}}
{"uuid": "82f75423-77f1-efee-a2d0-000000000008", "counter": 11, "stdout": "\r\nTASK [sleep for a specified interval] ******************************************", "start_line": 10, "end_line": 12, "runner_ident": "4", "event": "playbook_on_task_start", "job_id": 4, "pid": 25, "created": "2021-06-10T13:54:32.676003", "parent_uuid": "82f75423-77f1-efee-a2d0-000000000006", "event_data": {"playbook": "sleep.yml", "playbook_uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "play": "Test playbook to sleep for a specified interval", "play_uuid": "82f75423-77f1-efee-a2d0-000000000006", "play_pattern": "all", "task": "sleep for a specified interval", "task_uuid": "82f75423-77f1-efee-a2d0-000000000008", "task_action": "command", "task_args": "", "task_path": "/runner/project/sleep.yml:10", "name": "sleep for a specified interval", "is_conditional": false, "uuid": "82f75423-77f1-efee-a2d0-000000000008"}}
{"uuid": "dfe5af76-118c-4f2c-af82-488ed531c409", "counter": 12, "stdout": "", "start_line": 12, "end_line": 12, "runner_ident": "4", "event": "runner_on_start", "job_id": 4, "pid": 25, "created": "2021-06-10T13:54:32.677036", "parent_uuid": "82f75423-77f1-efee-a2d0-000000000008", "event_data": {"playbook": "sleep.yml", "playbook_uuid": "53b550dd-fe1a-4d3b-97de-033b35556248", "play": "Test playbook to sleep for a specified interval", "play_uuid": "82f75423-77f1-efee-a2d0-000000000006", "play_pattern": "all", "task": "sleep for a specified interval", "task_uuid": "82f75423-77f1-efee-a2d0-000000000008", "task_action": "command", "task_args": "", "task_path": "/runner/project/sleep.yml:10", "host": "localhost", "uuid": "dfe5af76-118c-4f2c-af82-488ed531c409"}}

chrismeyersfsu avatar Jun 10 '21 15:06 chrismeyersfsu