Skip to content

Commit

Permalink
[NodeJS18 Upgrade] Remove old AL2 Docker Host and Tweak Windows Start…
Browse files Browse the repository at this point in the history
…up Scripts (#342)

* Restore AL2 docker hosts and add crane

Signed-off-by: Peter Zhu <[email protected]>

* Add new script for windows docker initializing

Signed-off-by: Peter Zhu <[email protected]>

---------

Signed-off-by: Peter Zhu <[email protected]>
  • Loading branch information
peterzhuamazon authored Sep 6, 2023
1 parent 506c88f commit adfb346
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
1 change: 0 additions & 1 deletion lib/ci-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ export class CIStack extends Stack {
agentNode.AL2_ARM64_DOCKER_HOST,
agentNode.AL2023_ARM64_DOCKER_HOST,
agentNode.AL2023_X64_BENCHMARK_TEST,
agentNode.AL2023_X64_BENCHMARK_TEST_NEW_SPEC,
agentNode.UBUNTU2004_X64_GRADLE_CHECK,
agentNode.UBUNTU2004_X64_DOCKER_BUILDER,
agentNode.MACOS12_X64_MULTI_HOST,
Expand Down
28 changes: 10 additions & 18 deletions lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ export class AgentNodes {

readonly AL2023_X64_BENCHMARK_TEST: AgentNodeProps;

readonly AL2023_X64_BENCHMARK_TEST_NEW_SPEC: AgentNodeProps;

readonly UBUNTU2004_X64_GRADLE_CHECK: AgentNodeProps;

readonly UBUNTU2004_X64_DOCKER_BUILDER: AgentNodeProps;
Expand Down Expand Up @@ -145,20 +143,6 @@ export class AgentNodes {
+ ' sudo dnf update --skip-broken --exclude=openssh* --exclude=docker* --exclude=gh* --exclude=python* -y && docker ps',
remoteFs: '/var/jenkins',
};
this.AL2023_X64_BENCHMARK_TEST_NEW_SPEC = {
agentType: 'unix',
customDeviceMapping: '/dev/xvda=:600:true:::encrypted',
workerLabelString: 'Jenkins-Agent-AL2023-X64-C54xlarge-Benchmark-Test-New-Spec',
instanceType: 'C54xlarge',
remoteUser: 'ec2-user',
maxTotalUses: -1,
minimumNumberOfSpareInstances: 1,
numExecutors: 4,
amiId: 'ami-01dfbac890366ceda',
initScript: 'sudo dnf clean all && sudo rm -rf /var/cache/dnf && sudo dnf repolist &&'
+ ' sudo dnf update --skip-broken --exclude=openssh* --exclude=docker* --exclude=gh* --exclude=python* -y && docker ps',
remoteFs: '/var/jenkins',
};
this.UBUNTU2004_X64_GRADLE_CHECK = {
agentType: 'unix',
customDeviceMapping: '/dev/sda1=:300:true:::encrypted',
Expand Down Expand Up @@ -223,7 +207,11 @@ export class AgentNodes {
minimumNumberOfSpareInstances: 2,
numExecutors: 4,
amiId: 'ami-043fc8c0db1626fd2',
initScript: 'echo %USERNAME% && dockerd --register-service && net start docker && echo started docker deamon && docker ps',
initScript: 'echo %USERNAME% && dockerd --register-service && net start docker && echo started docker deamon && docker ps && '
+ 'echo initializing docker images now waiting for 5min && git clone https://github.com/opensearch-project/opensearch-build.git && '
+ 'bash.exe -c "docker run --rm -it --name docker-windows-test -d `opensearch-build/docker/ci/get-ci-images.sh '
+ '-p windows2019-servercore -u opensearch -t build | head -1` bash.exe && sleep 5" && docker exec -it docker-windows-test whoami && '
+ 'docker ps && docker stop docker-windows-test && docker ps && rm -rf opensearch-build',
remoteFs: 'C:/Users/Administrator/jenkins',
};
this.WINDOWS2019_X64_DOCKER_BUILDER = {
Expand All @@ -236,7 +224,11 @@ export class AgentNodes {
minimumNumberOfSpareInstances: 1,
numExecutors: 1,
amiId: 'ami-043fc8c0db1626fd2',
initScript: 'echo %USERNAME% && dockerd --register-service && net start docker && echo started docker deamon && docker ps',
initScript: 'echo %USERNAME% && dockerd --register-service && net start docker && echo started docker deamon && docker ps && '
+ 'echo initializing docker images now waiting for 5min && git clone https://github.com/opensearch-project/opensearch-build.git && '
+ 'bash.exe -c "docker run --rm -it --name docker-windows-test -d `opensearch-build/docker/ci/get-ci-images.sh '
+ '-p windows2019-servercore -u opensearch -t build | head -1` bash.exe && sleep 5" && docker exec -it docker-windows-test whoami && '
+ 'docker ps && docker stop docker-windows-test && docker ps && rm -rf opensearch-build',
remoteFs: 'C:/Users/Administrator/jenkins',
};
this.WINDOWS2019_X64_GRADLE_CHECK = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ rm -v "$pigzPath\\*.zip"
$machineenv = [System.Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine)
[System.Environment]::SetEnvironmentVariable("PATH", $machineenv + ";$pigzPath", [System.EnvironmentVariableTarget]::Machine)

# Install gcrane to handle dynamic ci image retrieval, use pigz path
curl.exe -SL "https://github.com/google/go-containerregistry/releases/download/v0.15.2/go-containerregistry_Windows_x86_64.tar.gz" -o "$pigzPath\\gcrane.tar.gz"
tar -xzvf "$pigzPath\\gcrane.tar.gz" -C "$pigzPath" "crane.exe"
rm -v "$pigzPath\\gcrane.tar.gz"
dir $pigzPath

# Setup Docker
echo "Enable Hyper-V"
Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Hyper-V" -All -NoRestart
Expand Down

0 comments on commit adfb346

Please sign in to comment.