Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove AWS SDKv2 #30

Merged
merged 4 commits into from
Nov 13, 2024
Merged

Remove AWS SDKv2 #30

merged 4 commits into from
Nov 13, 2024

Conversation

Ic3w0lf
Copy link
Member

@Ic3w0lf Ic3w0lf commented Aug 8, 2024

What it solves

  • Replace any SDKv2 references and replace SmokeTail with SDKv3 native code
  • Start the LogTail before the Container is in running state, so no more logs should be missing

Readiness Checklist

Author/Contributor

  • If documentation is needed for this change, has that been included in this pull request
  • Pull request title is brief and descriptive (for a changelog entry)

Reviewing Maintainer

  • Label as breaking if this is a large fundamental change
  • Label as either automation, bug, documentation, or enhancement
  • Label as bump:patch, bump:minor, or bump:major if this PR should create a new release

@MrNoyceCosta
Copy link

@Ic3w0lf When will his be merged? I'm getting some odd timeout errors when running the 4.1.0 version and would like to check if this PR fixes the issue.

FYI Error: Task did not stop successfully. Error: TimeoutError. State: undefined.

@Ic3w0lf
Copy link
Member Author

Ic3w0lf commented Aug 19, 2024

Hey @MrNoyceCosta

I still need to fix some issues regarding the action not outputting all logs. However, the error you get sounds like maybe your task runs longer than 5 minutes or takes more time to start up. Did you try increasing the task-stopped-max-wait-time from 300 to something higher? Alternatively, maybe try increasing the task-start-max-wait-time which controls how long the action will wait for the task to get to the RUNNING state.

Also, I think you can define branch names when you use this action. E.g. like geekcell/github-action-aws-ecs-run-task@sdkv3-rep or commit hashes.

Best regards

@MrNoyceCosta
Copy link

@Ic3w0lf Thanks for your reply. The task could be running for quite some time. What is the max value that can be set for task-stopped-max-wait-time?

@Ic3w0lf
Copy link
Member Author

Ic3w0lf commented Aug 19, 2024

@Ic3w0lf Thanks for your reply. The task could be running for quite some time. What is the max value that can be set for task-stopped-max-wait-time?

@MrNoyceCosta I don't there is a hard limit here (at least I couldn't find any in the documentation). However, please be careful to not have your GitHub Actions cost explode if you set the limit too high. You can also set the task-wait-until-stopped parameter to false to avoid having the GitHub Action wait for the task to finish. The Action will then simply start the action and return, not providing any log output or status.

@gregnetau
Copy link

gregnetau commented Oct 23, 2024

So i am running into a similar issue here after following your example code @Ic3w0lf.

The GH action job fires, spins up my container and runs laravel's db:migrate no worries, with a log of
INFO Nothing to migrate.

The container then exits, with the status

Task stopped at: 2024-10-23T03:38:13.868Z Essential container in task exited

The GH action responds with

Error: Task did not start successfully. Error: TimeoutError. State: undefined.

my GH action is pretty much as per the example"

        uses: geekcell/github-action-aws-ecs-run-task@sdkv3-rep  
        with:  
          task-definition: LaravelTaskDefinition  
          cluster: ecs-cluster-staging 
          assign-public-ip: 'DISABLED' 
          subnet-ids: subnet-xxx 
          security-group-ids: sg-xxx  
          tail-logs: true  
          override-container: laravel-staging  
          override-container-command: |  
            /bin/sh  
            -c  
            php artisan migrate --force  
          task-wait-until-stopped: false```

@Ic3w0lf
Copy link
Member Author

Ic3w0lf commented Nov 5, 2024

@gregnetau Hmm... this is weird! If you set task-wait-until-stopped to false, the action should exit immediatly after send the ECS command to AWS. The action should not print any log outputs of the container. Have you tried using the v4.1.0 release?

There was an issue in earlier versions using the SDKv3 that looked like yours, when the container that was started only ran for a short time. I explained that here in more detail: #29

Also, I assume its a copy-paste error, but make sure to not have the 3 backticks at the end of the task-wait-until-stopped parameter.

@Ic3w0lf Ic3w0lf added the bump:major Attach to PR to automatically bump major version on merge label Nov 13, 2024
Copy link

🏷️ [bumpr] Next version:v5.0.0 Changes:v4.1.0...geekcell:sdkv3-rep

@Ic3w0lf Ic3w0lf merged commit 48e34f6 into main Nov 13, 2024
5 checks passed
@Ic3w0lf Ic3w0lf deleted the sdkv3-rep branch November 13, 2024 19:50
Copy link

🚀 [bumpr] Bumped! New version:v5.0.0 Changes:v4.1.0...v5.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump:major Attach to PR to automatically bump major version on merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants