diff --git a/.github/workflows/dco.yml b/.github/workflows/dco.yml deleted file mode 100644 index a8ed8651..00000000 --- a/.github/workflows/dco.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Developer Certificate of Origin Check - -on: [pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Get PR Commits - id: 'get-pr-commits' - uses: tim-actions/get-pr-commits@v1.1.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - name: DCO Check - uses: tim-actions/dco@v1.1.0 - with: - commits: ${{ steps.get-pr-commits.outputs.commits }} \ No newline at end of file diff --git a/lib/ci-stack.ts b/lib/ci-stack.ts index 5d1afce8..26dd08fc 100644 --- a/lib/ci-stack.ts +++ b/lib/ci-stack.ts @@ -100,9 +100,9 @@ export class CIStack extends Stack { const certificateArn = Secret.fromSecretCompleteArn(this, 'certificateArn', importedArnSecretBucketValue.toString()); const importedReloadPasswordSecretsArn = Fn.importValue(`${CIConfigStack.CASC_RELOAD_TOKEN_SECRET_EXPORT_VALUE}`); const listenerCertificate = ListenerCertificate.fromArn(certificateArn.secretValue.toString()); - const agentNode = new AgentNodes(this); - const agentNodes: AgentNodeProps[] = [agentNode.AL2_X64, agentNode.AL2_X64_DOCKER_1, agentNode.AL2_ARM64, agentNode.AL2_ARM64_DOCKER_1, - agentNode.UBUNTU_X64_DOCKER]; + const agentNode = new AgentNodes(); + const agentNodes: AgentNodeProps[] = [agentNode.AL2_X64, agentNode.AL2_X64_DOCKER_HOST, agentNode.AL2_ARM64, agentNode.AL2_ARM64_DOCKER_HOST, + agentNode.UBUNTU_X64_DOCKER_BUILDER]; const mainJenkinsNode = new JenkinsMainNode(this, { vpc, diff --git a/lib/compute/agent-node-config.ts b/lib/compute/agent-node-config.ts index 6df3e671..ebe8007c 100644 --- a/lib/compute/agent-node-config.ts +++ b/lib/compute/agent-node-config.ts @@ -22,6 +22,7 @@ export interface AgentNodeProps { instanceType: string; workerLabelString: string; remoteUser: string; + numExecutors: number; initScript: string } @@ -168,7 +169,7 @@ export class AgentNodeConfig { minimumNumberOfSpareInstances: 1, mode: 'EXCLUSIVE', monitoring: true, - numExecutors: 4, + numExecutors: config.numExecutors, remoteAdmin: config.remoteUser, remoteFS: '/var/jenkins', securityGroups: props.agentNodeSecurityGroup, @@ -177,7 +178,7 @@ export class AgentNodeConfig { t2Unlimited: false, tags: [{ name: 'Name', - value: `${stack.stackName}/AgentNode`, + value: `${stack.stackName}/AgentNode/${config.workerLabelString}`, }, { name: 'type', diff --git a/lib/compute/agent-nodes.ts b/lib/compute/agent-nodes.ts index 71b90fd2..208d6065 100644 --- a/lib/compute/agent-nodes.ts +++ b/lib/compute/agent-nodes.ts @@ -9,66 +9,61 @@ import { AmazonLinuxCpuType, AmazonLinuxGeneration, MachineImage, } from '@aws-cdk/aws-ec2'; -import { Stack } from '@aws-cdk/core'; import { AgentNodeProps } from './agent-node-config'; export class AgentNodes { // Refer: https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/ec2/model/InstanceType.html for instance types readonly AL2_X64: AgentNodeProps; - readonly AL2_X64_DOCKER_1: AgentNodeProps; + readonly AL2_X64_DOCKER_HOST: AgentNodeProps; readonly AL2_ARM64: AgentNodeProps; - readonly AL2_ARM64_DOCKER_1: AgentNodeProps; + readonly AL2_ARM64_DOCKER_HOST: AgentNodeProps; - readonly UBUNTU_X64_DOCKER: AgentNodeProps; + readonly UBUNTU_X64_DOCKER_BUILDER: AgentNodeProps; - constructor(stack: Stack) { + constructor() { this.AL2_X64 = { - workerLabelString: 'AL2-X64', + workerLabelString: 'Jenkins-Agent-al2-x64-c54xlarge-Single-Host', instanceType: 'C54xlarge', remoteUser: 'ec2-user', - amiId: MachineImage.latestAmazonLinux({ - generation: AmazonLinuxGeneration.AMAZON_LINUX_2, - cpuType: AmazonLinuxCpuType.X86_64, - }).getImage(stack).imageId.toString(), - initScript: 'sudo mkdir -p /var/jenkins/ && sudo chown -R ec2-user:ec2-user /var/jenkins &&' - + ' sudo yum install -y java-1.8.0-openjdk cmake python3 python3-pip python3-devel && sudo yum groupinstall -y "Development Tools" &&' - + ' sudo ln -sfn `which pip3` /usr/bin/pip && pip3 install pipenv && sudo ln -s ~/.local/bin/pipenv /usr/local/bin', + numExecutors: 1, + amiId: 'ami-00a07e55fcad01043', + initScript: 'sudo yum update -y || sleep 10 && sudo yum update -y', }; - this.AL2_X64_DOCKER_1 = { + this.AL2_X64_DOCKER_HOST = { workerLabelString: 'Jenkins-Agent-al2-x64-c54xlarge-Docker-Host', instanceType: 'C54xlarge', remoteUser: 'ec2-user', + numExecutors: 8, amiId: 'ami-00a07e55fcad01043', - initScript: 'sudo yum update -y || sudo yum update -y', + initScript: 'sudo yum update -y || sleep 10 && sudo yum update -y', }; this.AL2_ARM64 = { - workerLabelString: 'AL2-ARM64', + workerLabelString: 'Jenkins-Agent-al2-arm64-c6g4xlarge-Single-Host', instanceType: 'C6g4xlarge', remoteUser: 'ec2-user', - amiId: MachineImage.latestAmazonLinux({ - generation: AmazonLinuxGeneration.AMAZON_LINUX_2, - cpuType: AmazonLinuxCpuType.ARM_64, - }).getImage(stack).imageId.toString(), - initScript: 'sudo mkdir -p /var/jenkins/ && sudo chown -R ec2-user:ec2-user /var/jenkins &&' - + ' sudo yum install -y java-1.8.0-openjdk cmake python3 python3-pip python3-devel && sudo yum groupinstall -y "Development Tools" &&' - + ' sudo ln -sfn `which pip3` /usr/bin/pip && pip3 install pipenv && sudo ln -s ~/.local/bin/pipenv /usr/local/bin', + numExecutors: 1, + amiId: 'ami-020c52efb1a60f1ae', + initScript: 'sudo yum update -y || sleep 10 && sudo yum update -y', }; - this.AL2_ARM64_DOCKER_1 = { + this.AL2_ARM64_DOCKER_HOST = { workerLabelString: 'Jenkins-Agent-al2-arm64-c6g4xlarge-Docker-Host', instanceType: 'C6g4xlarge', remoteUser: 'ec2-user', + numExecutors: 8, amiId: 'ami-020c52efb1a60f1ae', - initScript: 'sudo yum update -y || sudo yum update -y', + initScript: 'sudo yum update -y || sleep 10 && sudo yum update -y', }; - this.UBUNTU_X64_DOCKER = { + this.UBUNTU_X64_DOCKER_BUILDER = { workerLabelString: 'Jenkins-Agent-Ubuntu2004-X64-m52xlarge-Docker-Builder', instanceType: 'M52xlarge', remoteUser: 'ubuntu', + numExecutors: 1, amiId: 'ami-0f6ceb3b3687a3fba', - initScript: 'sudo apt-mark hold docker docker.io openssh-server && docker ps', + initScript: 'sudo apt-mark hold docker docker.io openssh-server && docker ps' + + 'sudo apt-get update -y && sudo apt-get upgrade -y', }; } } diff --git a/resources/baseJenkins.yaml b/resources/baseJenkins.yaml index c8a52e65..98bb1d49 100644 --- a/resources/baseJenkins.yaml +++ b/resources/baseJenkins.yaml @@ -8,12 +8,14 @@ jenkins: disableRememberMe: false labelAtoms: - name: "built-in" + - name: "main-node" + labelString: "main-node" markupFormatter: rawHtml: disableSyntaxHighlighting: true - mode: NORMAL + mode: EXCLUSIVE myViewsTabBar: "standard" - numExecutors: 2 + numExecutors: 4 primaryView: all: name: "all"