Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 55d6ca2

Browse files
author
Kyle Weaver
committed
Add --region to more Python tests and examples.
1 parent 3da5a71 commit 55d6ca2

25 files changed

Lines changed: 35 additions & 0 deletions

release/src/main/python-release/python_release_automation_utils.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ RC_STAGING_URL="https://dist.apache.org/repos/dist/dev/beam/$VERSION/python"
325325

326326
# Cloud Configurations
327327
PROJECT_ID='apache-beam-testing'
328+
REGION_ID='us-central1'
328329
BUCKET_NAME='temp-storage-for-release-validation-tests/nightly-snapshot-validation'
329330
TEMP_DIR='/tmp'
330331
DATASET='beam_postrelease_mobile_gaming'

release/src/main/python-release/run_release_candidate_python_mobile_gaming.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ function verify_userscore_dataflow() {
8080
output_file_name="$USERSCORE_OUTPUT_PREFIX-dataflow-runner.txt"
8181
python -m apache_beam.examples.complete.game.user_score \
8282
--project=$PROJECT_ID \
83+
--region=$REGION_ID \
8384
--runner=DataflowRunner \
8485
--temp_location=gs://$BUCKET_NAME/temp/ \
8586
--sdk_location=$BEAM_PYTHON_SDK \
@@ -121,6 +122,7 @@ function verify_hourlyteamscore_dataflow() {
121122
print_separator "Running HourlyTeamScore example with DataflowRunner"
122123
python -m apache_beam.examples.complete.game.hourly_team_score \
123124
--project=$PROJECT_ID \
125+
--region=$REGION_ID \
124126
--dataset=$DATASET \
125127
--runner=DataflowRunner \
126128
--temp_location=gs://$BUCKET_NAME/temp/ \

release/src/main/python-release/run_release_candidate_python_quickstart.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ function verify_wordcount_dataflow() {
116116
--runner DataflowRunner \
117117
--job_name wordcount \
118118
--project $PROJECT_ID \
119+
--region $REGION_ID \
119120
--num_workers $NUM_WORKERS \
120121
--sdk_location $BEAM_PYTHON_SDK
121122

@@ -177,6 +178,7 @@ function verify_streaming_wordcount_dataflow() {
177178
--streaming \
178179
--job_name pyflow-wordstream-candidate \
179180
--project $PROJECT_ID \
181+
--region $REGION_ID \
180182
--runner DataflowRunner \
181183
--input_topic projects/$PROJECT_ID/topics/$PUBSUB_TOPIC1 \
182184
--output_topic projects/$PROJECT_ID/topics/$PUBSUB_TOPIC2 \

release/src/main/scripts/run_rc_validation.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ if [[ -z `which gcloud` ]]; then
140140

141141
gcloud init
142142
gcloud config set project ${USER_GCP_PROJECT}
143+
gcloud config set compute/region ${USER_GCP_REGION}
143144

144145
echo "-----------------Setting Up Service Account-----------------"
145146
if [[ ! -z "${USER_SERVICE_ACCOUNT_EMAIL}" ]]; then
@@ -468,6 +469,7 @@ if [[ ("$python_leaderboard_direct" = true \
468469
. ${LOCAL_BEAM_DIR}/beam_env_${py_version}/bin/activate
469470
python -m apache_beam.examples.complete.game.leader_board \
470471
--project=${USER_GCP_PROJECT} \
472+
--region=${USER_GCP_REGION} \
471473
--topic projects/${USER_GCP_PROJECT}/topics/${SHARED_PUBSUB_TOPIC} \
472474
--dataset ${LEADERBOARD_DF_DATASET} \
473475
--runner DataflowRunner \
@@ -542,6 +544,7 @@ if [[ ("$python_leaderboard_direct" = true \
542544
. ${LOCAL_BEAM_DIR}/beam_env_${py_version}/bin/activate
543545
python -m apache_beam.examples.complete.game.game_stats \
544546
--project=${USER_GCP_PROJECT} \
547+
--region=${USER_GCP_REGION} \
545548
--topic projects/${USER_GCP_PROJECT}/topics/${SHARED_PUBSUB_TOPIC} \
546549
--dataset ${GAMESTATS_DF_DATASET} \
547550
--runner DataflowRunner \

release/src/main/scripts/script.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ RC_VALIDATE_CONFIGS=(
3131
REPO_URL
3232
INSTALL_GCLOUD
3333
USER_GCP_PROJECT
34+
USER_GCP_REGION
3435
USER_GCS_BUCKET
3536
USER_SERVICE_ACCOUNT_EMAIL
3637
INSTALL_HUB
@@ -90,6 +91,11 @@ INSTALL_GCLOUD=true
9091
# e.g. apache-beam-testing
9192
USER_GCP_PROJECT=
9293

94+
# GCP region id
95+
# Required for running pipeline with DataflowRunner for validation.
96+
# e.g. us-central1
97+
USER_GCP_REGION=
98+
9399
# GCS bucket name
94100
# Required for running pipeline with DataflowRunner for validation.
95101
# e.g. gs://bucket-name (please include 'gs://' prefix)

sdks/python/apache_beam/examples/complete/game/game_stats.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
# DataflowRunner
6565
python game_stats.py \
6666
--project $PROJECT_ID \
67+
--region $REGION_ID \
6768
--topic projects/$PROJECT_ID/topics/$PUBSUB_TOPIC \
6869
--dataset $BIGQUERY_DATASET \
6970
--runner DataflowRunner \

sdks/python/apache_beam/examples/complete/game/game_stats_it_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
python setup.py nosetests --test-pipeline-options=" \
2424
--runner=TestDataflowRunner \
2525
--project=... \
26+
--region=... \
2627
--staging_location=gs://... \
2728
--temp_location=gs://... \
2829
--output=gs://... \

sdks/python/apache_beam/examples/complete/game/hourly_team_score.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
# DataflowRunner
6060
python hourly_team_score.py \
6161
--project $PROJECT_ID \
62+
--region $REGION_ID \
6263
--dataset $BIGQUERY_DATASET \
6364
--runner DataflowRunner \
6465
--temp_location gs://$BUCKET/user_score/temp

sdks/python/apache_beam/examples/complete/game/hourly_team_score_it_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
python setup.py nosetests --test-pipeline-options=" \
2424
--runner=TestDataflowRunner \
2525
--project=... \
26+
--region=... \
2627
--staging_location=gs://... \
2728
--temp_location=gs://... \
2829
--output=gs://... \

sdks/python/apache_beam/examples/complete/game/leader_board.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
# DataflowRunner
7373
python leader_board.py \
7474
--project $PROJECT_ID \
75+
--region $REGION_ID \
7576
--topic projects/$PROJECT_ID/topics/$PUBSUB_TOPIC \
7677
--dataset $BIGQUERY_DATASET \
7778
--runner DataflowRunner \

0 commit comments

Comments
 (0)