Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check dependencies early and explicitely #3

Open
ycongal-smile opened this issue Oct 10, 2024 · 4 comments
Open

Check dependencies early and explicitely #3

ycongal-smile opened this issue Oct 10, 2024 · 4 comments

Comments

@ycongal-smile
Copy link
Contributor

The playbooks have recursively some dependencies. It would be better to check is they are satisfied early in playbooks deployment, ideally with an explicit error message.

For example, here the missing dependencies I have run into:

  • localhost needs matplotlib
  • subscriber need rsync, psmisc, tshark
@ycongal-smile
Copy link
Contributor Author

Another element that could be checked:

  • sudo must be configured on the subscriber
  • User root is most likely the best bet seeing what the script does on each target (dump interfaces, install bpf programs, RT priority, ...)

@ycongal-smile
Copy link
Contributor Author

Another thing to check : A sv_timestamp_logger container must not exist before running the tool:

fatal: [10.0.0.2]: FAILED! => 
{
  "changed": true,
  "cmd": [ "docker", "run", "--privileged", "-d", "-v", "/tmp:/tmp", "--cpuset-cpus=1", "--name", "sv_timestamp_logger", "--network=host", "sv_timestamp_logger", "-d", "enp24s0", "-f", "/tmp/ts_sv_10.0.0.2", "-s", "4001", "--first_SV_cnt", "280", "-t", "--max_SV_cnt", "4000" ],
  "delta": "0:00:00.019005",
  "end": "2024-10-28 10:39:31.748123",
  "msg": "non-zero return code",
  "rc": 125,
  "start": "2024-10-28 10:39:31.729118",
  "stderr": "docker: Error response from daemon: Conflict. The container name \"/sv_timestamp_logger\" is already in use by container \"eadeb3effe78c8fbcc53d5b06cbb74f48f5a495ac0bdfe0456abe4b66e42aa45\". You have to remove (or rename) that container to be able to reuse that name.\nSee 'docker run --help'.",
  "stderr_lines": [
    "docker: Error response from daemon: Conflict. The container name \"/sv_timestamp_logger\" is already in use by container \"eadeb3effe78c8fbcc53d5b06cbb74f48f5a495ac0bdfe0456abe4b66e42aa45\". You have to remove (or rename) that container to be able to reuse that name.",
    "See 'docker run --help'."
  ],
  "stdout": "",
  "stdout_lines": []
}

@Paullgk
Copy link
Member

Paullgk commented Oct 30, 2024

Hello Yoann,

  • We are planning to improve the README to provide a clearer description of the dependencies required to run svtrace. This update should be available soon. Additionally, target package dependencies could be verified through assertions in a test playbook.

  • Regarding the Sudo check, we assume that the user executing the Ansible playbook has sufficient privileges to run commands on the target, using become: true. The privileges escalation is already done by Ansible.

@ycongal-smile
Copy link
Contributor Author

ycongal-smile commented Oct 30, 2024

Hello Yoann,

  • We are planning to improve the README to provide a clearer description of the dependencies required to run svtrace. This update should be available soon. Additionally, target package dependencies could be verified through assertions in a test playbook.

Awesome!

  • Regarding the Sudo check, we assume that the user executing the Ansible playbook has sufficient privileges to run commands on the target, using become: true. The privileges escalation is already done by Ansible.

Please check this assumption. Or have a clear documentation for the user variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants