NextChapterSoftware / ec2-action-builder

This is a custom GitHub action to provision and manage self-hosted runners using AWS EC2 On-Demand and/or Spot instances.
Apache License 2.0
11 stars 7 forks source link

OnlySpot waiting status promise #15

Closed gnomefin closed 5 months ago

gnomefin commented 5 months ago

Overview

I was trying to privision a spot instance it works, however, it is always saying "Waiting..." in github action.

image image

Is there any caveat I have missed?

      - name: Start EC2 runner
        id: start-ec2-runner
        uses: NextChapterSoftware/ec2-action-builder@v1
        with:
          github_token: ${{ steps.get-key-3.outputs.GITHUB_TOKEN }}
          aws_access_key_id: ${{ steps.get-key-3.outputs.AWS_ACCESS_KEY_ID }}
          aws_secret_access_key: ${{ steps.get-key-3.outputs.AWS_SECRET_ACCESS_KEY }}
          aws_region: "ap-southeast-1"
          ec2_instance_type: t3.large
          ec2_ami_id: ami-0be48b687295f8bd6
          ec2_subnet_id: "subnet-0658e74202c95b2a1"
          ec2_security_group_id: "sg-0ecd33647e49f0518"
          ec2_instance_ttl: 40                # Optional (default is 60 minutes)
          ec2_spot_instance_strategy: SpotOnly    # Other options are: SpotOnly, BestEffort, MaxPerformance 

Expectation

It will proceed to the next job.

mahdi-torabi commented 5 months ago

Since the instance is being created, that eliminates the provisioning strategy as a source of problem. Basically it doesn't matter whether it's a spot instance or a on-demand.

Does your instance have internet access ? The Github runner agent on the EC2 machine needs to reach out to GH API to register itself.

Being stuck in Waiting... means the code is in a loop constantly querying GH API and waiting for the runner to show up but it never shows up until TTL expires.

gnomefin commented 5 months ago

Does your instance have internet access

Superb. After checking my public subnet, it turns out I didn't turn on the auto-assign public ipv4 at startup. and now it works perfectly. I will close this thread as it is fixed already on my side.