From 5d859e07ea9609fcaa64a74519a886ad6a4a93c0 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 26 Jul 2022 19:39:53 -0400 Subject: [PATCH 1/3] Fix gradle check by removing old caches and add back docker-compose Signed-off-by: Peter Zhu --- lib/compute/agent-nodes.ts | 4 ++-- lib/compute/jenkins-main-node.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/compute/agent-nodes.ts b/lib/compute/agent-nodes.ts index 00508705..ce463cd7 100644 --- a/lib/compute/agent-nodes.ts +++ b/lib/compute/agent-nodes.ts @@ -99,7 +99,7 @@ export class AgentNodes { amiId: 'ami-0f6ceb3b3687a3fba', initScript: 'sudo apt-mark hold docker docker.io openssh-server && docker ps &&' + ' sudo apt-get update && (sudo killall -9 apt-get apt 2>&1 || echo) &&' - + ' sudo apt-get upgrade -y && sudo apt-get install -y ntp &&' + + ' sudo apt-get upgrade -y && sudo apt-get install -y ntp docker-compose &&' + ' sudo systemctl restart ntp && sudo systemctl enable ntp', }; this.UBUNTU2004_X64_DOCKER_BUILDER = { @@ -112,7 +112,7 @@ export class AgentNodes { amiId: 'ami-0f6ceb3b3687a3fba', initScript: 'sudo apt-mark hold docker docker.io openssh-server && docker ps &&' + ' sudo apt-get update && (sudo killall -9 apt-get apt 2>&1 || echo) &&' - + ' sudo apt-get upgrade -y && sudo apt-get install -y ntp &&' + + ' sudo apt-get upgrade -y && sudo apt-get install -y ntp docker-compose &&' + ' sudo systemctl restart ntp && sudo systemctl enable ntp', }; this.MACOS12_X64_MULTI_HOST = { diff --git a/lib/compute/jenkins-main-node.ts b/lib/compute/jenkins-main-node.ts index 6cf6be92..bb24c37c 100644 --- a/lib/compute/jenkins-main-node.ts +++ b/lib/compute/jenkins-main-node.ts @@ -365,7 +365,7 @@ export class JenkinsMainNode { InitCommand.shellCommand('/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s'), InitCommand.shellCommand(dataRetentionProps.dataRetention - ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins` + ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins && rm -rf /var/lib/jenkins/caches/*` : 'echo Data rentention is disabled, not mounting efs'), InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../../resources/docker-compose.yml')), From 4d6c5c57f65a18d133eb3afe6b5558053d050ab3 Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 26 Jul 2022 19:53:04 -0400 Subject: [PATCH 2/3] Remove JDK only in caches and show the remove msgs Signed-off-by: Peter Zhu --- lib/compute/jenkins-main-node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compute/jenkins-main-node.ts b/lib/compute/jenkins-main-node.ts index bb24c37c..d945ca4b 100644 --- a/lib/compute/jenkins-main-node.ts +++ b/lib/compute/jenkins-main-node.ts @@ -365,7 +365,7 @@ export class JenkinsMainNode { InitCommand.shellCommand('/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s'), InitCommand.shellCommand(dataRetentionProps.dataRetention - ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins && rm -rf /var/lib/jenkins/caches/*` + ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins && rm -vrf /var/lib/jenkins/caches/adoptopenjdk/*` : 'echo Data rentention is disabled, not mounting efs'), InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../../resources/docker-compose.yml')), From c52d3ddc3ee1c322ee68e32658d3974a82eba95b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 26 Jul 2022 20:02:25 -0400 Subject: [PATCH 3/3] Remove removing caches Signed-off-by: Peter Zhu --- lib/compute/jenkins-main-node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compute/jenkins-main-node.ts b/lib/compute/jenkins-main-node.ts index d945ca4b..6cf6be92 100644 --- a/lib/compute/jenkins-main-node.ts +++ b/lib/compute/jenkins-main-node.ts @@ -365,7 +365,7 @@ export class JenkinsMainNode { InitCommand.shellCommand('/opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a fetch-config -m ec2 -c file:/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.json -s'), InitCommand.shellCommand(dataRetentionProps.dataRetention - ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins && rm -vrf /var/lib/jenkins/caches/adoptopenjdk/*` + ? `mkdir /var/lib/jenkins && mount -t efs ${efsId} /var/lib/jenkins` : 'echo Data rentention is disabled, not mounting efs'), InitFile.fromFileInline('/docker-compose.yml', join(__dirname, '../../resources/docker-compose.yml')),