Testing cml-cloud-run
See original GitHub issueI’m working with the following .yaml
:
name: train-my-model
on: [push]
jobs:
deploy-cloud-runner:
runs-on: [ubuntu-latest]
container: docker://dvcorg/cml-cloud-runner
steps:
- name: deploy
env:
repo_token: ${{ secrets.REPO_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
echo "Deploying..."
MACHINE="CML-$(openssl rand -hex 12)"
docker-machine create \
--driver amazonec2 \
--amazonec2-instance-type t2.micro \
--amazonec2-region us-east-2 \
--amazonec2-zone a \
--amazonec2-vpc-id vpc-76f1f01e \
--amazonec2-ssh-user ubuntu \
$MACHINE
eval "$(docker-machine env --shell sh $MACHINE)"
(
docker-machine ssh $MACHINE "sudo mkdir -p /docker_machine && sudo chmod 777 /docker_machine" && \
docker-machine scp -r -q ~/.docker/machine/ $MACHINE:/docker_machine && \
docker run --name runner -d \
-v /docker_machine/machine:/root/.docker/machine \
-e RUNNER_IDLE_TIMEOUT=120 \
-e DOCKER_MACHINE=${MACHINE} \
-e RUNNER_LABELS=cml \
-e repo_token=$repo_token \
-e RUNNER_REPO=https://github.com/iterative/cml_base_case \
dvcorg/cml-cloud-runner && \
sleep 20 && echo "Deployed $MACHINE"
) || (echo y | docker-machine rm $MACHINE && exit 1)
train:
needs: deploy-cloud-runner
runs-on: [self-hosted,cml]
steps:
- uses: actions/checkout@v2
- name: cml_run
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
run: |
pip install -r requirements.txt
python train.py
cat metrics.txt >> report.md
cml-publish confusion_matrix.png --md >> report.md
cml-send-comment report.md
Note that the job train
depends on deploy-cloud-runner
, not deploy
as in #108 (deploy
threw an error). The first job, deploy-cloud-runner
is running fine, but train
is throwing an inscrutable error:
Project repo is here: https://github.com/andronovhopf/test_cloud
Any ideas?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Testing a Cloud Run service locally
You can use Cloud Code or Docker installed locally to run and test locally, including running locally with access to Google Cloud services....
Read more >Cloud tests from the CLI - Grafana k6
Run tests, How to use the k6 CLI to run tests on k6 Cloud servers, or how to stream the results of local...
Read more >How to Setup And Run Cypress Test Cases in Google Cloud?
Steps to Set up the Code In Google Cloud. *Step 1: In the Dashboard from the left side click on 'Cloud Build” under...
Read more >Tutorial: Deploying Cloud Run Jobs | by Austen Novis
Cloud Run jobs are a new way to execute code in containers on the Google Cloud ... The first job test , consists...
Read more >GoogleCloudPlatform/cloud-run-samples - GitHub
Sample Description Languages
Hello World Hello World! A quickstart sample collection Go, Node.js, Python, Java, PH...
Manual Logging Structured logging without client library Go, Node.js,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DavidGOrtega got it, trying that now. So it isn’t important to specify
container: docker://dvcorg/cml-py3-cloud-runner
in line 8 of my.yaml
, because we don’t need python for the job of launching the runner. Only in thedocker run
function. Think I got it 👍Edit: yep this works now I’m running Python training jobs.
@andronovhopf there is another docker with python -
cml-py3-cloud-runner