Skip to content

Commit

Permalink
wait before submitting any workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
nikellepetrillo committed Dec 4, 2024
1 parent a8568d4 commit 50897cf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/test_illumina_genotyping_array.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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"
Expand Down
30 changes: 15 additions & 15 deletions scripts/firecloud_api/firecloud_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
"""
Expand Down

0 comments on commit 50897cf

Please sign in to comment.