Skip to content

Unable to correctly add a tag #5

@ethanholz

Description

@ethanholz

Currently tags are not being added correctly and fail on creation. See here for example: https://github.com/omsf-eco-infra/openmm-gpu-test/actions/runs/18509766908/job/52747599848#step:4:49.

Stack trace copied for completeness:

Starting up...
Creating GitHub Actions Runner
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/app/src/start_aws_gha_runner/__main__.py", line 68, in <module>
    main()
  File "/app/src/start_aws_gha_runner/__main__.py", line 64, in main
    deployment.start_runner_instances()
  File "/usr/local/lib/python3.12/site-packages/gha_runner/clouddeployment.py", line 166, in start_runner_instances
    mappings = self.provider.create_instances()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/start_aws_gha_runner/start.py", line 212, in create_instances
    result = ec2.run_instances(**params)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/botocore/client.py", line 602, in _api_call
    return self._make_api_call(operation_name, kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/botocore/client.py", line 1035, in _make_api_call
    request_dict = self._convert_to_request_dict(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/botocore/client.py", line 1102, in _convert_to_request_dict
    request_dict = self._serializer.serialize_to_request(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/botocore/validate.py", line 381, in serialize_to_request
    raise ParamValidationError(report=report.generate_report())
botocore.exceptions.ParamValidationError: Parameter validation failed:
Invalid type for parameter TagSpecifications[0].Tags[0], value: gha-runner, type: <class 'str'>, valid types: <class 'dict'>

Configuration used:

name: Inference test
on:
  workflow_dispatch:

jobs:
  start-aws-runner:
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      contents: read
    outputs:
      mapping: ${{ steps.aws-start.outputs.mapping }}
      instances: ${{ steps.aws-start.outputs.instances }}
    steps:
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume: ${{ secrets.AWS_ROLE }}
          aws-region: us-east-1 
      - name: Create cloud runner
        id: aws-start
        uses: omsf/start-aws-gha-runner@main
        with:
          aws_image_id: ami-0f7c4a792e3fb63c8 
          aws_root_device_size: 125
          aws_instance_type: g4dn.xlarge
          aws_home_dir: /home/ubuntu
          aws_tags: '["gha-runner"]'
        env:
          GH_PAT: ${{ secrets.GH_PAT }}
  inference-test:
    runs-on: ${{ fromJSON(needs.start-aws-runner.outputs.instances) }}
    defaults:
      run:
        shell: bash -leo pipefail {0}
    needs:
      - start-aws-runner
    steps:
      - name: Checkout scripts
        uses: actions/checkout@v4
        with:
          sparse-checkout: |
            inference-test
          repository: omsf-eco-infra/ci-scripts
          path: ci-scripts
      - name: Print disk usage
        run: "df -h"
      - name: Print Docker details
        run: "docker version || true"
      - name: Check for nvidia-smi
        run: "nvidia-smi || true"
      - uses: mamba-org/setup-micromamba@main
        with:
          environment-file: ci-scripts/inference-test/environment.yml
      - name: Test for pytorch
        run: python -c "import torch; assert torch.cuda.is_available()"
      - name: Test for GPU
        id: gpu_test
        run: python ci-scripts/inference-test/inference.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions