Skip to content

Commit

Permalink
Fix Postcommit Python Arm workflow (#33849)
Browse files Browse the repository at this point in the history
* Fix Postcommit Python Arm workflow

* formatting
  • Loading branch information
akashorabek authored Feb 4, 2025
1 parent b69b703 commit a4d6487
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/beam_PostCommit_Python_Arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ env:
jobs:
beam_PostCommit_Python_Arm:
name: ${{ matrix.job_name }} (${{ matrix.job_phrase }} ${{ matrix.python_version }})
runs-on: [self-hosted, ubuntu-20.04, main]
runs-on: ubuntu-22.04
timeout-minutes: 240
strategy:
fail-fast: false
Expand Down Expand Up @@ -84,6 +84,12 @@ jobs:
run: |
sudo curl -L https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Authenticate on GCP
uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GCP_SA_EMAIL }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: GCloud Docker credential helper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
META_DATA_REFINED_NAME = 'Dicom_io_it_test_refined_data.json'
NUM_INSTANCE = 18
RAND_LEN = 15
SCOPES = ['https://www.googleapis.com/auth/cloud-platform']


def random_string_generator(length):
Expand All @@ -72,7 +73,7 @@ def random_string_generator(length):

def create_dicom_store(project_id, dataset_id, region, dicom_store_id):
# Create a an empty DICOM store
credential, _ = default()
credential, _ = default(SCOPES)
session = requests.AuthorizedSession(credential)
api_endpoint = "{}/projects/{}/locations/{}".format(
HEALTHCARE_BASE_URL, project_id, region)
Expand All @@ -88,7 +89,7 @@ def create_dicom_store(project_id, dataset_id, region, dicom_store_id):

def delete_dicom_store(project_id, dataset_id, region, dicom_store_id):
# Delete an existing DICOM store
credential, _ = default()
credential, _ = default(SCOPES)
session = requests.AuthorizedSession(credential)
api_endpoint = "{}/projects/{}/locations/{}".format(
HEALTHCARE_BASE_URL, project_id, region)
Expand All @@ -108,7 +109,7 @@ def get_gcs_file_http(file_name):
api_endpoint = "{}/b/{}/o/{}?alt=media".format(
GCS_BASE_URL, BUCKET_NAME, file_name)

credential, _ = default()
credential, _ = default(SCOPES)
session = requests.AuthorizedSession(credential)

response = session.get(api_endpoint)
Expand Down Expand Up @@ -209,8 +210,10 @@ def test_dicom_store_instance_from_gcs(self):
results, equal_to(expected_output), label='store first assert')

# Check the metadata using client
credential, _ = default(SCOPES)
result, status_code = DicomApiHttpClient().qido_search(
self.project, REGION, DATA_SET_ID, self.temp_dicom_store, 'instances'
self.project, REGION, DATA_SET_ID,
self.temp_dicom_store, 'instances', credential=credential
)

self.assertEqual(status_code, 200)
Expand Down

0 comments on commit a4d6487

Please sign in to comment.