Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Postcommit Python Arm workflow #33849

Merged
merged 2 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading