Skip to content

run-docker-container

Automatically generated README for this automation recipe: run-docker-container

Category: Docker automation

License: Apache 2.0

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

  • CM meta description for this script: _cm.yaml

  • 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 "run docker container" --help

Run this script

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

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

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

Script flags mapped to environment

  • --all_gpus=valueCM_DOCKER_ADD_ALL_GPUS=value
  • --base=valueCM_DOCKER_IMAGE_BASE=value
  • --cache=valueCM_DOCKER_CACHE=value
  • --cm_repo=valueCM_MLOPS_REPO=value
  • --detached=valueCM_DOCKER_DETACHED_MODE=value
  • --device=valueCM_DOCKER_ADD_DEVICE=value
  • --docker_image_base=valueCM_DOCKER_IMAGE_BASE=value
  • --docker_os=valueCM_DOCKER_OS=value
  • --docker_os_version=valueCM_DOCKER_OS_VERSION=value
  • --extra_run_args=valueCM_DOCKER_EXTRA_RUN_ARGS=value
  • --fake_run_option=valueCM_DOCKER_FAKE_RUN_OPTION=value
  • --gh_token=valueCM_GH_TOKEN=value
  • --image_name=valueCM_DOCKER_IMAGE_NAME=value
  • --image_repo=valueCM_DOCKER_IMAGE_REPO=value
  • --image_tag=valueCM_DOCKER_IMAGE_TAG=value
  • --image_tag_extra=valueCM_DOCKER_IMAGE_TAG_EXTRA=value
  • --interactive=valueCM_DOCKER_INTERACTIVE_MODE=value
  • --it=valueCM_DOCKER_INTERACTIVE=value
  • --mounts=valueCM_DOCKER_VOLUME_MOUNTS=value
  • --num_gpus=valueCM_DOCKER_ADD_NUM_GPUS=value
  • --pass_user_group=valueCM_DOCKER_PASS_USER_GROUP=value
  • --port_maps=valueCM_DOCKER_PORT_MAPS=value
  • --post_run_cmds=valueCM_DOCKER_POST_RUN_COMMANDS=value
  • --pre_run_cmds=valueCM_DOCKER_PRE_RUN_COMMANDS=value
  • --real_run=valueCM_REAL_RUN=value
  • --recreate=valueCM_DOCKER_IMAGE_RECREATE=value
  • --run_cmd=valueCM_DOCKER_RUN_CMD=value
  • --run_cmd_extra=valueCM_DOCKER_RUN_CMD_EXTRA=value
  • --save_script=valueCM_DOCKER_SAVE_SCRIPT=value
  • --script_tags=valueCM_DOCKER_RUN_SCRIPT_TAGS=value
  • --shm_size=valueCM_DOCKER_SHM_SIZE=value

Default environment

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

  • CM_DOCKER_DETACHED_MODE: yes

Script output

cmr "run docker container " [--input_flags] -j