I've deployed a Micronaut application on AWS ECS Fargate container. Inside my application I have a couple of scheduled jobs that I have configured to run once a day. After deploying the application, the scheduled task does kick off. I've added logging to see if the job run, but there was nothing in the log. Is this a limitation within Fargate that prevents the tasks from running?
Running Micronaut Scheduled Task on Fargate
168 Views Asked by user3088309 At
2
There are 2 best solutions below
0
Le0pold
On
Fargate itself doesn't have any limitations. My guess is that your task became stopped and this why it isn't running. But according to your description you misuse Fargate containers.
You don't need to schedule jobs inside the container, use AWS EventBridge scheduled rule that will run your Fargate task. Refer to documentations for details: https://docs.aws.amazon.com/AmazonECS/latest/userguide/scheduled_tasks.html
Additional improvement of this approach could be using Step Functions to additionally orchestrate Fargate task, in this case you will be calling Step Function that contains Fargate task call. This approach can be useful if you want to have additional parameters setup, easier manual run etc.
Related Questions in AMAZON-ECS
- Canary deployment using spinnaker in AWS ECS
- AWS CloudFormation stuck at CreateTags
- AWS ECS agent does not start in EC2 instance
- Migrate AWS ECS cluster IPV4 to IPV6
- Mysql error on AWS ECS: [InnoDB] Unable to lock ./ibdata1 error
- Log retation setting for ECS
- No GPU EC2 instances associated with AWS Batch
- How to configure CPU utilized metric for ECS in AWS for Alarm?
- Connection services in different containers in the same ec2 instance
- How to get ECS task to communicate with cloudwatch agent?
- CodePipeline Deploy Stage missing AWSLambda/ automatically update running ecs tasks
- bot3 ecs.execute_command: Task Identifier is invalid
- Step scaling option disabled for ECS Fargate service
- APCu cache in docker container
- Loki on ecs crashes when cleaning up chunks
Related Questions in AWS-FARGATE
- Mysql error on AWS ECS: [InnoDB] Unable to lock ./ibdata1 error
- CodePipeline Deploy Stage missing AWSLambda/ automatically update running ecs tasks
- Step scaling option disabled for ECS Fargate service
- Connecting Django container to MySQL container in a single AWS ECS Fargate task definition
- CDK: Remove dependency from DependsOn
- ECS: Unable to launch nodejs application
- Prevent Amazon ECS replaced 1 tasks due to an unhealthy status
- CannotPullContainerError: ref pull has been retried 1 time(s): failed to copy: httpReadSeeker: failed open with 403 error
- Why can't ECS Fargate container find task execution role credentials?
- Aws Fargate Healthcheck checking response
- Same IP, same port and nmap scan gives different result. Why?
- Timeout Issue Creating AWS ECS Fargate Service with Pulumi
- Facing Network Error for some second in ecs fargate deployment
- AWS ECS Fargate Container Stops Running Without Errors
- "Access Denied" When ECS Fargate Task Tries to Upload to S3 via Presigned URL
Related Questions in MICRONAUT
- How does micronaut-kafka handle the error when the connection to the broker is lost?
- Micronaut - Add Controller from external library
- Not able to inject RedisCache/SyncCache/StatefulRedisConnection beans in micronaut 4.2.1 version
- Micronaut filter request.getBody() empty
- Micronaut Cache
- Micronaut-data error after upgrade 3.9 -> 4.3: "No inverse property found for reference of type ... and reference: defaultReference"
- Micronaut @ConfigurationProperties not loading in a List of pojos correctly
- Using micronaut-openapi @ApiResponse @ExampleObject value with JSON string, attribute with null values are ommitted on openapi.yml
- Cannot add a configuration with name 'developmentOnly' as a configuration with that name already exists for Micronaut
- Java Azure Function Dependency Injection
- Proxy settings in Micronaut using HttpClient (Java)
- Micronaut HttpClient testing with Mockito (Java)
- Micronaut Httpclient wont accept string for Multipart request to upload file
- Configuration requires entries under the prefix: datasources.default
- How to use strings that contain special characters as keys in YAML with Micronaut
Related Questions in MICRONAUT-AWS
- Create generic MicronautRequestHandler to handle any AWS Event and APIGatewayProxy request
- @PropertySource for different yaml files in Micronaut
- Micronaut AWS Lambda and MSK Event Trigger
- Unable to initialise ObjectMapper in micronaut library subproject
- Micronaut Framework - Connect to AWS secret manager is failed when calling from AWS lambda
- Adding micronaut serde fails starting application as serverless with lanch class as io.micronaut.function.aws.runtime.MicronautLambdaRuntime
- Can you set S3 path in Micronaut Key Store Path?
- How to consume messages from AWS Standard SQS using JMSListener sequentially?
- Unable to fetch the custom properties from AWS secret manager for micronaut application invoked by AWS lambda function
- Running Micronaut Scheduled Task on Fargate
- Micronaut with AWS Lambda and SQS
- Micronaut application AWS Lambda - Http Requests and Responses filter
- AWS lambda connecting to multiple database instances
- Micronaut returns the empty body
- HttpClientResponseException: Error decoding HTTP response body: Error decoding stream for type S3EventNotification
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There is nothing about Fargate that would prevent a scheduler inside a container from running. If your Fargate container is running 24/7 then something like a cron job that is scheduled to run inside that container should run just fine. It should be no different than if you ran the same container locally on your laptop and left it running all day to see if your schedules tasks kicked off.