file_mounts backed by cloud storage buckets/credentials (the object
storage sync flow described below) is deprecated and will be removed in a
future version of Konduktor. Prefer building your application code into
your image or using workdir/git-based sync instead.
Users have the following options for submitting their application code as a Trainy workload.
- (Re)building a docker image for every change and pushing it to a registry for launching a workload.
- Committing changes to a development branch in git and checking it out in the workload
- Synchronizing application code through file sync via
file_mounts and workdir definitions.
The first option is often slow given the size of deep learning images so we focus on the the latter two here.
Full setup for file sync requires cloud storage configuration which can be found here.
Konduktor mounts your cloud credentials into the job containers and places them in ~/.aws (S3) or ~/.config/gcloud (GS) at startup. If you plan to use command-line tools like aws s3, gsutil, or gcloud, ensure your image includes those CLIs or install them in your run: block.
We check our cloud service account credentials in the Trainy cluster with this:
Afterwards we configure the storage provider by setting ~/.konduktor/config.yaml
When we run konduktor launch two things happen atomically in this order. If any step fails, the workload will fast-fail.
workdir and file_mounts are synchronized to object storage
- workload is submitted
- workload, once active, will sync down
workdir and file_mounts
In our workload definition, we can define the following:
.konduktorignore
Use a .konduktorignore file to exclude files and directories from being synchronized.
It works similarly to .gitignore, and is evaluated relative to the sync root.
Patterns in .konduktorignore are matched relative to the location.
Examples
Workdir
Place .konduktorignore at ./my_dir/.konduktorignore.
File mounts
Place .konduktorignore at ./my_dir/.konduktorignore.
Example .konduktorignore in ./my_dir/:
Cloning private GitHub Repositories
Cloning private repositories is supported via both file sync of ssh keys to your object store or through secrets. This section demonstrates how to file sync an ssh key from our workstation onto the workload and configure SSH for pulling from a private repository.