# Cml / GitHub Actions / aws

**URL:** <https://discuss.dvc.org/t/cml-github-actions-aws/816>\
**Category:** Questions\
**Created:** [July 5, 2021, 9:20pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816 "2021-07-05T21:20:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.dvc.org/u/mcosta)\
**Post date:** [July 5, 2021, 9:20pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/1 "2021-07-05T21:20:13Z")

</div>

Guys,

I’m trying to run cml-runner in aws via GitHub actions.  
The script below opens an instance that we can see in the aws console.  
The result can be summarized as:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/dataversioncontrol/original/1X/5fa009dc647acb5c0be050d942fbe26c5dbb67d8.png)

Since we don’t have any information about what’s going on, guessing isn’t so easy. Again, a suggestion for resolving it is appreciated.

Note : This is related to [Question 812](https://discuss.dvc.org/t/cml-dvc-github-actions-hyper-parameter-tuning/812)

```auto

name: Test
on: [push]
jobs:
  deploy:
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-cml@v1
      - run: |
          cml-runner \
          --cloud=aws \
          --cloud-region=eu-west-3 \
          --cloud-type=t2.micro \
          --labels=cml-runner
        env:
          REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  train:
    needs: deploy
    runs-on: [self-hosted, cml-runner]
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-dvc@v1
      - uses: iterative/setup-cml@v1
      - run: |

          echo "Hello!"
        
          
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

```

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.dvc.org/u/mcosta)\
**Post date:** [July 5, 2021, 9:42pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/2 "2021-07-05T21:42:56Z")

</div>

Should be

`runs-on: [self-hosted, cml-runner]`

(updated in the OP)

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.dvc.org/u/mcosta)\
**Post date:** [July 7, 2021, 11:04pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/3 "2021-07-07T23:04:17Z")

</div>

I just tried to create a local g3.4xlarge ec2 instance and it looks like aws is rejecting it. From my understanding of what we have on the aws console, this would be allowed. If we check the quota details, we have:

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/dataversioncontrol/original/1X/c463138363cd53cec77ce410d12bee897abf06de.png)

If we run this.

```auto
on: [push]
jobs:
  deploy:
    runs-on: [ubuntu-latest]
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-cml@v1
      - run: |
          cml-runner \
          --cloud=aws \
          --cloud-region=eu-west-1 \
          --cloud-type=g3.4xlarge \
          --cloud-hdd-size 64 \
          --cloud-spot
          --labels=cml-runner
        env:
          REPO_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  train:
    needs: deploy
    runs-on: [self-hosted, cml-runner]
    container: 
      image: docker://dvcorg/cml
      options: --gpus all
    steps:
      - uses: actions/checkout@v2
      - uses: iterative/setup-dvc@v1
      - uses: iterative/setup-cml@v1
      - uses: actions/setup-python@v2
        with:
          python-version: '3.8'
      - run: |
          apt-get update -y
        
          pip install -r requirements.txt

```

We have the following error:

```auto
Error: Failed creating the machine: Not able to decode: MaxSpotInstanceCountExceeded: Max spot instance count exceeded
│ status code: 400, request id: eeb4b582-1d03-463e-b3c9-409e279cc9ef
│ 
│ with iterative_cml_runner.runner,
│ on main.tf line 14, in resource "iterative_cml_runner" "runner":
│ 14: resource "iterative_cml_runner" "runner" {

```

Is this an aws configuration issue or something with cml-runner?

Cheers

---

<div class="post-metadata">

**Author:** ![0x2b3bfa0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/0x2b3bfa0/32/119_2.png) [@0x2b3bfa0](https://discuss.dvc.org/u/0x2b3bfa0)\
**Post date:** [July 8, 2021, 11:01am UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/4 "2021-07-08T11:01:08Z")

</div>

It looks like this as an AWS issue. Are you able to manually create an instance from the cloud console?

---

<div class="post-metadata">

**Author:** ![mcosta](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@mcosta](https://discuss.dvc.org/u/mcosta)\
**Post date:** [July 8, 2021, 10:41pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/5 "2021-07-08T22:41:42Z")

</div>

Hi @0x2b3bfa0

Sorry for the delay, but I’m only able to allocate time for this task at (my) night.  
Quota was set to 4 vCPUs and g3.4xlarge requires 16. Changed it to g3s.xlarge and it worked.

As always, thank you for your support!

---

<div class="post-metadata">

**Author:** ![0x2b3bfa0](https://yyz1.discourse-cdn.com/flex035/user_avatar/discuss.dvc.org/0x2b3bfa0/32/119_2.png) [@0x2b3bfa0](https://discuss.dvc.org/u/0x2b3bfa0)\
**Post date:** [July 9, 2021, 12:24pm UTC](https://discuss.dvc.org/t/cml-github-actions-aws/816/6 "2021-07-09T12:24:56Z")

</div>

You’re welcome, @mcosta!
