question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Testing cml-cloud-run

See original GitHub issue

I’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: Screen Shot 2020-06-10 at 3 25 18 PM Screen Shot 2020-06-10 at 3 25 26 PM

Project repo is here: https://github.com/andronovhopf/test_cloud

Any ideas?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
elleobriencommented, Jun 12, 2020

@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 the docker run function. Think I got it 👍

Edit: yep this works now I’m running Python training jobs.

1reaction
dmpetrovcommented, Jun 11, 2020

@andronovhopf there is another docker with python - cml-py3-cloud-runner

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found