Comments (19)
I believe a minimal first step would be to make the the launchType optional (in com.cloudbees.jenkins.plugins.amazonecs.ECSService.runEcsTask
). According to the latest AWS docs if you omit the launch type and the capacity provider when submitting a task the default capacity provider is chosen. So you can configure everything in ECS and simply "disable" the launch type in Jenkins. This should be a trivial change. If this is of interest I can even work on a PR for this.
from amazon-ecs-plugin.
if some want to test/need to launching tasks via the default capacity provider I did a quick hack at: https://github.com/owengo/amazon-ecs-plugin
in "launchType" if you choose "Default Capacity Provider" instead of "EC2" or "Fargate" the "runTask" call will not pass a launchType and so the default capacityProvider for your cluster will be used.
"works for me".
from amazon-ecs-plugin.
I did some tests over the weekend but the current API for capacity provider sucks. You can only create capacity providers but neither modify nor delete them. Makes working with them quite hard.
Anyway, once you set the launchType to null in a run task request and have a capacity provider strategy configured it works as expected. I will work in a PR with tests in the next few days. Not sure if I get it done before Christmas, though.
from amazon-ecs-plugin.
Bump. This code works and if it could be merged into the main, I would avoid having to compiled and run a forked version.
from amazon-ecs-plugin.
@FnTm I can confirm its working, i had been using a manual build created from the PR that @chathsuom submited for a while in a production setup 👍
I already switched my setup to the newly made release and it is also working fine
from amazon-ecs-plugin.
@sithmein that would definitely be a welcome first step. It would be nice to have a more comprehensive support at some point, but I'll definitely take this over nothing 🙂
from amazon-ecs-plugin.
feel free to submit a PR for that
indeed the capacity providers are interesting to scale your Jenkins clusters in an easier way
from amazon-ecs-plugin.
if some want to test/need to launching tasks via the default capacity provider I did a quick hack at: https://github.com/owengo/amazon-ecs-plugin
in "launchType" if you choose "Default Capacity Provider" instead of "EC2" or "Fargate" the "runTask" call will not pass a launchType and so the default capacityProvider for your cluster will be used.
"works for me".
thank you, I will test this out as I've been manually sending tasks to test scaling.
from amazon-ecs-plugin.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from amazon-ecs-plugin.
if some want to test/need to launching tasks via the default capacity provider I did a quick hack at: https://github.com/owengo/amazon-ecs-plugin
in "launchType" if you choose "Default Capacity Provider" instead of "EC2" or "Fargate" the "runTask" call will not pass a launchType and so the default capacityProvider for your cluster will be used.
"works for me".
FYI, we regularly encounter a problem when launching jenkins via ecs-plugin using the "default capacity provider". As explained here: https://forums.aws.amazon.com/thread.jspa?messageID=939879#939879 ,
the containerOverrides passed to the runTask api call ( the "command" is overriden so that the agent knows its name, its secret and where the master is, ) is mysterious lost when the cluster has no provisionned instance. So what happens is that the container is launched but the node can't connect to the master. And the master/plugin does not detect the issue so we have to wait the timeout before a new agent is launched. Usually the second time it works because a provisionned instance is available in the cluster.
from amazon-ecs-plugin.
if some want to test/need to launching tasks via the default capacity provider I did a quick hack at: https://github.com/owengo/amazon-ecs-plugin
in "launchType" if you choose "Default Capacity Provider" instead of "EC2" or "Fargate" the "runTask" call will not pass a launchType and so the default capacityProvider for your cluster will be used.
"works for me".
Can this be incorporated to the main repo? it works.
from amazon-ecs-plugin.
I've been using @owengo 's fix for a while and it works perfectly, please include it in the main repo :)
from amazon-ecs-plugin.
I can confirm that lack of capacity provider support also breaks cluster auto scaling. I provide results of my testing with the latest official plugin release on #185.
from amazon-ecs-plugin.
Did some work to support FARGATE_SPOT also #211
from amazon-ecs-plugin.
Bump on this. This fails to work with the new ECS Capacity Provider as well.
from amazon-ecs-plugin.
For info:
aws/containers-roadmap#749
Aws just fixed the bug "[ECS] [Bug] containerOverrides not working with capacity provider"
This greatly helps Jenkins with ECS @ Capacity Providers
from amazon-ecs-plugin.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
from amazon-ecs-plugin.
Hi has the update done to main repo for choosing launch type as default capacity provider or leave it? If so which version of ecs plugin has these changes? Appreciate your help!
from amazon-ecs-plugin.
The functionality seems to have been introduced by @chathsuom in #211 and released a couple of days ago in 1.39 by @carlosrodf (thanks to both of you!)
Could someone using the plugin with Capacity providers verify if it's working correctly for them? If yes, then I'd like to close this Issue, and any additional enhancements could be discussed in a separate issu.
from amazon-ecs-plugin.
Related Issues (20)
- Very often get two Fargate tasks when only one agent is needed HOT 3
- Terminate node if the ECS task has stopped to fast fail execution HOT 2
- Specify agent tool location
- Enhancement: Retry launch failure due to network interface provision issues HOT 1
- Plugin Does Not Respect Non-proxy Hosts Configuration
- InvalidParameterException: Override argument cannot be null, Creating Task in cluster null HOT 2
- After jenkins version upgrade launch type is missing HOT 1
- Region is not available HOT 1
- ECS tasks are getting stopped by the error Stopped by Jenkins Amazon ECS PlugIn and exit code- 143 HOT 1
- Amazon Elastic Container Service (ECS) / Fargate plugin Version1.48 is not working HOT 2
- API - Manage Cloud Nodes
- The number of executors is not set on ECS Agent
- Add support for Sidecars in ECS Template
- Two tasks started when we have the condition in the pipeline HOT 1
- jenkinsURL how to change it
- CannotCreateVolumeError: unsupported Dockerfile contains VOLUME instruction HOT 1
- Add automatic restart of pipeline if agent is terminated (useful for spot instances)
- Add possibility to override ephemeralStorageSizeInGiB from declarative
- ECS Agents Re-used unexpectedly HOT 4
- URGENT: ECS Fargate Slaves channel closed exception randomly during pipeline execution HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amazon-ecs-plugin.