-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Jenkins Agents always install the latest docker instead of pinned version #550
Comments
I believe I found the problem. The issue was that the test for docker was failing because the section '[amzn2extra-docker]' was already in amzn2-extras.repo and was set to latest (a dependency of some prior tool? enabled by default? changed in some new version of amazon linux since the template was written?). So the test section fails and the command is never run. I removed the test line and added the yum clean metadata line to the command, and now version 18.06.1 is installed on the nodes. Here's a diff: 'a_enable_docker':
- command: 'amazon-linux-extras enable docker=18.06.1'
- test: "! grep -Fxq '[amzn2extra-docker]' /etc/yum.repos.d/amzn2-extras.repo"
+ command: 'amazon-linux-extras enable docker=18.06.1; yum clean metadata' It helped once I found that logs are in
NOTE: that for some reason 18.09.9 would not install for me because the source could not be found for some reason, so 18.06.1 is the most recent version of docker available using this method of installation. I would have liked to use |
[Bug Fix] wordpress/* - Clean yum cache after enabling Amazon Linux extras fixes #550
Thanks for the bug report. I'm working on a fix. |
@timharsch could you confirm that the fix in #551 fixes your issue? |
I can't confirm, because I don't run the latest jenkins template, but a modified version of one some number of releases back. I did a review of your PR though and from a static analysis viewpoint it looks fine to me. |
TemplateID: jenkins/jenkins2-ha-agents
Region: us-east-2
(describe your issue here)
TLDR?; skip to the last paragraph
I've been running the jenkins template for daily builds without issue for last 6 months. One day I was surprised to see our builds start failing. The issue was when we start a build using docker - the containers would build, but running a command would hang. I traced the problem down to amazon releasing a new version of docker in amazon-linux-extras. If I manually logged into a node and downgraded to the latest version before the incident via
sudo yum downgrade docker-19.03.13ce-1.amzn2
This fixed the issue and builds are functioning again so long as that node remains up. Next task is to figure out how to get the agents to use the pinned version, so it is available on restarts. I found this line in the template:
aws-cf-templates/jenkins/jenkins2-ha-agents.yaml
Line 1780 in 714d8b9
Changing that version however did not help. I also found that my agents are having docker version '20.10.4-1' installed despite the line's declaration of version 18. As can be seen in this workflow I did locally:
Note the last three lines of
amazon-linux-extras enable docker=18.06.1
command:If I add the missing step prescribed in the final three lines of the output, it works:
So I think the issue could be solved by finding the spot in the template where the
yum clean metadata
can be performed. That would help me get the docker version 18 to be installed on new agents. I'd also like to figure out how to bring it to the latest I can use, which is version19.03.13ce-1
at this time (at least until the issue with version 20 of docker can be found). I can't seem to find the correct version to list in the enable command though -amazon-linux-extras enable docker=docker-19.03.13ce-1
doesn't seem work, the version can't be found.The text was updated successfully, but these errors were encountered: