tests: GCP
Due to https://github.com/iterative/terraform-provider-iterative/pull/156, GCP should be supported.
- [x] Fix bugs (#678?)
- [ ] #921
- [x] Update README (#717)
- [x] Update https://cml.dev/doc (https://github.com/iterative/cml.dev/pull/105)
start of "docs": https://github.com/iterative/terraform-provider-iterative/pull/156 and https://github.com/iterative/terraform-provider-iterative/pull/166
Stub, from Notion
Prerequisites
- Create a new Google Cloud project (official documentation)
- Create a new service account for the newly created project (official documentation)
- Create a new service account key for the newly created service account (official documentation)
- Store the contents of the downloaded JSON key as a GitHub repository secret named
GOOGLE_APPLICATION_CREDENTIALS_DATAMy failed blog post has some extra guidance for GitHub and GitLab and best practices for secret handling in CI/CD environments:
GitHub
Add these two masked variables to your project:
REPO_TOKENwith a Personal Access Token includingapipermissions- ···
🔒 You can also store these values as external secrets instead of variables if your server is configured to support this feature
GitLab
- Add these two secrets to your repository:
REPO_TOKENwith a Personal Access Token with enough permissions for registering the self-hosted runner and publishing a comment with the results- ···
Usage
on: workflow_dispatch jobs: deploy: runs-on: ubuntu-latest steps: - uses: iterative/cml@v1 - run: >- cml-runner --cloud=gcp --cloud-region=us-west1-b --cloud-type=custom-8-65536-ext --cloud-gpu=v100 env: REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} GOOGLE_APPLICATION_CREDENTIALS_DATA: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS_DATA }} deploy: runs-on: self-hosted steps: - run: nvidia-smiThe
--regionoption specifies what Google Cloud calls zones, not regions like in other cloud vendors.You can check this list to determine which zones provide GPU accelerators and which models are available. Not every zone has availability for every GPU model.
Custom machine types can be specified with
custom-{cores}-{memory}where{cores}represents the number of CPU cores and{memory}represents the RAM memory in megabytes; appending the-extsuffix will also enable extended memory.GPU accelerators are only available on N1 and A2 machines. Trying to request accelerators in any other machine will produce an error.
Authentication
You can set either the
GOOGLE_APPLICATION_CREDENTIALS_DATAenvironment variable to the contents of a service account JSON file, or theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path of the mentioned file.The former is more convenient for CI/CD scenarios, where secrets are (usually) provisioned through environment variables instead of files.
/tests
❓
https://github.com/iterative/cml/issues/680#issuecomment-900616914 contains some valuable bits and pieces we don't have anywhere else. 🤔 Should they be promoted to cml.dev/doc?