-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added notes on using CML with local runner
- Loading branch information
1 parent
0b9e45f
commit bd185c2
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# CML | ||
|
||
## Self-hosted runner | ||
To setup a self-hosted runner to perform github actions with CML on a local machine with a GPU access. You will need to make sure that `docker` and `node` are installed, then run: | ||
```shell | ||
$ sudo npm install --location=global @dvcorg/cml | ||
``` | ||
### Starting the runner | ||
To start the runner you will need to create gh access token with `repo` and `workflow` permissions. Then run: | ||
```shell | ||
$ cml runner launch \ | ||
--repo=$REPO_URL \ | ||
--token=$ACCESS_TOKEN \ | ||
--labels="cml,gpu" \ | ||
--idle-timeout=3000 | ||
``` | ||
replacing `REPO_URL` with your github repository url and `ACCESS_TOKEN` with you gh access token. | ||
|
||
The runner should provide a confirmation message when it is started, but you can check that it is available to your repository by going to github `<REPOSITORY> > Settings > Actions > Runners` and you should see the runner listed. | ||
|
||
### GH Action | ||
With the runner available you should now be able to create a workflow to utilise it. Below is an example of a basic action to use the local runner and print the available GPU spec and details: | ||
```yaml | ||
name: test_gpu | ||
on: [push] | ||
jobs: | ||
run: | ||
runs-on: [self-hosted,cml,gpu] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: iterative/setup-cml@v1 | ||
- name: Chek GPU spec | ||
env: | ||
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
nvidia-smi | ||
``` | ||
Save this into `.github/workflows/test_gpu.yaml` and open a pull request. The action should execute and the output should provide you details about the available GPU. |