Skip to content
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

Upgrade Jenkins to 2.361.1-lts #113

Merged
merged 9 commits into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions cli/scb-cli.scala
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,8 @@ case class ProjectInfo(id: String, params: BuildParameters, summary: BuildSummar

val excluded =
for
JArray(excluded) <- params.config.map(parse(_) \ "projects" \ "exclude").toSeq
JString(entry) <- excluded
case JArray(excluded) <- params.config.map(parse(_) \ "projects" \ "exclude").toSeq
case JString(entry) <- excluded
yield entry
baseTargets.diff(excluded)
}
Expand Down Expand Up @@ -270,8 +270,8 @@ object BuildInfo:
)
val json = parse(r.data.toString)
for {
JArray(ids) <- (json \ "actions" \ "causes" \ "upstreamBuild").toOption
JInt(id) <- ids.headOption
case JArray(ids) <- (json \ "actions" \ "causes" \ "upstreamBuild").toOption
case JInt(id) <- ids.headOption
} yield id.toString
}.orElse {
println("No upstream project defined")
Expand Down Expand Up @@ -322,9 +322,9 @@ object BuildInfo:
val buildPlanJson = os.read(coordinatorDir / "data" / "buildPlan.json")
parse(buildPlanJson)

val JArray(buildPlan) = prepareBuildPlan()
val JArray(buildPlan) = prepareBuildPlan(): @unchecked
val projects = for
JArray(buildStage) <- buildPlan.take(1) // There should be only 1 stage
case JArray(buildStage) <- buildPlan.take(1) // There should be only 1 stage
project <- buildStage.take(1) // There should be only 1 project
// Config is an object, though be default would be decoded to None when we expect Option[String]
// We don't care about its content so we treat it as opaque string value
Expand Down Expand Up @@ -379,14 +379,14 @@ object BuildSummary:
else
try {
for
JArray(projects) <- parse(
case JArray(projects) <- parse(
// Might contain quoted strings
r.data.toString.replaceAll(""""reasons": \[.*\]""", """"reasons": []""")
)
project <- projects
JString(artifactName) <- project \ "module"
BuildResult(compile) <- project \ "compile" \ "status"
BuildResult(testCompile) <- project \ "test-compile" \ "status"
case JString(artifactName) <- project \ "module"
case BuildResult(compile) <- project \ "compile" \ "status"
case BuildResult(testCompile) <- project \ "test-compile" \ "status"
yield BuildProjectSummary(
artifactName = artifactName,
results = ProjectTargetResults(
Expand Down Expand Up @@ -457,10 +457,10 @@ object BuildParameters:
requests.get(s"$jobApi/json?tree=actions[parameters[*]]")
val json = parse(r.data.toString)
val params = for {
JArray(params) <- json \ "actions" \ "parameters"
JObject(param) <- params
JField("name", JString(name)) <- param
JField("value", JString(value)) <- param
case JArray(params) <- json \ "actions" \ "parameters"
case JObject(param) <- params
case JField("name", JString(name)) <- param
case JField("value", JString(value)) <- param
} yield name -> value
fromJenkinsParams(params.toMap)

Expand Down
19 changes: 9 additions & 10 deletions env/prod/config/filtered-projects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ percontmx:cfdi:.*
simy4:xpath-to-xml:.*
stryker-mutator:mutation-testing-elements:.*
tlsomers:scala-suspendable:.*
virtuoso:opensource:.*
openlink:virtuoso-opensource:.*

# Moved to cats repo since 2.3
typelevel:algebra.*:2.2.*
Expand All @@ -38,6 +38,7 @@ sbt:.*:2.0.0-alpha.*
dataoperandz:cassper:.*
jvican:dijon:.*
mdedetrich:scalajson:.*
playframework:playframework:.*

# The same git info between multiple projects, leading to multiple missing ids
tulz-app:.*:.*
Expand All @@ -61,8 +62,13 @@ sciss:scalainterpreterpane:.*
sciss:span:.*
sciss:swingplus:.*

## Incorrect source cross-version directory
virtuslab:scala-cli:.*
## Uses mill-tpolecat - it does fails to parse RC versions
joan38:kubernetes-client:.*
carlosedp:riscvassembler:.*

## Publishing artifact leads to failurs in downstream projects
### Publishes only pom, no artifacts
msgpack4z:msgpack4z-native:.*

## Does not compile
arturopala:gitignore:.*
Expand Down Expand Up @@ -125,13 +131,6 @@ primetalk:typed-ontology:.*
vigoo:zio-aws:.*
zio:zio-aws:.*

# Cannot build scaladoc in Scala 3
scalatest:scalatestplus-easymock:.*
scalatest:scalatestplus-jmock:.*
scalatest:scalatestplus-junit:.*
scalatest:scalatestplus-mockito:.*
scalatest:scalatestplus-scalacheck:.*
scalatest:scalatestplus-selenium:.*

# Depends on not published lib with CrossVersion.full
## wartremover
Expand Down
3 changes: 3 additions & 0 deletions env/prod/config/projects-config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ davenverse_fuuid{
"""set doobie/Test/unmanagedSources/excludeFilter ~= {_ || "PostgresInstanceSpec.scala" || "PostgresTraversalSpec.scala"} """
]
}
danslapman_morphling{
projects.exclude = [morphling-circe] // Needs update due to source compatible change
}
davenverse_rediculous.tests = compile-only
davenverse_rediculous-concurrent.tests = compile-only
davenverse_whale-tail.tests = compile-only
Expand Down
15 changes: 7 additions & 8 deletions env/prod/config/replaced-projects.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
#milessabin/shapeless typelevel/shapeless-3
#playframework/play-json dotty-staging/play-json
#playframework/playframework dotty-staging/play-json
#scodec/scodec dotty-staging/scodec main
#scala/scala-swing scala/scala-swing v3.0.0#3.0.0
#scala/nanotest-strawman scala/nanotest-strawman main
#spray/spray spray/spray-json v1.3.6-3.1.0
#typelevel/simulacrum-scalafix typelevel/simulacrum-scalafix master
scala/scala-swing scala/scala-swing v3.0.0#3.0.0
scala/nanotest-strawman scala/nanotest-strawman main
spray/spray spray/spray-json v1.3.6-3.1.0
typelevel/simulacrum-scalafix typelevel/simulacrum-scalafix master

# https://github.com/lampepfl/dotty/issues/14804
tpolecat/doobie WojciechMazur/doobie fix/3.1.1-compat
Expand All @@ -28,3 +24,6 @@ sbt/sbinary sbt/sbinary master

#1.2.9
outr/perfolation outr/perfolation master

#1.0.0
eed3si9n/verify eed3si9n/verify main
3 changes: 3 additions & 0 deletions jenkins/seeds/buildCommunityProject.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def retryOnBuildFailureMsg = "Enforcing retry of the build after failure."

pipeline {
agent none
options {
timeout(time: 8, unit: 'HOURS') // timeout on whole pipeline job including queueing in k8s within the stage and execution
}
stages {
stage("Initialize build") {
agent none
Expand Down
17 changes: 10 additions & 7 deletions jenkins/seeds/initializeSeedJobs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,16 @@ pipelineJob('/runBuildWeekly') {
}
}
}
}
triggers {
cron('''
// # Run full build every Friday at 8 PM
TZ=Europe/Warsaw
H 20 * * 5
''')
pipelineTriggers{
triggers {
cron{
spec('''
# Run full build every Friday at 8 PM UTC
H 20 * * 5
''')
}
}
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion jenkins/seeds/runBuildWeekly.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

def runBuildJobName = "/runBuild"
def compilerVersion
def buildName

pipeline {
agent { label "default" }
Expand All @@ -11,6 +12,7 @@ pipeline {
script {
compilerVersion = latestNightlyVersion()
currentBuild.setDescription(compilerVersion)
buildName = "${compilerVersion}_weekly-${currentBuild.number}"
}
}
}
Expand All @@ -20,8 +22,9 @@ pipeline {
runBuildJobRef = build(
job: runBuildJobName,
parameters: [
string(name: "buildName", value: buildName)
string(name: "publishedScalaVersion", value: compilerVersion),
string(name: "minStarsCount", value: "0"),
string(name: "minStarsCount", value: "-1"),
string(name: "maxProjectsCount", value: "-1") // unlimited
]
)
Expand Down
2 changes: 1 addition & 1 deletion k8s/jenkins-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ operator:
replicaCount: 1

# image is the name (and tag) of the Carthago Operator for Jenkins image
image: carthago.azurecr.io/carthago-op-jenkins:0.17.0
image: carthago.azurecr.io/carthago-op-jenkins:0.18.1

# imagePullPolicy defines policy for pulling images
imagePullPolicy: IfNotPresent
Expand Down
74 changes: 20 additions & 54 deletions k8s/jenkins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jenkins:
sidecars: []
jenkinsController:
name: jenkins-controller
image: jenkins/jenkins:2.332.3-lts
image: jenkins/jenkins:2.361.1-lts
imagePullPolicy: IfNotPresent
command: []
livenessProbe: {}
Expand Down Expand Up @@ -126,62 +126,26 @@ jenkins:
# - name: jacoco
# version: "3.1.1"
plugins:
- name: blueocean
version: "1.25.5"
- name: timestamper
version: "1.18"
- name: ansicolor
version: "1.0.1"
- name: parameter-separator
version: "1.3"
version: "1.0.2"
- name: blueocean
version: "1.25.8"
- name: copyartifact
version: "1.46.4"
- name: github-oauth
version: "0.39"
- name: matrix-auth
version: "3.1.3"
- name: git
version: "4.11.5"
- name: git-client
version: "3.11.0"
version: "3.11.2"
- name: github
version: "1.34.3"
- name: git
version: "4.11.3"
- name: kubernetes
version: "3651.v908e7db_10d06"
- name: kubernetes-client-api
version: "5.12.2-193.v26a_6078f65a_9"
- name: workflow-api
version: "1164.v760c223ddb_32"
- name: workflow-aggregator
version: "581.v0c46fa_697ffd"
- name: workflow-cps
version: "2725.v7b_c717eb_12ce"
- name: workflow-job
version: "1189.va_d37a_e9e4eda_"
- name: workflow-durable-task-step
version: "1155.v79567b_e0a_2de"
- name: workflow-basic-steps
version: "948.v2c72a_091b_b_68"
- name: workflow-support
version: "820.vd1a_6cc65ef33"
- name: pipeline-model-definition
version: "2.2097.v33db_b_de764b_e"
- name: pipeline-model-api
version: "2.2097.v33db_b_de764b_e"
- name: pipeline-stage-tags-metadata
version: "2.2097.v33db_b_de764b_e"
- name: pipeline-model-extensions
version: "2.2097.v33db_b_de764b_e"
- name: job-dsl
version: "1.79"
- name: junit
version: "1119.1121.vc43d0fc45561"
- name: script-security
version: "1175.v4b_d517d6db_f0"
- name: display-url-api
version: "2.3.6"
- name: parameterized-scheduler
version: "1.1"
version: "1.35.0"
- name: parameter-separator
version: "1.3"
- name: timestamper
version: "1.20"

# roles define a list of extra RBAC roles for the Jenkins Master pod service account
roles: []
Expand Down Expand Up @@ -250,7 +214,9 @@ jenkinsGroovyScripts:

# data is inline Groovy script
data: |
System.out.println("Starting Groovy scripts execution")
// Set Kubernetes cloud config, cannot use casc, since it would override operator config
import jenkins.model.Jenkins
def instance = Jenkins.getInstanceOrNull()
def k8s = instance?.getCloud("kubernetes")
k8s?.setMaxRequestsPerHost(128) // default 32
Expand All @@ -261,9 +227,8 @@ jenkinsGroovyScripts:
// The directory has to be copied because of lack of write permissions in it
def oldLibPath="/var/jenkins_home/common-lib"
def newLibPath="/var/jenkins_home/scripts-repo"
def logFile=new java.io.File("/var/lib/jenkins/gitInit.log")

new ProcessBuilder(['bash', '-c', """
def initResult = new ProcessBuilder(['bash', '-c', """
rm -rf $newLibPath && \
cp -rL $oldLibPath $newLibPath && \
cd $newLibPath && \
Expand All @@ -273,10 +238,11 @@ jenkinsGroovyScripts:
git add --all && \
git commit -m "init"
"""] as String[])
.redirectErrorStream(true)
.inheritIO()
.start()
.waitFor()
.redirectErrorStream(true)
.inheritIO()
.start()
.waitFor()
System.out.println("Git repo init exit code: $initResult")

# secretRef is secret reference which allows to inject the secrets into Groovy script code
#secretRef:
Expand Down
2 changes: 1 addition & 1 deletion k8s/mvn-repo-data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ spec:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storage: 30Gi