Skip to content

Commit a57872f

Browse files
authored
Fix Docker authentication for Python ValidatesContainer Dataflow With RC tests (#36718)
* Added Docker authentication * removed the Docker auth step from the workflow
1 parent 99a0979 commit a57872f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

.github/workflows/beam_PostCommit_Python_ValidatesContainer_Dataflow_With_RC.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ jobs:
8181
with:
8282
java-version: default
8383
python-version: ${{ matrix.python_version }}
84+
- name: Authenticate to GCP
85+
uses: google-github-actions/auth@v3
86+
with:
87+
service_account: ${{ secrets.GCP_SA_EMAIL }}
88+
credentials_json: ${{ secrets.GCP_SA_KEY }}
89+
- name: Set up Cloud SDK
90+
uses: google-github-actions/setup-gcloud@v3
8491
- name: Set PY_VER_CLEAN
8592
id: set_py_ver_clean
8693
run: |

sdks/python/container/run_validatescontainer.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ echo ">>> Successfully built and push container $CONTAINER"
134134
cd sdks/python
135135
SDK_LOCATION=$2
136136

137+
echo ">>> Configuring Docker authentication for GCR"
138+
gcloud --quiet auth configure-docker us.gcr.io
139+
gcloud --quiet auth configure-docker gcr.io
140+
gcloud auth print-access-token | docker login -u oauth2accesstoken --password-stdin https://us.gcr.io
141+
137142
echo ">>> RUNNING DATAFLOW RUNNER VALIDATESCONTAINER TEST"
138143
pytest -o log_cli=True -o log_level=Info -o junit_suite_name=$IMAGE_NAME \
139144
-m=it_validatescontainer \

0 commit comments

Comments
 (0)