Comments (17)
@gomesp I use this plugin everyday via jcasc. Happy to help out on any specific issues you are having. Here is one of the slave configs i use. Haven't tried the lastest, but def works fine with configuration-as-code:1.19
and has for months.
clouds:
- ecs: # 4cpu-8gb
cluster: "arn:aws:ecs:${AWS_REGION}:${AWS_ACCOUNT_ID}:cluster/xxxxxx-${AWS_JENKINS_ENVIRONMENT}-jenkins-ecs-cluster"
credentialsId: "xxxxxxx_jenkins_xxxxx_credentials"
jenkinsUrl: ${JENKINS_HOST_URL}
name: amz2-4cpu-8gb
regionName: ${AWS_REGION}
retentionTimeout: 60
tunnel: "${JENKINS_TUNNEL_URL}:${JENKINS_SLAVE_PORT}"
templates:
- assignPublicIp: false
cpu: 4096
image: xxxxx/xxxxxxxxxxx
label: amz2-4cpu-8gb
launchType: EC2
memory: 8192
memoryReservation: 4096
networkMode: default
privileged: false
remoteFSRoot: /home/jenkins
templateName: amz2-4cpu-8gb
from amazon-ecs-plugin.
I am still debugging
from amazon-ecs-plugin.
Also quite some of the delay comes from Jenkins weird internal mechanism on when to request agents.
This can be changed / optimized with some system params, eg -Dhudson.slaves.NodeProvisioner.initialDelay=0 -Dhudson.slaves.NodeProvisioner.MARGIN=50 -Dhudson.slaves.NodeProvisioner.MARGIN0=0.85
from amazon-ecs-plugin.
Did you find a way to achieve this @gomesp ?
Not yet. But it seems that @markyjackson-taulia is picking it up, so this is great news.
Currently I use the EC2 plugin to spin up agents dynamically (which supports CasC), but I'm looking forward to move to ECS with this plugin in the future.
from amazon-ecs-plugin.
Afaik this is not supported and i don't know if it even could be. This would be something I'm sure a eks kind of thing might be able to solve. We just bite the cold start times to be honest. It only adds about an extra 15-30 secs for us per build. 30secs isn't an issue for us on 5-10min builds. I haven't tested Fargate.. We use EC2.
Some ideas (shave time elsewhere):
- Implement a shared cache for things like a maven cache. Otherwise images have to re-download.
- Reduce your docker image size. alpine etc.
- ECS_IMAGE_PULL_BEHAVIOR aws-ecs-image-caching. I just found this.. might play with it and report back.
- Might be able to "warm" the tasks. Like a job that builds a few temp projects every min so that the slave for that image is quicker to spin up (no clue if this is even a thing..just an idea that you could test and probably overcomplicates things).
How long are your builds?
Thanks @pbsladek for the reply. The whole build time takes around 15mins (including tests and deployments). Thanks for the ideas, I'll add this in our documentation. I have brought it up with our team and our current implementation of having the Jenkins agents on EC2 instances using the EC2 plugin is working as expected and no issues have been reported so we might stick with it for now. Again, thanks a lot for the support!
from amazon-ecs-plugin.
Did you find a way to achieve this @gomesp ?
from amazon-ecs-plugin.
Good news is there anywhere we can track progress @markyjackson-taulia ?
I was planning to use Fargate, so I'd like to start directly using this plugin :/
from amazon-ecs-plugin.
Awesome @pbsladek, I'll give your example a try!
from amazon-ecs-plugin.
@gomesp Any luck?
from amazon-ecs-plugin.
Oh, my apologies @pbsladek. I've delegated this to @keyotik. Tagging him here for his feedback.
from amazon-ecs-plugin.
Hi @pbsladek , sorry for the delayed reply. Before moving to the casc, I wanted to try if I can stand up the Jenkins agents on ECS. But I do have a question first, is it possible to provision the agents on ECS (EC2 or Fargate) as a "stand-by" pool? Meaning we want the agents to be up and running for the whole day and ready to accept jobs instead of provisioning them on the fly everytime?
Our use case for this is that our development team want's to improve the build/deploy time and if provisioning of the agents is added to it everytime, this will definitely impact them reaching their build pipeline time goal.
from amazon-ecs-plugin.
Afaik this is not supported and i don't know if it even could be. This would be something I'm sure a eks kind of thing might be able to solve. We just bite the cold start times to be honest. It only adds about an extra 15-30 secs for us per build. 30secs isn't an issue for us on 5-10min builds. I haven't tested Fargate.. We use EC2.
Some ideas (shave time elsewhere):
- Implement a shared cache for things like a maven cache. Otherwise images have to re-download.
- Reduce your docker image size. alpine etc.
- ECS_IMAGE_PULL_BEHAVIOR aws-ecs-image-caching. I just found this.. might play with it and report back.
- Might be able to "warm" the tasks. Like a job that builds a few temp projects every min so that the slave for that image is quicker to spin up (no clue if this is even a thing..just an idea that you could test and probably overcomplicates things).
How long are your builds?
from amazon-ecs-plugin.
@webratz thx! Will def give those a go and report back 😄
from amazon-ecs-plugin.
@webratz Very noticeable improvement. Maybe 5 secs max now. Thx again.
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.
is it possible to use EC2 instance profile instead of credentialsId
in the cloud config ?
from amazon-ecs-plugin.
@hybmg57 the value should be nullable. Not providing credentials at all invokes the standard AWS preference chain for authentication.
from amazon-ecs-plugin.
Related Issues (20)
- 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
- Add CLI args for Launcher
- Pls add the region us-west-1 (Calgary) - CANADA
- taskDefinitionOverride not getting checked when retain agent is enabled HOT 1
- Docker containers not being terminated resulting in dozens of idle containers HOT 1
- Override task parameters at runtime 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.