Skip to main content

add_common_files

In git, common files in Modelbit are represented with symlinks. This CLI command provides a friendly API for creating symlinks when used within your Modelbit git repository.

tip

Be careful not to make symlinks within symlinked directories, or symlinks that point to other symlinks. That can have unexpected behavior.

Parameters

modelbit add_common_files [parameters]
  • --deployment, -d: Optional. The name of the deployment to receive symlinks to common files.
  • --job, -j: Optional. The name of the training job to receive symlinks to common files.
  • --pattern, -p: Optional. Only link the files in /common matching the pattern. Can be the name of a file or directory in common and does not include the prefix common/.

Examples

To use modelbit add_common_files, clone your repository with modelbit clone and change into the repo's directory.

Add all common files to a deployment

From within the example_deployment's subdirectory:

cd deployments/example_deployment
modelbit add_common_files

From the root of the repository, using the --deployment or -d argument to specify example_deployment as the target deployment:

modelbit add_common_files --deployment example_deployment

Add one file or directory from common/ to a deployment

Use the --pattern or -p argument to specify one file or directory to link from common/.

From within the example_deployment's subdirectory, add common/utils.py.

cd deployments/example_deployment
modelbit add_common_files --pattern utils.py

Or from the root of the repo for the deployment example_deployment, add the common/lib directory:

modelbit add_common_files --deployment example_deployment --pattern lib

Add one file or directory from common/ to a training job

Use the --pattern or -p argument to specify one file or directory to link from common/.

From within the example_job's subdirectory, add common/utils.py.

cd training_jobs/example_job
modelbit add_common_files --pattern utils.py

Or from the root of the repo for the training job example_job, add the common/lib directory:

modelbit add_common_files --job example_job --pattern lib

See also