Skip to content

Commit

Permalink
Optimize deployment workflow (#1137)
Browse files Browse the repository at this point in the history
*github-actions
    * reduce the wait time to 30 minutes for providers-integration-tests-on-KE if providers-integration-tests is not deployed.
         * We currently wait for 2 hours 30 minutes even when providers-integration-tests is not deployed
the reason for the additional 2 hours is for waiting providers-integration-tests
   *merge wait for deployment and trigger master dag job into the same job but different step
        * Split them into the different job will need to waste additional resources on spinning up another runner
and there's no good reason to do so as of now
  • Loading branch information
Lee-W authored May 24, 2023
1 parent 3c99745 commit c5ab6a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 23 deletions.
29 changes: 14 additions & 15 deletions .github/workflows/deploy-integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
astronomer_key_secret: ${{ secrets.PROVIDER_INTEGRATION_TESTS_ASTRONOMER_KEY_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

wait-for-providers-integration-tests-to-be-ready:
wait-for-deployment-to-be-ready-and-trigger-master-dag-for-providers-integration-tests:
if: github.event_name == 'schedule'
needs: deploy-to-providers-integration-tests
runs-on: 'ubuntu-20.04'
Expand All @@ -48,11 +48,6 @@ jobs:
echo "allowing the deployed image to be updated across all Airflow components.."
sleep 1800
trigger-providers-integration-tests-master-dag:
if: github.event_name == 'schedule'
needs: wait-for-providers-integration-tests-to-be-ready
runs-on: 'ubuntu-20.04'
steps:
- name: checkout
uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -81,23 +76,27 @@ jobs:
astronomer_key_secret: ${{ secrets.PROVIDER_INTEGRATION_TESTS_ON_KE_ASTRONOMER_KEY_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

wait-for-providers-integration-tests-on-KE-to-be-ready:
wait-for-deployment-to-be-ready-and-trigger-master-dag-for-providers-integration-tests-on-KE:
if: github.event_name == 'schedule'
needs: deploy-to-providers-integration-tests-on-KE
runs-on: 'ubuntu-20.04'
steps:
- name: Sleep for 2 hours 30 minutes
- name: Sleep and wait for the deployment to be ready
run: |
if [ "${{ inputs.environment_to_deploy }}" == "providers-integration-tests-on-KE" ]; then
# This means that only KE deployment was triggered
# and hence we do not need to wait for CE deployment's master DAG to complete.
# We just need to wait for 30 minutes for the deployment to be reflected.
sleep_time=1800
else
# 3 hours
sleep_time=10800
fi
echo "Current timestamp is" `date`
echo "Sleeping for 9000 seconds (2 hours 30 minutes)"
echo "Sleeping for $sleep_time seconds"
echo "allowing the deployed image to be updated across all Airflow components.."
sleep 9000
sleep $sleep_time
trigger-providers-integration-tests-on-KE-master-dag:
if: github.event_name == 'schedule'
needs: wait-for-providers-integration-tests-on-KE-to-be-ready
runs-on: 'ubuntu-20.04'
steps:
- name: checkout
uses: actions/checkout@v3
with:
Expand Down
9 changes: 1 addition & 8 deletions .github/workflows/test-rc-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ jobs:
astronomer_key_secret: ${{ secrets.PROVIDER_INTEGRATION_TESTS_ASTRONOMER_KEY_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

wait-for-deployment-to-be-ready:
wait-for-deployment-to-be-ready-and-trigger-master-dag:
needs: deploy-rc-testing-branch-to-astro-cloud
if: |
always() &&
Expand All @@ -134,13 +134,6 @@ jobs:
echo "allowing the deployed image to be updated across all Airflow components.."
sleep 1800
trigger-master-dag:
needs: wait-for-deployment-to-be-ready
if: |
always() &&
needs.wait-for-deployment-to-be-ready.result == 'success'
runs-on: 'ubuntu-20.04'
steps:
- name: checkout
uses: actions/checkout@v3
with:
Expand Down

0 comments on commit c5ab6a7

Please sign in to comment.