{"id":18096076,"url":"https://github.com/newplan/cluster_manager","last_synced_at":"2025-04-06T03:22:36.899Z","repository":{"id":134550085,"uuid":"404632008","full_name":"NEWPLAN/cluster_manager","owner":"NEWPLAN","description":"a python3-based wrapper to submit execution task to the remote clusters","archived":false,"fork":false,"pushed_at":"2024-01-09T10:19:41.000Z","size":143,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-12T09:34:46.612Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NEWPLAN.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-09T07:46:29.000Z","updated_at":"2024-05-08T14:03:24.000Z","dependencies_parsed_at":"2024-01-08T06:45:01.089Z","dependency_job_id":"3bcc3833-0350-4c5b-b239-41625fdc11df","html_url":"https://github.com/NEWPLAN/cluster_manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NEWPLAN%2Fcluster_manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NEWPLAN%2Fcluster_manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NEWPLAN%2Fcluster_manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NEWPLAN%2Fcluster_manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NEWPLAN","download_url":"https://codeload.github.com/NEWPLAN/cluster_manager/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427955,"owners_count":20937376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T19:12:29.389Z","updated_at":"2025-04-06T03:22:36.878Z","avatar_url":"https://github.com/NEWPLAN.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cluster_manager\nA python3-based wrapper to submit execution task to the remote clusters. It supports three basic functions as follows.\n\n### synchronous execution:\nif you want to execute a command (e.g., cd XXXXX; make build; echo DONE;), you could use the following script:\n```python3 ssh_controller.py --cmd=\"cd XXXXX; make build; echo DONE;\" --allow_print=\"g13\"```, the script would help you printed the execution result until all commands are executed.\nIf you want to run the command in sudo mode, you could append ```--sudo``` in the above script.\n### asynchronous execution:\nusing the above task as an example,  you could use the following script:\n```python3 ssh_controller.py --cmd=\"cd XXXXX; make build; echo DONE;\" --allow_print=\"g13\" --interactive```, the script would help you printed the execution result once there are output in the remote\n### sftp\nIt allows the user to sync files from a local path (indicated by ```--sync_path```) to the remote clusters (the same path)\n``` bash\npython3 ssh_controller.py --sync --sync_path=\"XXXXX\"\n```\n\n\n# How to use (Examples)\n### Upload files (broadcast)\n``` bash\n### brodcast folder from local to remote(cluster)\nssh_controller.py --sync --sync_path=\"PATH_TO_YOUR_FOLDER\"\n```\n### Multiple cmds together\n``` shell\n## using sudo to execute some cmd in cluster\n ssh_controller.py --cmd=\"mlnx_qos -i eth2 | grep enabled\" --allow_print=\"all\" --sudo\n```\n\n### Execute in interactive mode\n``` bash\npython3 ssh_controller.py --cmd='cd /mesh_comm_service; RCL_MAX_VLOG_LEVEL=2 ./build/mesh_comm_service --cluster 12.12.12.111 12.12.12.112 12.12.12.113 12.12.12.114 12.12.12.115 12.12.12.116 12.12.12.110 12.12.12.109 12.12.12.108 12.12.12.107 12.12.12.106 12.12.12.105 12.12.12.104 12.12.12.103 12.12.12.102 12.12.12.101' --alow_print=\"g11\" --interactive\n```\n\n# Some other cmds\n\n``` bash \n### if you want to kill some threads, you could use as --cmd=\nps -aux | grep mesh_comm_service | grep -v ssh | awk \\'{print $2}\\' | xargs kill\n```\n\n# arguments:\n\n- **usage**: \n  ``` bash\n   ssh_controller.py [-h] [--H H] [--cmd CMD] [--sync] [--sync_path SYNC_PATH] \n   [--sudo] [--user USER] [--passwd PASSWD] [--port PORT] [--host HOST] \n   [--allow_print ALLOW_PRINT] [--interactive] [--use_glog] [--env ENV] \n   [--enable_full_log]\n    ```\n\n\n\n- **optional arguments**:\n\n| cmds                      | Description                                                           | Tested |\n| ------------------------- | --------------------------------------------------------------------- | ------ |\n| -h, --help                | show this help message and exit                                       | Yes    |\n| --H H                     | host ID [1,2,3,4,5]                                                   | No     |\n| --cmd CMD                 | executing your command                                                | Yes    |\n| --sync                    | Sync data                                                             | Yes    |\n| --sync_path SYNC_PATH     | The path of folder to sync                                            | Yes    |\n| --sudo                    | executing your command \u003cbr\u003e  working under sudo mode                  | Yes    |\n| --user USER               | username to login                                                     | No     |\n| --passwd PASSWD           | password to login                                                     | No     |\n| --port PORT               | the port of ssh service                                               | No     |\n| --host HOST               | the host ip for this session                                          | No     |\n| --allow_print ALLOW_PRINT | the node to display the ret, split by ',' or all to show all the node | Yes    |\n| --interactive             | working under interactive mode                                        | Yes    |\n| --use_glog                | enable glog as logger or not                                          | Yes    |\n| --env ENV                 | speficy the environment for execution                                 | No     |\n| --enable_full_log         | enable full log for other module                                      | Yes    |\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewplan%2Fcluster_manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewplan%2Fcluster_manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewplan%2Fcluster_manager/lists"}