Skip to content

Commit

Permalink
revert deployment hibernate changes (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro authored Sep 25, 2024
1 parent 09e2a1a commit 1c0c1fe
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 82 deletions.
49 changes: 11 additions & 38 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
deployment: [deployment-hibernate.yaml, deployment.yaml]
deployment: [deployment.yaml]
outputs:
DEPLOYMENT_ID: ${{ steps.create-deployment.outputs.DEPLOYMENT_ID }}
HIBERNATE_DEPLOYMENT_ID: ${{ steps.create-deployment.outputs.HIBERNATE_DEPLOYMENT_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -99,11 +98,7 @@ jobs:
sed -i "s| name:.*| name: deploy-action-e2e-${{ env.test_uid }}|g" e2e-setup/deployment-templates/${{ matrix.deployment }}
DEPLOYMENT_ID=$(astro deployment create --deployment-file e2e-setup/deployment-templates/${{ matrix.deployment }} | yq e '.deployment.metadata.deployment_id' -)
if [[ "${{ matrix.deployment }}" == "deployment.yaml" ]]; then
echo "DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
else
echo "HIBERNATE_DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
fi
echo "DEPLOYMENT_ID=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
# DAG Deploy test would test the DAG only deploy functionality in deploy action
dag-deploy-test:
Expand All @@ -113,10 +108,7 @@ jobs:
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -191,10 +183,7 @@ jobs:
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -274,10 +263,7 @@ jobs:
max-parallel: 1
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
deploy_type: [dags, image-and-dags]
steps:
- name: Checkout code
Expand Down Expand Up @@ -357,14 +343,11 @@ jobs:
no-deploy-test:
name: No Deploy Test
runs-on: ubuntu-latest
needs: [infer-image-deploy, create-test-deployments]
needs: [infer-deploy, create-test-deployments]
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
deploy_type: [infer, dbt, dags, image-and-dags]
steps:
- name: Checkout code
Expand Down Expand Up @@ -464,10 +447,7 @@ jobs:
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -543,10 +523,7 @@ jobs:
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -629,10 +606,7 @@ jobs:
strategy:
matrix:
deployment_id:
[
"${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}",
"${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}",
]
["${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}"]
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down Expand Up @@ -693,7 +667,7 @@ jobs:
uses: ./.github/workflows/e2e/validate_deployment
with:
dag_tarball_version_before: ""
image_version_before: "12.1.0"
image_version_before: "12.1.1"
dag_tarball_version_after: ${{ steps.get-deployment-after-create-preview.outputs.desired_dag_tarball_version }}
image_version_after: ${{ steps.get-deployment-after-create-preview.outputs.desired_image_version }}

Expand Down Expand Up @@ -893,4 +867,3 @@ jobs:
- name: Delete Deployment
run: |
astro deployment delete -f ${{ needs.create-test-deployments.outputs.DEPLOYMENT_ID }}
astro deployment delete -f ${{ needs.create-test-deployments.outputs.HIBERNATE_DEPLOYMENT_ID }}
41 changes: 0 additions & 41 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -433,39 +433,6 @@ runs:
echo ::endgroup::
shell: bash
id: deploy-options
- name: Determine if Development Mode is enabled
run: |
echo ::group::Determine if Development Mode is enabled
if [[ ${{ inputs.action }} != delete-deployment-preview ]]; then
DEPLOYMENT_TYPE=$(astro deployment inspect ${{steps.deployment-preview.outputs.FINAL_DEPLOYMENT_ID}} --clean-output --key configuration.deployment_type)
# only inspect development mode if deployment is not hybrid
if [[ $DEPLOYMENT_TYPE != "HYBRID" ]]; then
DEV_MODE=$(astro deployment inspect ${{steps.deployment-preview.outputs.FINAL_DEPLOYMENT_ID}} --clean-output --key configuration.is_development_mode)
echo "Deployment development mode: $DEV_MODE"
if [[ $DEV_MODE == "" ]]; then
echo "DEVELOPMENT_MODE=false" >> $GITHUB_OUTPUT
else
echo "DEVELOPMENT_MODE=$DEV_MODE" >> $GITHUB_OUTPUT
fi
else
echo "DEVELOPMENT_MODE=false" >> $GITHUB_OUTPUT
fi
else
echo "DEVELOPMENT_MODE=false" >> $GITHUB_OUTPUT
fi
echo ::endgroup::
shell: bash
id: development-mode
- name: Override to wake up the Deployment
if: ${{ inputs.action != 'delete-deployment-preview' && steps.development-mode.outputs.DEVELOPMENT_MODE == 'true' }}
run: |
echo ::group::Override to wake up the Deployment
astro deployment wake-up ${{steps.deployment-preview.outputs.FINAL_DEPLOYMENT_ID}} --force
# Give it some time to wake up
sleep 60
echo ::endgroup::
shell: bash
- name: DAG Deploy to Astro
if: ${{ (inputs.deploy-type == 'dags-only' || inputs.deploy-type == 'infer') && steps.deploy-type.outputs.DAGS_ONLY_DEPLOY == 'true' }}
run: |
Expand Down Expand Up @@ -511,11 +478,3 @@ runs:
fi
echo ::endgroup::
shell: bash
- name: Remove override on Deployment to resume schedule
if: ${{ steps.development-mode.outputs.DEVELOPMENT_MODE == 'true' }}
run: |
echo ::group::Remove override on Deployment to resume schedule
astro deployment wake-up ${{steps.deployment-preview.outputs.FINAL_DEPLOYMENT_ID}} --remove-override --force
echo ::endgroup::
shell: bash
2 changes: 1 addition & 1 deletion e2e-setup/astro-project/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM quay.io/astronomer/astro-runtime:12.1.0
FROM quay.io/astronomer/astro-runtime:12.1.1
2 changes: 1 addition & 1 deletion e2e-setup/deployment-templates/deployment-hibernate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ deployment:
configuration:
name: deploy-action-hibernate-e2e
description: ""
runtime_version: 12.1.0
runtime_version: 12.1.1
dag_deploy_enabled: true
ci_cd_enforcement: false
scheduler_size: SMALL
Expand Down
2 changes: 1 addition & 1 deletion e2e-setup/deployment-templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ deployment:
configuration:
name: deploy-action-non-dev-e2e
description: ""
runtime_version: 12.1.0
runtime_version: 12.1.1
dag_deploy_enabled: true
ci_cd_enforcement: false
scheduler_size: SMALL
Expand Down

0 comments on commit 1c0c1fe

Please sign in to comment.