From d0fba3c5fcb6c4e7e10d639ef177b6558e5a4504 Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Wed, 4 Nov 2020 14:12:02 +0000 Subject: [PATCH 1/6] feat: add windows images for LTSC 2019 --- .../windowsservercore-2019/hotspot/Dockerfile | 71 ++++++++++++++++ .../windowsservercore-2019/openj9/Dockerfile | 83 +++++++++++++++++++ .../windowsservercore-2019/hotspot/Dockerfile | 70 ++++++++++++++++ .../windowsservercore-2019/openj9/Dockerfile | 83 +++++++++++++++++++ 4 files changed, 307 insertions(+) create mode 100644 11/windows/windowsservercore-2019/hotspot/Dockerfile create mode 100644 11/windows/windowsservercore-2019/openj9/Dockerfile create mode 100644 8/windows/windowsservercore-2019/hotspot/Dockerfile create mode 100644 8/windows/windowsservercore-2019/openj9/Dockerfile diff --git a/11/windows/windowsservercore-2019/hotspot/Dockerfile b/11/windows/windowsservercore-2019/hotspot/Dockerfile new file mode 100644 index 0000000000..869b2348f6 --- /dev/null +++ b/11/windows/windowsservercore-2019/hotspot/Dockerfile @@ -0,0 +1,71 @@ +# escape=` +FROM jenkins4eval/openjdk:11-hotspot-windowsservercore-ltsc2019 + +ARG user=jenkins +ARG http_port=8080 +ARG agent_port=50000 +ARG JENKINS_HOME=C:/ProgramData/Jenkins/JenkinsHome + +ENV JENKINS_HOME $JENKINS_HOME +ENV JENKINS_AGENT_PORT ${agent_port} + +# Jenkins home directory is a volume, so configuration and build history +# can be persisted and survive image upgrades +VOLUME $JENKINS_HOME + +# Jenkins is run with user `jenkins` +# If you bind mount a volume from the host or a data container, +# ensure you use the same uid +RUN New-LocalUser -Name $env:user -AccountNeverExpires -Description 'Jenkins User' -NoPassword -UserMayNotChangePassword | Out-Null ; ` + Set-Localuser -Name $env:user -PasswordNeverExpires $true | Out-Null ; ` + Add-LocalGroupMember -Group "Administrators" -Member "${env:user}" ; ` + New-Item -Type Directory -Force -Path "C:/ProgramData/Jenkins" | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /setowner ${env:user} | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /inheritance:r | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /setowner ${env:user} | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null + +USER ${user} + +# `C:/ProgramData/Jenkins/Reference/` contains all reference configuration we want +# to set on a fresh new installation. Use it to bundle additional plugins +# or config file with your custom jenkins Docker image. +RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/init.groovy.d | Out-Null + +# jenkins version being bundled in this docker image +ARG JENKINS_VERSION +ENV JENKINS_VERSION ${JENKINS_VERSION:-2.235.4} + +# jenkins.war checksum, download will be validated using it +ARG JENKINS_SHA=e5688a8f07cc3d79ba3afa3cab367d083dd90daab77cebd461ba8e83a1e3c177 + +# Can be used to customize where jenkins.war get downloaded from +ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war + +# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum +# see https://github.com/docker/docker/issues/8331 +RUN curl.exe -fsSL "$env:JENKINS_URL" -o C:/ProgramData/Jenkins/jenkins.war ; ` + if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:JENKINS_SHA) {exit 1} + +ENV JENKINS_UC https://updates.jenkins.io +ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental +ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals + +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar +RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar + +# for main web interface: +EXPOSE ${http_port} + +# will be used by attached agents: +EXPOSE ${agent_port} + +ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log + +COPY jenkins-support.psm1 C:/ProgramData/Jenkins +COPY jenkins.ps1 C:/ProgramData/Jenkins +# See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image +COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins + +ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] diff --git a/11/windows/windowsservercore-2019/openj9/Dockerfile b/11/windows/windowsservercore-2019/openj9/Dockerfile new file mode 100644 index 0000000000..077a7351df --- /dev/null +++ b/11/windows/windowsservercore-2019/openj9/Dockerfile @@ -0,0 +1,83 @@ +# escape=` +FROM jenkins4eval/openjdk:11-openj9-windowsservercore-ltsc2019 + +ARG user=jenkins +ARG http_port=8080 +ARG agent_port=50000 +ARG JENKINS_HOME=C:/ProgramData/Jenkins/JenkinsHome + +ENV JENKINS_HOME $JENKINS_HOME +ENV JENKINS_AGENT_PORT ${agent_port} + +# Jenkins home directory is a volume, so configuration and build history +# can be persisted and survive image upgrades +VOLUME $JENKINS_HOME + +# Jenkins is run with user `jenkins` +# If you bind mount a volume from the host or a data container, +# ensure you use the same uid +RUN New-LocalUser -Name $env:user -AccountNeverExpires -Description 'Jenkins User' -NoPassword -UserMayNotChangePassword | Out-Null ; ` + Set-Localuser -Name $env:user -PasswordNeverExpires $true | Out-Null ; ` + Add-LocalGroupMember -Group "Administrators" -Member "${env:user}" ; ` + New-Item -Type Directory -Force -Path "C:/ProgramData/Jenkins" | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /setowner ${env:user} | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /inheritance:r | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /setowner ${env:user} | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null + +USER ${user} + +# `C:/ProgramData/Jenkins/Reference/` contains all reference configuration we want +# to set on a fresh new installation. Use it to bundle additional plugins +# or config file with your custom jenkins Docker image. +RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/init.groovy.d | Out-Null + +# jenkins version being bundled in this docker image +ARG JENKINS_VERSION +ENV JENKINS_VERSION ${JENKINS_VERSION:-2.235.4} + +# jenkins.war checksum, download will be validated using it +ARG JENKINS_SHA=e5688a8f07cc3d79ba3afa3cab367d083dd90daab77cebd461ba8e83a1e3c177 + +# Can be used to customize where jenkins.war get downloaded from +ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war + +# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum +# see https://github.com/docker/docker/issues/8331 +RUN curl.exe -fsSL "$env:JENKINS_URL" -o C:/ProgramData/Jenkins/jenkins.war ; ` + if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:JENKINS_SHA) {exit 1} + +ENV JENKINS_UC https://updates.jenkins.io +ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental +ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals + +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar +RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar + +# for main web interface: +EXPOSE ${http_port} + +# will be used by attached agents: +EXPOSE ${agent_port} + +ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log + +# # set variables to create shared class cache +# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" +# ENV JAVA_OLD_OPTS ${JAVA_OPTS} +# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" + +# # create shared class cache +# RUN $j = Start-Job -ScriptBlock { & C:/ProgramData/Jenkins/jenkins.ps1 } ; Start-Sleep -Seconds 120 ; Stop-Job $j + +# # revert JAVA_OPTS to not have shared class cache +# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" +# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" + +COPY jenkins-support.psm1 C:/ProgramData/Jenkins +COPY jenkins.ps1 C:/ProgramData/Jenkins +# See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image +COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins + +ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] diff --git a/8/windows/windowsservercore-2019/hotspot/Dockerfile b/8/windows/windowsservercore-2019/hotspot/Dockerfile new file mode 100644 index 0000000000..0d5b31329b --- /dev/null +++ b/8/windows/windowsservercore-2019/hotspot/Dockerfile @@ -0,0 +1,70 @@ +# escape=` +FROM jenkins4eval/openjdk:8-hotspot-windowsservercore-ltsc2019 + +ARG user=jenkins +ARG http_port=8080 +ARG agent_port=50000 +ARG JENKINS_HOME=C:/ProgramData/Jenkins/JenkinsHome + +ENV JENKINS_HOME $JENKINS_HOME +ENV JENKINS_AGENT_PORT ${agent_port} + +# Jenkins home directory is a volume, so configuration and build history +# can be persisted and survive image upgrades +VOLUME $JENKINS_HOME + +# Jenkins is run with user `jenkins` +# If you bind mount a volume from the host or a data container, +# ensure you use the same uid +RUN New-LocalUser -Name $env:user -AccountNeverExpires -Description 'Jenkins User' -NoPassword -UserMayNotChangePassword | Out-Null ; ` + Set-Localuser -Name $env:user -PasswordNeverExpires $true | Out-Null ; ` + Add-LocalGroupMember -Group "Administrators" -Member "${env:user}" ; ` + New-Item -Type Directory -Force -Path "C:/ProgramData/Jenkins" | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /setowner ${env:user} | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /inheritance:r | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /setowner ${env:user} | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null + +USER ${user} + +# `C:/ProgramData/Jenkins/Reference/` contains all reference configuration we want +# to set on a fresh new installation. Use it to bundle additional plugins +# or config file with your custom jenkins Docker image. +RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/init.groovy.d | Out-Null + +# jenkins version being bundled in this docker image +ARG JENKINS_VERSION +ENV JENKINS_VERSION ${JENKINS_VERSION:-2.235.4} + +# jenkins.war checksum, download will be validated using it +ARG JENKINS_SHA=e5688a8f07cc3d79ba3afa3cab367d083dd90daab77cebd461ba8e83a1e3c177 + +# Can be used to customize where jenkins.war get downloaded from +ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war + +# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum +# see https://github.com/docker/docker/issues/8331 +RUN curl.exe -fsSL "$env:JENKINS_URL" -o C:/ProgramData/Jenkins/jenkins.war ; ` + if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:JENKINS_SHA) {exit 1} + +ENV JENKINS_UC https://updates.jenkins.io +ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental +ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals + +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar +RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar + +# for main web interface: +EXPOSE ${http_port} + +# will be used by attached agents: +EXPOSE ${agent_port} + +ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log + +COPY jenkins-support.psm1 C:/ProgramData/Jenkins +COPY jenkins.ps1 C:/ProgramData/Jenkins +# See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image +COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins +ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] diff --git a/8/windows/windowsservercore-2019/openj9/Dockerfile b/8/windows/windowsservercore-2019/openj9/Dockerfile new file mode 100644 index 0000000000..5f56ecbd5a --- /dev/null +++ b/8/windows/windowsservercore-2019/openj9/Dockerfile @@ -0,0 +1,83 @@ +# escape=` +FROM jenkins4eval/openjdk:8-openj9-windowsservercore-ltsc2019 + +ARG user=jenkins +ARG http_port=8080 +ARG agent_port=50000 +ARG JENKINS_HOME=C:/ProgramData/Jenkins/JenkinsHome + +ENV JENKINS_HOME $JENKINS_HOME +ENV JENKINS_AGENT_PORT ${agent_port} + +# Jenkins home directory is a volume, so configuration and build history +# can be persisted and survive image upgrades +VOLUME $JENKINS_HOME + +# Jenkins is run with user `jenkins` +# If you bind mount a volume from the host or a data container, +# ensure you use the same uid +RUN New-LocalUser -Name $env:user -AccountNeverExpires -Description 'Jenkins User' -NoPassword -UserMayNotChangePassword | Out-Null ; ` + Set-Localuser -Name $env:user -PasswordNeverExpires $true | Out-Null ; ` + Add-LocalGroupMember -Group "Administrators" -Member "${env:user}" ; ` + New-Item -Type Directory -Force -Path "C:/ProgramData/Jenkins" | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /setowner ${env:user} | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /inheritance:r | Out-Null ; ` + icacls.exe "C:/ProgramData/Jenkins" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /setowner ${env:user} | Out-Null ; ` + icacls.exe "$env:JENKINS_HOME" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null + +USER ${user} + +# `C:/ProgramData/Jenkins/Reference/` contains all reference configuration we want +# to set on a fresh new installation. Use it to bundle additional plugins +# or config file with your custom jenkins Docker image. +RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/init.groovy.d | Out-Null + +# jenkins version being bundled in this docker image +ARG JENKINS_VERSION +ENV JENKINS_VERSION ${JENKINS_VERSION:-2.235.4} + +# jenkins.war checksum, download will be validated using it +ARG JENKINS_SHA=e5688a8f07cc3d79ba3afa3cab367d083dd90daab77cebd461ba8e83a1e3c177 + +# Can be used to customize where jenkins.war get downloaded from +ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war + +# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum +# see https://github.com/docker/docker/issues/8331 +RUN curl.exe -fsSL "$env:JENKINS_URL" -o C:/ProgramData/Jenkins/jenkins.war ; ` + if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:JENKINS_SHA) {exit 1} + +ENV JENKINS_UC https://updates.jenkins.io +ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental +ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals + +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar +RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar + +# for main web interface: +EXPOSE ${http_port} + +# will be used by attached agents: +EXPOSE ${agent_port} + +ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log + +COPY jenkins-support.psm1 C:/ProgramData/Jenkins +COPY jenkins.ps1 C:/ProgramData/Jenkins +# See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image +COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins + +# set variables to create shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" +ENV JAVA_OLD_OPTS ${JAVA_OPTS} +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" + +# create shared class cache +RUN $j = Start-Job -ScriptBlock { powershell -f C:/ProgramData/Jenkins/jenkins.ps1 | Out-Default } ; Start-Sleep -Seconds 45 ; Stop-Job $j + +# revert JAVA_OPTS to not have shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" + +ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] From a37cc7f2b5cdc72cf8558f47f7056c777c347970 Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Wed, 18 Nov 2020 13:18:37 +0000 Subject: [PATCH 2/6] chore: increase timeout to 100m --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 83a34f346f..af116be1c1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -140,7 +140,7 @@ stage('Build') { void nodeWithTimeout(String label, def body) { node(label) { - timeout(time: 60, unit: 'MINUTES') { + timeout(time: 100, unit: 'MINUTES') { body.call() } } From fbe1e21da99b78aa34a3f56736805749a9b79a7a Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Thu, 19 Nov 2020 14:44:27 +0000 Subject: [PATCH 3/6] chore: uncomment shared cache block --- .../windowsservercore-1809/openj9/Dockerfile | 20 +++++++++---------- .../windowsservercore-2019/openj9/Dockerfile | 18 ++++++++--------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/11/windows/windowsservercore-1809/openj9/Dockerfile b/11/windows/windowsservercore-1809/openj9/Dockerfile index 24187bb39d..ea12c238ba 100644 --- a/11/windows/windowsservercore-1809/openj9/Dockerfile +++ b/11/windows/windowsservercore-1809/openj9/Dockerfile @@ -63,21 +63,21 @@ EXPOSE ${agent_port} ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log -# # set variables to create shared class cache -# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" -# ENV JAVA_OLD_OPTS ${JAVA_OPTS} -# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" +# set variables to create shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" +ENV JAVA_OLD_OPTS ${JAVA_OPTS} +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" -# # create shared class cache -# RUN $j = Start-Job -ScriptBlock { & C:/ProgramData/Jenkins/jenkins.ps1 } ; Start-Sleep -Seconds 120 ; Stop-Job $j +# create shared class cache +RUN $j = Start-Job -ScriptBlock { & C:/ProgramData/Jenkins/jenkins.ps1 } ; Start-Sleep -Seconds 120 ; Stop-Job $j -# # revert JAVA_OPTS to not have shared class cache -# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" -# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" +# revert JAVA_OPTS to not have shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" COPY jenkins-support.psm1 C:/ProgramData/Jenkins COPY jenkins.ps1 C:/ProgramData/Jenkins # See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins -ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] \ No newline at end of file +ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] diff --git a/11/windows/windowsservercore-2019/openj9/Dockerfile b/11/windows/windowsservercore-2019/openj9/Dockerfile index 077a7351df..7acd81c746 100644 --- a/11/windows/windowsservercore-2019/openj9/Dockerfile +++ b/11/windows/windowsservercore-2019/openj9/Dockerfile @@ -63,17 +63,17 @@ EXPOSE ${agent_port} ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log -# # set variables to create shared class cache -# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" -# ENV JAVA_OLD_OPTS ${JAVA_OPTS} -# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" +# set variables to create shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" +ENV JAVA_OLD_OPTS ${JAVA_OPTS} +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" -# # create shared class cache -# RUN $j = Start-Job -ScriptBlock { & C:/ProgramData/Jenkins/jenkins.ps1 } ; Start-Sleep -Seconds 120 ; Stop-Job $j +# create shared class cache +RUN $j = Start-Job -ScriptBlock { & C:/ProgramData/Jenkins/jenkins.ps1 } ; Start-Sleep -Seconds 120 ; Stop-Job $j -# # revert JAVA_OPTS to not have shared class cache -# ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" -# ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" +# revert JAVA_OPTS to not have shared class cache +ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" +ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" COPY jenkins-support.psm1 C:/ProgramData/Jenkins COPY jenkins.ps1 C:/ProgramData/Jenkins From 879669a0db8d7809f9f382d164c9a2a11674544a Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Sun, 22 Nov 2020 11:54:26 +0000 Subject: [PATCH 4/6] chore: removed unused docker file --- .../windowsservercore-2019/openj9/Dockerfile | 83 ------------------- Jenkinsfile | 2 +- 2 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 8/windows/windowsservercore-2019/openj9/Dockerfile diff --git a/8/windows/windowsservercore-2019/openj9/Dockerfile b/8/windows/windowsservercore-2019/openj9/Dockerfile deleted file mode 100644 index 5f56ecbd5a..0000000000 --- a/8/windows/windowsservercore-2019/openj9/Dockerfile +++ /dev/null @@ -1,83 +0,0 @@ -# escape=` -FROM jenkins4eval/openjdk:8-openj9-windowsservercore-ltsc2019 - -ARG user=jenkins -ARG http_port=8080 -ARG agent_port=50000 -ARG JENKINS_HOME=C:/ProgramData/Jenkins/JenkinsHome - -ENV JENKINS_HOME $JENKINS_HOME -ENV JENKINS_AGENT_PORT ${agent_port} - -# Jenkins home directory is a volume, so configuration and build history -# can be persisted and survive image upgrades -VOLUME $JENKINS_HOME - -# Jenkins is run with user `jenkins` -# If you bind mount a volume from the host or a data container, -# ensure you use the same uid -RUN New-LocalUser -Name $env:user -AccountNeverExpires -Description 'Jenkins User' -NoPassword -UserMayNotChangePassword | Out-Null ; ` - Set-Localuser -Name $env:user -PasswordNeverExpires $true | Out-Null ; ` - Add-LocalGroupMember -Group "Administrators" -Member "${env:user}" ; ` - New-Item -Type Directory -Force -Path "C:/ProgramData/Jenkins" | Out-Null ; ` - icacls.exe "C:/ProgramData/Jenkins" /setowner ${env:user} | Out-Null ; ` - icacls.exe "C:/ProgramData/Jenkins" /inheritance:r | Out-Null ; ` - icacls.exe "C:/ProgramData/Jenkins" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null ; ` - icacls.exe "$env:JENKINS_HOME" /setowner ${env:user} | Out-Null ; ` - icacls.exe "$env:JENKINS_HOME" /grant:r $('{0}:(CI)(OI)(F)' -f $env:user) /grant 'Administrators:(CI)(OI)(F)' | Out-Null - -USER ${user} - -# `C:/ProgramData/Jenkins/Reference/` contains all reference configuration we want -# to set on a fresh new installation. Use it to bundle additional plugins -# or config file with your custom jenkins Docker image. -RUN New-Item -ItemType Directory -Force -Path C:/ProgramData/Jenkins/Reference/init.groovy.d | Out-Null - -# jenkins version being bundled in this docker image -ARG JENKINS_VERSION -ENV JENKINS_VERSION ${JENKINS_VERSION:-2.235.4} - -# jenkins.war checksum, download will be validated using it -ARG JENKINS_SHA=e5688a8f07cc3d79ba3afa3cab367d083dd90daab77cebd461ba8e83a1e3c177 - -# Can be used to customize where jenkins.war get downloaded from -ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war - -# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum -# see https://github.com/docker/docker/issues/8331 -RUN curl.exe -fsSL "$env:JENKINS_URL" -o C:/ProgramData/Jenkins/jenkins.war ; ` - if ((Get-FileHash C:/ProgramData/Jenkins/jenkins.war -Algorithm SHA256).Hash -ne $env:JENKINS_SHA) {exit 1} - -ENV JENKINS_UC https://updates.jenkins.io -ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental -ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals - -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar -RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar - -# for main web interface: -EXPOSE ${http_port} - -# will be used by attached agents: -EXPOSE ${agent_port} - -ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log - -COPY jenkins-support.psm1 C:/ProgramData/Jenkins -COPY jenkins.ps1 C:/ProgramData/Jenkins -# See https://github.com/jenkinsci/plugin-installation-manager-tool#cli-options for information on parameters for jenkins-plugin-cli.ps1 for installing plugins into the docker image -COPY jenkins-plugin-cli.ps1 C:/ProgramData/Jenkins - -# set variables to create shared class cache -ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,enableBCI -Xscmx80M" -ENV JAVA_OLD_OPTS ${JAVA_OPTS} -ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OPTS}" - -# create shared class cache -RUN $j = Start-Job -ScriptBlock { powershell -f C:/ProgramData/Jenkins/jenkins.ps1 | Out-Default } ; Start-Sleep -Seconds 45 ; Stop-Job $j - -# revert JAVA_OPTS to not have shared class cache -ENV JAVA_SCC_OPTS "-Xshareclasses:name=jenkins_scc,cacheDir=C:/tmp,readonly" -ENV JAVA_OPTS "${JAVA_SCC_OPTS} ${JAVA_OLD_OPTS}" - -ENTRYPOINT ["powershell.exe", "-f", "C:/ProgramData/Jenkins/jenkins.ps1"] diff --git a/Jenkinsfile b/Jenkinsfile index af116be1c1..83a34f346f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -140,7 +140,7 @@ stage('Build') { void nodeWithTimeout(String label, def body) { node(label) { - timeout(time: 100, unit: 'MINUTES') { + timeout(time: 60, unit: 'MINUTES') { body.call() } } From 6d4032bac4e34d2a394aa13dffdd8a603fdde834 Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Mon, 23 Nov 2020 15:59:28 +0000 Subject: [PATCH 5/6] chore: bump plugin manager to 2.1.2 --- 11/windows/windowsservercore-2019/hotspot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/windows/windowsservercore-2019/hotspot/Dockerfile b/11/windows/windowsservercore-2019/hotspot/Dockerfile index 869b2348f6..90ee1a9451 100644 --- a/11/windows/windowsservercore-2019/hotspot/Dockerfile +++ b/11/windows/windowsservercore-2019/hotspot/Dockerfile @@ -52,7 +52,7 @@ ENV JENKINS_UC https://updates.jenkins.io ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.1/jenkins-plugin-manager-2.1.1.jar +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.2/jenkins-plugin-manager-2.1.2.jar RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar # for main web interface: From bab123b67102cfc8907572deae92beeef2a0be3c Mon Sep 17 00:00:00 2001 From: Gareth Evans Date: Fri, 4 Dec 2020 09:24:24 +0000 Subject: [PATCH 6/6] chore: bump plugin manager to 2.2.0 --- 11/windows/windowsservercore-2019/hotspot/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/windows/windowsservercore-2019/hotspot/Dockerfile b/11/windows/windowsservercore-2019/hotspot/Dockerfile index 90ee1a9451..37b13c71b5 100644 --- a/11/windows/windowsservercore-2019/hotspot/Dockerfile +++ b/11/windows/windowsservercore-2019/hotspot/Dockerfile @@ -52,7 +52,7 @@ ENV JENKINS_UC https://updates.jenkins.io ENV JENKINS_UC_EXPERIMENTAL=https://updates.jenkins.io/experimental ENV JENKINS_INCREMENTALS_REPO_MIRROR=https://repo.jenkins-ci.org/incrementals -ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.1.2/jenkins-plugin-manager-2.1.2.jar +ARG PLUGIN_CLI_URL=https://github.com/jenkinsci/plugin-installation-manager-tool/releases/download/2.2.0/jenkins-plugin-manager-2.2.0.jar RUN curl.exe -fsSL "$env:PLUGIN_CLI_URL" -o C:/ProgramData/Jenkins/jenkins-plugin-manager.jar # for main web interface: