-
Notifications
You must be signed in to change notification settings - Fork 815
179 lines (158 loc) · 6.13 KB
/
docker-nightly.yml
File metadata and controls
179 lines (158 loc) · 6.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Nightly Docker Build & Publish
# Note: This GHA workflow is unique in that it's not for PRs. Solr's *non*-PR CI workflows are
# handled by Jenkins, but ASF's Jenkins is not equipped to build a multi-platform Docker image.
on:
schedule:
# Run daily at 2 AM UTC
- cron: '0 2 * * *'
workflow_dispatch:
# Allow manual triggering
jobs:
build-and-publish:
name: Build and publish Docker images
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# main branch - Gradle on JDK21, Docker images with JRE25
- branch: main
version: 11.0.0-SNAPSHOT
gradle-jdk: 21
dist: full
base-image: eclipse-temurin:25-jre-jammy
tag-suffix: ''
- branch: main
version: 11.0.0-SNAPSHOT
gradle-jdk: 21
dist: slim
base-image: eclipse-temurin:25-jre-jammy
tag-suffix: ''
# branch_10x - Gradle on JDK21, Docker images with JRE21 (default) and JRE25
- branch: branch_10x
version: 10.1.0-SNAPSHOT
gradle-jdk: 21
dist: full
base-image: eclipse-temurin:21-jre-jammy
tag-suffix: ''
- branch: branch_10x
version: 10.1.0-SNAPSHOT
gradle-jdk: 21
dist: slim
base-image: eclipse-temurin:21-jre-jammy
tag-suffix: ''
- branch: branch_10x
version: 10.1.0-SNAPSHOT
gradle-jdk: 21
dist: full
base-image: eclipse-temurin:25-jre-jammy
tag-suffix: '-java25'
# branch_10_0 - Gradle on JDK21, Docker images with JRE21 (default) and JRE25
- branch: branch_10_0
version: 10.0.0-SNAPSHOT
gradle-jdk: 21
dist: full
base-image: eclipse-temurin:21-jre-jammy
tag-suffix: ''
- branch: branch_10_0
version: 10.0.0-SNAPSHOT
gradle-jdk: 21
dist: slim
base-image: eclipse-temurin:21-jre-jammy
tag-suffix: ''
- branch: branch_10_0
version: 10.0.0-SNAPSHOT
gradle-jdk: 21
dist: full
base-image: eclipse-temurin:25-jre-jammy
tag-suffix: '-java25'
# branch_9x - Gradle on JDK17, Docker images with JRE17 (default) and JRE21
- branch: branch_9x
version: 9.11.0-SNAPSHOT
gradle-jdk: 17
dist: full
base-image: eclipse-temurin:17-jre-jammy
tag-suffix: ''
- branch: branch_9x
version: 9.11.0-SNAPSHOT
gradle-jdk: 17
dist: slim
base-image: eclipse-temurin:17-jre-jammy
tag-suffix: ''
- branch: branch_9x
version: 9.11.0-SNAPSHOT
gradle-jdk: 17
dist: full
base-image: eclipse-temurin:21-jre-jammy
tag-suffix: '-java21'
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.SOLR_DEVELOCITY_ACCESS_KEY }}
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
ref: ${{ matrix.branch }}
- name: Set up Java (JDK ${{ matrix.gradle-jdk }})
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: ${{ matrix.gradle-jdk }}
java-package: jdk
- name: Cache gradle-wrapper.jar
uses: actions/cache@v5
with:
path: gradle/wrapper/gradle-wrapper.jar
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.jar.sha256') }}
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v5
with:
develocity-token-expiry: 8
- name: Create custom gradle.properties
run: |
cat > gradle.properties << 'EOF'
# Disable Gradle daemon for all builds.
org.gradle.daemon=false
# Lucene specific settings for lucene2 build nodes
systemProp.file.encoding=UTF-8
org.gradle.jvmargs=-Xmx2g -XX:ReservedCodeCacheSize=256m -XX:TieredStopAtLevel=1 -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options="-Xmx4096M" -XX:+UseParallelGC -XX:ActiveProcessorCount=1 \
--add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
org.gradle.workers.max=4
tests.jvms=4
tests.multiplier=2
# Temporary workaround while Gradle files are updated to fix a bug in how generated files are (or aren't) optimized
production=true
EOF
- name: Set up QEMU for multi-platform builds
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker tag name
id: tag
run: |
if [ "${{ matrix.dist }}" = "slim" ]; then
echo "tag=${{ matrix.version }}-slim${{ matrix.tag-suffix }}" >> $GITHUB_OUTPUT
else
echo "tag=${{ matrix.version }}${{ matrix.tag-suffix }}" >> $GITHUB_OUTPUT
fi
- name: Test and publish Docker image
run: |
./gradlew testDocker dockerPush \
-Psolr.docker.imageRepo=apache/solr-nightly \
-Psolr.docker.imageTag=${{ steps.tag.outputs.tag }} \
-Psolr.docker.dist=${{ matrix.dist }} \
-Psolr.docker.platform=linux/arm64,linux/amd64 \
-Psolr.docker.baseImage=${{ matrix.base-image }}
- name: Report status
if: failure()
run: |
echo "::error::Failed to build and publish Docker image for ${{ matrix.branch }} (${{ matrix.dist }}, base-image: ${{ matrix.base-image }})"