astronomer / astro-cli

CLI that makes it easy to create, test and deploy Airflow DAGs to Astronomer
https://www.astronomer.io
Other
350 stars 70 forks source link

Include active hibernation override info in deployment metadata #1597

Closed feluelle closed 6 months ago

feluelle commented 6 months ago

Description

Describe the purpose of this pull request.

🎟 Issue(s)

closes: #1575

πŸ§ͺ Functional Testing

List the functional testing steps to confirm this feature or fix.

πŸ“Έ Screenshots

Add screenshots to illustrate the validity of these changes.

For a deployment with override defined:

❯ ./astro deployment inspect cltwui4j6009401nwoqev94g7
deployment:
    configuration:
        name: create hosted dedicated
        description: desc
        runtime_version: 10.5.0
        dag_deploy_enabled: true
        ci_cd_enforcement: false
        scheduler_size: SMALL
        is_high_availability: false
        is_development_mode: true
        executor: CELERY
        scheduler_count: 1
        cluster_name: Sample AWS Cluster
        workspace_name: Sample Workspace 1
        deployment_type: DEDICATED
        cloud_provider: AWS
        region: ap-northeast-1
        default_task_pod_cpu: "0.25"
        default_task_pod_memory: 0.5Gi
        resource_quota_cpu: "2"
        resource_quota_memory: 4Gi
        workload_identity: ""
    worker_queues:
        - name: default
          max_worker_count: 4
          min_worker_count: 0
          worker_concurrency: 6
          worker_type: A10
    metadata:
        deployment_id: cltwui4j6009401nwoqev94g7
        workspace_id: cltwu72pz0198f7hgnnal41us
        cluster_id: cltwu71tx0004eehg6gnt39pc
        release_name: N/A
        airflow_version: 2.8.3
        current_tag: 10.5.0
        status: CREATING
        created_at: 2024-03-18T11:11:25.634Z
        updated_at: 2024-03-18T11:12:48.325Z
        deployment_url: cloud.astronomer-dev.io/cltwu72pz0198f7hgnnal41us/deployments/cltwui4j6009401nwoqev94g7/overview
        webserver_url: sampleorgpr19854-pr19854.astronomer-dev.run/dqev94g7?orgId=org_LL0XyTELYJS9ZOE0
        hibernation_override:
            is_hibernating: true
            override_until: 2100-01-01T00:00:00Z

For a deployment without override defined:

❯ ./astro deployment inspect cltwui4j6009401nwoqev94g7
deployment:
    configuration:
        name: create hosted dedicated
        description: desc
        runtime_version: 10.5.0
        dag_deploy_enabled: true
        ci_cd_enforcement: false
        scheduler_size: SMALL
        is_high_availability: false
        is_development_mode: true
        executor: CELERY
        scheduler_count: 1
        cluster_name: Sample AWS Cluster
        workspace_name: Sample Workspace 1
        deployment_type: DEDICATED
        cloud_provider: AWS
        region: ap-northeast-1
        default_task_pod_cpu: "0.25"
        default_task_pod_memory: 0.5Gi
        resource_quota_cpu: "2"
        resource_quota_memory: 4Gi
        workload_identity: ""
    worker_queues:
        - name: default
          max_worker_count: 4
          min_worker_count: 0
          worker_concurrency: 6
          worker_type: A10
    metadata:
        deployment_id: cltwui4j6009401nwoqev94g7
        workspace_id: cltwu72pz0198f7hgnnal41us
        cluster_id: cltwu71tx0004eehg6gnt39pc
        release_name: N/A
        airflow_version: 2.8.3
        current_tag: 10.5.0
        status: CREATING
        created_at: 2024-03-18T11:11:25.634Z
        updated_at: 2024-03-18T11:28:25.717Z
        deployment_url: cloud.astronomer-dev.io/cltwu72pz0198f7hgnnal41us/deployments/cltwui4j6009401nwoqev94g7/overview
        webserver_url: sampleorgpr19854-pr19854.astronomer-dev.run/dqev94g7?orgId=org_LL0XyTELYJS9ZOE0

πŸ“‹ Checklist

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.55%. Comparing base (847b57d) to head (ba98af8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1597 +/- ## ======================================= Coverage 86.55% 86.55% ======================================= Files 114 114 Lines 15935 15940 +5 ======================================= + Hits 13792 13797 +5 Misses 1288 1288 Partials 855 855 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kushalmalani commented 6 months ago

@feluelle Is this good to merge?

feluelle commented 6 months ago

I will manually test this to be sure.

feluelle commented 6 months ago

I have found an issue on the core platform API side which holds me back from e2e testing it. The isHibernating field is missing from deployment response hibernation override field in platform API for some reason. I will look into that on Monday.

feluelle commented 6 months ago

Works as expected. I have added the tests to the PR description. @kushalmalani feel free to merge.