Skip to content

Commit b2e00ef

Browse files
authored
Various release script fixes (#27548)
* Various release script fixes * Remove Release_Gradle_Build job from release verification * Fix publish docker image script to work with remotely built images * Change empty file to .json to make RAT_PreCommit happy * Set base branch to the release branch for build snapshot PR * Bump pubsub signal wait for pipeline start to 8 min in integration tests * Change message head from Warning to Level for PubsubInjector as it follows by an exit(1) * Fix Pylint
1 parent 6152a70 commit b2e00ef

14 files changed

Lines changed: 34 additions & 79 deletions

File tree

.github/workflows/cut_release_branch.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
fi
148148
done
149149
150-
cat /tmp/result | sort | uniq | grep -i -E 'precommit|postcommit|validates|vr|example|test|gradle build' | grep -v -i -E 'load|perf|website' >> release/src/main/scripts/jenkins_jobs.txt
150+
cat /tmp/result | sort | uniq | grep -i -E 'precommit|postcommit|validates|vr|example|test' | grep -v -i -E 'load|perf|website' >> release/src/main/scripts/jenkins_jobs.txt
151151
env:
152152
JENKINS_USERNAME: ${{ github.event.inputs.JENKINS_USERNAME }}
153153
JENKINS_TOKEN: ${{ github.event.inputs.JENKINS_TOKEN }}
@@ -175,6 +175,7 @@ jobs:
175175
REMOTE_NAME: remote_repo
176176
REMOTE_URL: ${{ github.server_url }}/${{ github.repository }}
177177
BRANCH_NAME: snapshot_build-${{ github.event.inputs.RELEASE_VERSION }}
178+
RELEASE_BRANCH: release-${{ github.event.inputs.RELEASE_VERSION }}
178179
steps:
179180
- name: Install Hub
180181
run: |
@@ -192,15 +193,15 @@ jobs:
192193
run: |
193194
git remote add ${REMOTE_NAME} ${REMOTE_URL}
194195
git checkout -b ${BRANCH_NAME}
195-
touch empty_file.txt
196+
touch empty_file.json
196197
git add -A
197198
git commit -m "Add empty file in order to create PR"
198199
git push -f ${REMOTE_NAME}
199200
- name: Create Pull Request
200201
env:
201202
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
202203
run: |
203-
hub pull-request -F- <<<"[DO NOT MERGE]Start snapshot build for release process
204+
hub pull-request -b apache:${RELEASE_BRANCH} -F- <<<"[DO NOT MERGE]Start snapshot build for release process
204205
205206
206207
Run Gradle Publish"

.github/workflows/run_rc_validation.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ jobs:
9292
- name: Create Pull Request
9393
run: |
9494
git checkout -b ${{env.WORKING_BRANCH}} ${{ env.RC_TAG }} --quiet
95-
touch empty_file.txt
96-
git add empty_file.txt
95+
touch empty_file.json
96+
git add empty_file.json
9797
git commit -m "Add empty file in order to create PR" --quiet
9898
git push origin ${{env.WORKING_BRANCH}} --quiet
9999
GITHUB_PR_URL=$(gh pr create -B ${{env.RELEASE_BRANCH}} -H ${{env.WORKING_BRANCH}} -t"[DO NOT MERGE] Run Python RC Validation Tests" -b "PR to run Python ReleaseCandidate Jenkins Job.")

.test-infra/jenkins/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,6 @@ Beam Jenkins overview page: [link](https://ci-beam.apache.org/)
295295
| beam_Publish_Beam_SDK_Snapshots | [cron](https://ci-beam.apache.org/job/beam_Publish_Beam_SDK_Snapshots/)| N/A | [![Build Status](https://ci-beam.apache.org/job/beam_Publish_Beam_SDK_Snapshots/badge/icon)](https://ci-beam.apache.org/job/beam_Publish_Beam_SDK_Snapshots/) |
296296
| beam_Publish_Docker_Snapshots | [cron](https://ci-beam.apache.org/job/beam_Publish_Docker_Snapshots/)| N/A | [![Build Status](https://ci-beam.apache.org/job/beam_Publish_Docker_Snapshots/badge/icon)](https://ci-beam.apache.org/job/beam_Publish_Docker_Snapshots/) |
297297
| beam_PostRelease_Python_Candidate | [cron](https://ci-beam.apache.org/job/beam_PostRelease_Python_Candidate/)| `Run Python ReleaseCandidate` | [![Build Status](https://ci-beam.apache.org/job/beam_PostRelease_Python_Candidate/badge/icon)](https://ci-beam.apache.org/job/beam_PostRelease_Python_Candidate/) |
298-
| beam_Release_Gradle_Build | [cron](https://ci-beam.apache.org/job/beam_Release_Gradle_Build/) | `Run Release Gradle Build` | [![Build Status](https://ci-beam.apache.org/job/beam_Release_Gradle_Build/badge/icon)](https://ci-beam.apache.org/job/beam_Release_Gradle_Build/)
299298

300299
### Notes:
301300

.test-infra/jenkins/job_Release_Gradle_Build.groovy

Lines changed: 0 additions & 49 deletions
This file was deleted.

examples/java/src/main/java/org/apache/beam/examples/complete/game/injector/InjectorUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public static Pubsub getClient(final HttpTransport httpTransport, final JsonFact
4747
}
4848
if (credential.getClientAuthentication() != null) {
4949
System.out.println(
50-
"\n***Warning! You are not using service account credentials to "
50+
"\n***Error! You are not using service account credentials to "
5151
+ "authenticate.\nYou need to use service account credentials for this example,"
5252
+ "\nsince user-level credentials do not have enough pubsub quota,\nand so you will run "
5353
+ "out of PubSub quota very quickly.\nSee "

release/src/main/scripts/jenkins_jobs.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ Run Python_Transforms PreCommit,beam_PreCommit_Python_Transforms_Phrase
139139
Run Python_Xlang_Gcp_Dataflow PostCommit,beam_PostCommit_Python_Xlang_Gcp_Dataflow_PR
140140
Run Python_Xlang_Gcp_Direct PostCommit,beam_PostCommit_Python_Xlang_Gcp_Direct_PR
141141
Run RAT PreCommit,beam_PreCommit_RAT_Phrase
142-
Run Release Gradle Build,beam_Release_Gradle_Build
143142
Run SQL PostCommit,beam_PostCommit_SQL_PR
144143
Run SQL PreCommit,beam_PreCommit_SQL_Phrase
145144
Run SQL_Java11 PreCommit,beam_PreCommit_SQL_Java11_Phrase

release/src/main/scripts/publish_docker_images.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,27 @@ echo "Which release candidate will be the source of final docker images? (ex: 1)
3737
read RC_NUM
3838
RC_VERSION="rc${RC_NUM}"
3939

40-
echo "================Confirming Release and RC version==========="
40+
echo "================Pull RC Containers from DockerHub==========="
41+
IMAGES=$(docker search ${DOCKER_IMAGE_DEFAULT_REPO_ROOT}/${DOCKER_IMAGE_DEFAULT_REPO_PREFIX} --format "{{.Name}}" --limit 100)
42+
KNOWN_IMAGES=()
4143
echo "We are using ${RC_VERSION} to push docker images for ${RELEASE}."
44+
while read IMAGE; do
45+
# Try pull verified RC from dockerhub.
46+
if docker pull "${IMAGE}:${RELEASE}${RC_VERSION}" 2>/dev/null ; then
47+
KNOWN_IMAGES+=( $IMAGE )
48+
fi
49+
done < <(echo "${IMAGES}")
50+
51+
echo "================Confirming Release and RC version==========="
4252
echo "Publishing the following images:"
43-
IMAGES=$(docker images --filter "reference=apache/beam_*:${RELEASE}${RC_VERSION}" --format "{{.Repository}}")
44-
echo "${IMAGES}"
53+
# Sort by name for easy examination
54+
IFS=$'\n' KNOWN_IMAGES=($(sort <<<"${KNOWN_IMAGES[*]}"))
55+
unset IFS
56+
printf "%s\n" ${KNOWN_IMAGES[@]}
4557
echo "Do you want to proceed? [y|N]"
4658
read confirmation
4759
if [[ $confirmation = "y" ]]; then
48-
echo "${IMAGES}" | while read IMAGE; do
49-
# Pull verified RC from dockerhub.
50-
docker pull "${IMAGE}:${RELEASE}${RC_VERSION}"
51-
60+
for IMAGE in "${KNOWN_IMAGES[@]}"; do
5261
# Tag with ${RELEASE} and push to dockerhub.
5362
docker tag "${IMAGE}:${RELEASE}${RC_VERSION}" "${IMAGE}:${RELEASE}"
5463
docker push "${IMAGE}:${RELEASE}"
@@ -58,4 +67,4 @@ if [[ $confirmation = "y" ]]; then
5867
docker push "${IMAGE}:latest"
5968
done
6069

61-
fi
70+
fi

release/src/main/scripts/run_rc_validation.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ echo "This task will create a PR against apache/beam, trigger a jenkins job to r
271271
echo "1. Python quickstart validations(batch & streaming)"
272272
echo "2. Python MobileGame validations(UserScore, HourlyTeamScore)"
273273
if [[ "$python_quickstart_mobile_game" = true && ! -z `which hub` ]]; then
274-
touch empty_file.txt
275-
git add empty_file.txt
274+
touch empty_file.json
275+
git add empty_file.json
276276
git commit -m "Add empty file in order to create PR" --quiet
277277
git push -f ${GITHUB_USERNAME} --quiet
278278
# Create a test PR

release/src/main/scripts/verify_release_build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ hub version
125125

126126

127127
echo ""
128-
echo "==================== 3 Run Gradle Release Build & PostCommit Tests on Jenkins ==================="
129-
echo "[Current Task] Run Gradle release build and all PostCommit Tests against Release Branch on Jenkins."
128+
echo "==================== 3 Run PostCommit Tests on Jenkins ==================="
129+
echo "[Current Task] Run all PostCommit Tests against Release Branch on Jenkins."
130130
echo "This task will create a PR against apache/beam."
131131
echo "After PR created, you need to comment phrases listed in description in the created PR:"
132132

sdks/java/io/google-cloud-platform/src/test/java/org/apache/beam/sdk/io/gcp/healthcare/FhirIOReadIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public void testFhirIORead() throws Exception {
133133
"waitForAnyMessage", signal.signalSuccessWhen(resources.getCoder(), anyResources -> true));
134134
// wait for any resource
135135

136-
Supplier<Void> start = signal.waitForStart(Duration.standardMinutes(5));
136+
Supplier<Void> start = signal.waitForStart(Duration.standardMinutes(8));
137137
pipeline.apply(signal.signalStart());
138138
PipelineResult job = pipeline.run();
139139
start.get();

0 commit comments

Comments
 (0)