Skip to content

remote-run-commands

Automatically generated README for this automation recipe: remote-run-commands

Category: Remote automation

License: Apache 2.0

  • Notes from the authors, contributors and users: README-extra

  • CM meta description for this script: _cm.json

  • Output cached? False

Reuse this script in your project

Install MLCommons CM automation meta-framework

Pull CM repository with this automation recipe (CM script)

cm pull repo mlcommons@cm4mlops

cmr "remote run cmds remote-run remote-run-cmds ssh-run ssh" --help

Run this script

Run this script via CLI
cm run script --tags=remote,run,cmds,remote-run,remote-run-cmds,ssh-run,ssh [--input_flags]
Run this script via CLI (alternative)
cmr "remote run cmds remote-run remote-run-cmds ssh-run ssh " [--input_flags]
Run this script from Python
import cmind

r = cmind.access({'action':'run'
              'automation':'script',
              'tags':'remote,run,cmds,remote-run,remote-run-cmds,ssh-run,ssh'
              'out':'con',
              ...
              (other input keys for this script)
              ...
             })

if r['return']>0:
    print (r['error'])
Run this script via Docker (beta)
cm docker script "remote run cmds remote-run remote-run-cmds ssh-run ssh" [--input_flags]

Script flags mapped to environment

  • --client_refresh=valueCM_SSH_CLIENT_REFRESH=value
  • --host=valueCM_SSH_HOST=value
  • --password=valueCM_SSH_PASSWORD=value
  • --port=valueCM_SSH_PORT=value
  • --run_cmds=valueCM_SSH_RUN_COMMANDS=value
  • --skip_host_verify=valueCM_SSH_SKIP_HOST_VERIFY=value
  • --ssh_key_file=valueCM_SSH_KEY_FILE=value
  • --user=valueCM_SSH_USER=value

Default environment

These keys can be updated via --env.KEY=VALUE or env dictionary in @input.json or using script flags.

  • CM_SSH_PORT: 22
  • CM_SSH_HOST: localhost
  • CM_SSH_USER: $USER
  • CM_SSH_CLIENT_REFRESH: 10
  • CM_SSH_KEY_FILE: $HOME/.ssh/id_rsa

Native script being run


Script output

cmr "remote run cmds remote-run remote-run-cmds ssh-run ssh " [--input_flags] -j