From 50897cfe851920188b8479a596bc954c6164ce5b Mon Sep 17 00:00:00 2001 From: npetrill Date: Wed, 4 Dec 2024 13:18:47 -0500 Subject: [PATCH] wait before submitting any workflows --- .../test_illumina_genotyping_array.yml | 15 ++++++---- scripts/firecloud_api/firecloud_api.py | 30 +++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test_illumina_genotyping_array.yml b/.github/workflows/test_illumina_genotyping_array.yml index 5b993b87a2..9a9e878e7f 100644 --- a/.github/workflows/test_illumina_genotyping_array.yml +++ b/.github/workflows/test_illumina_genotyping_array.yml @@ -106,6 +106,11 @@ jobs: # Use the testType provided by the user echo "testType=${{ github.event.inputs.testType }}" >> $GITHUB_ENV + - name: Delay before submitting workflows + run: | + echo "Waiting for 5 minutes before submitting workflows..." + sleep 300 # 300 seconds = 5 minutes + - name: Submit job, poll status, and get outputs id: pipeline_run run: | @@ -188,11 +193,11 @@ jobs: MAX_RETRIES=2 RETRY_DELAY=300 # 300 seconds = 5 minutes - while true; do - echo "Refreshing token..." - TOKEN=$(gcloud auth print-access-token) - sleep 3000 # sleep for 50 minutes - done & + #while true; do + # echo "Refreshing token..." + # TOKEN=$(gcloud auth print-access-token) + # sleep 3000 # sleep for 50 minutes + #done & for input_file in "$INPUTS_DIR"/*.json; do echo "Processing input file: $input_file" diff --git a/scripts/firecloud_api/firecloud_api.py b/scripts/firecloud_api/firecloud_api.py index f01c784129..9961af4e10 100644 --- a/scripts/firecloud_api/firecloud_api.py +++ b/scripts/firecloud_api/firecloud_api.py @@ -64,21 +64,21 @@ def get_workflow_outputs(self, submission_id, workflow_id, pipeline_name): print(f"Failed to retrieve workflow outputs. Status code: {response.status_code}") return None, None - def refresh_token(self): - """ - Refreshes the API token using gcloud's application default credentials. - :return: The new token as a string - """ - try: - # Execute the gcloud command to get the new access token - result = subprocess.run( - ["gcloud", "auth", "application-default", "print-access-token"], - capture_output=True, text=True, check=True - ) - return result.stdout.strip() # Return the new token - except subprocess.CalledProcessError as e: - print(f"Error refreshing token: {e.stderr}", file=sys.stderr) - return None + #def refresh_token(self): + # """ + # Refreshes the API token using gcloud's application default credentials. + # :return: The new token as a string + # """ + # try: + # # Execute the gcloud command to get the new access token + # result = subprocess.run( + # ["gcloud", "auth", "application-default", "print-access-token"], + # capture_output=True, text=True, check=True + # ) + # return result.stdout.strip() # Return the new token + # except subprocess.CalledProcessError as e: + # print(f"Error refreshing token: {e.stderr}", file=sys.stderr) + # return None def create_submission(self, submission_data): """