You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2023/09/01 09:57:47 UTC

[GitHub] [airflow] Lee-W opened a new pull request, #34002: test(providers/microsfot): add system test for AzureContainerVolumeHo…

Lee-W opened a new pull request, #34002:
URL: https://github.com/apache/airflow/pull/34002

   During my work on https://github.com/apache/airflow/pull/33825 and https://github.com/apache/airflow/pull/33822, I discovered that there are no system tests for AzureContainerVolumeHook and AzureContainerRegistryHook. Is there any setup I need to do for these tests, or are they sufficient as is?
   
   <!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may not use this file except in compliance
    with the License.  You may obtain a copy of the License at
   
      http://www.apache.org/licenses/LICENSE-2.0
   
    Unless required by applicable law or agreed to in writing,
    software distributed under the License is distributed on an
    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    KIND, either express or implied.  See the License for the
    specific language governing permissions and limitations
    under the License.
    -->
   
   <!--
   Thank you for contributing! Please make sure that your code changes
   are covered with tests. And in case of new features or big changes
   remember to adjust the documentation.
   
   Feel free to ping committers for the review!
   
   In case of an existing issue, reference it using one of the following:
   
   closes: #ISSUE
   related: #ISSUE
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   
   
   <!-- Please keep an empty line above the dashes. -->
   ---
   **^ Add meaningful description above**
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code changes, an Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvement+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in a newsfragment file, named `{pr_number}.significant.rst` or `{issue_number}.significant.rst`, in [newsfragments](https://github.com/apache/airflow/tree/main/newsfragments).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on a diff in pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #34002:
URL: https://github.com/apache/airflow/pull/34002#discussion_r1314533210


##########
tests/system/providers/microsoft/azure/example_azure_container_instances.py:
##########
@@ -52,7 +55,39 @@
         task_id="start_container",
     )
 
+    t2 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image=f"{CONTAINER_REGISTRY_SERVER}:hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[],
+        memory_in_gb=4.0,
+        cpu=1.0,
+        task_id="start_container_with_custom_container_registry",
+    )
 
+    t3 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image="hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[
+            AzureContainerVolumeHook().get_file_volume(
+                mount_name="mountname",
+                share_name=AZURE_VOLUME_SHARE_NAME,
+                storage_account_name=AZURE_STORAGE_ACOOUNT,
+            )
+        ],

Review Comment:
   Got it. Thanks for helping out. Let me turn this to draft and work on that first.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #34002:
URL: https://github.com/apache/airflow/pull/34002#issuecomment-1704741684

   > > During my work on #33825 and #33822, I discovered that there are no system tests for AzureContainerVolumeHook and AzureContainerRegistryHook. Is there any setup I need to do for these tests, or are they sufficient as is?
   > 
   > I guess Azure peopls are missing-in-action so you are on your own :). Generally you should be able to run those example_dags with real Azure account.
   
   Yep, these example_dags are good with our Azure account. But I thought these tests would be run on the main branch so there would be some connection setup needed. Or do I misunderstand the system tests?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #34002:
URL: https://github.com/apache/airflow/pull/34002#issuecomment-1705654015

   > Yep, these example_dags are good with our Azure account. But I thought these tests would be run on the main branch so there would be some connection setup needed. Or do I misunderstand the system tests?
   
   Nope. System tests are run by:
   
   a) individual contributors who have account to connect to the 3rd-party cloud (if they choose to)
   b) our stakeholders who take care of them (Amazon currently, Google in progress). What we have access to is the system test dashboard they provide (Amazon: https://aws-mwaa.github.io/open-source/system-tests/dashboard.html )  which we can review when releasing
   
   This is all part of I think one of the latest AIP we have [AIP-4](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=93324355)  later extended bu [AIP-47](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-47+New+design+of+Airflow+System+Tests)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk merged pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk merged PR #34002:
URL: https://github.com/apache/airflow/pull/34002


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Taragolis commented on a diff in pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #34002:
URL: https://github.com/apache/airflow/pull/34002#discussion_r1314315301


##########
tests/system/providers/microsoft/azure/example_azure_container_instances.py:
##########
@@ -52,7 +55,39 @@
         task_id="start_container",
     )
 
+    t2 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image=f"{CONTAINER_REGISTRY_SERVER}:hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[],
+        memory_in_gb=4.0,
+        cpu=1.0,
+        task_id="start_container_with_custom_container_registry",
+    )
 
+    t3 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image="hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[
+            AzureContainerVolumeHook().get_file_volume(
+                mount_name="mountname",
+                share_name=AZURE_VOLUME_SHARE_NAME,
+                storage_account_name=AZURE_STORAGE_ACOOUNT,
+            )
+        ],

Review Comment:
   This one spawn DB connection during DAG parsing that the reason why test failed.
   
   In general for this cases better use taskflow operator which returns required value, however volumes are not templated fields, so maybe better make it templated first.
   
   Some samples from other providers
   
   https://github.com/apache/airflow/blob/6ef80e8be178e0ab8d119270a28b23d0bf47ed62/tests/system/providers/amazon/aws/example_batch.py#L60-L83
   
   https://github.com/apache/airflow/blob/d2c0bbebacd1c58d357d647707a1bdb0c5b3b425/tests/system/providers/amazon/aws/example_ec2.py#L42-L60
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on PR #34002:
URL: https://github.com/apache/airflow/pull/34002#issuecomment-1706325897

   > > Yep, these example_dags are good with our Azure account. But I thought these tests would be run on the main branch so there would be some connection setup needed. Or do I misunderstand the system tests?
   > 
   > Nope. System tests are run by:
   > 
   > a) individual contributors who have account to connect to the 3rd-party cloud (if they choose to) b) our stakeholders who take care of them (Amazon currently, Google in progress). What we have access to is the system test dashboard they provide (Amazon: https://aws-mwaa.github.io/open-source/system-tests/dashboard.html ) which we can review when releasing
   > 
   > This is all part of I think one of the latest AIP we have [AIP-4](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=93324355) later extended bu [AIP-47](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-47+New+design+of+Airflow+System+Tests)
   
   Got it. Thanks for the detailed illustration!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] potiuk commented on pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "potiuk (via GitHub)" <gi...@apache.org>.
potiuk commented on PR #34002:
URL: https://github.com/apache/airflow/pull/34002#issuecomment-1704398249

   > During my work on #33825 and #33822, I discovered that there are no system tests for AzureContainerVolumeHook and AzureContainerRegistryHook. Is there any setup I need to do for these tests, or are they sufficient as is?
   
   I guess Azure peopls are missing-in-action so you are on your own :). Generally you should be able to run those example_dags with real Azure account.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [airflow] Lee-W commented on a diff in pull request #34002: test(providers/microsfot): add system test for AzureContainerVolumeHook and AzureContainerRegistryHook

Posted by "Lee-W (via GitHub)" <gi...@apache.org>.
Lee-W commented on code in PR #34002:
URL: https://github.com/apache/airflow/pull/34002#discussion_r1314717856


##########
tests/system/providers/microsoft/azure/example_azure_container_instances.py:
##########
@@ -52,7 +55,39 @@
         task_id="start_container",
     )
 
+    t2 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image=f"{CONTAINER_REGISTRY_SERVER}:hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[],
+        memory_in_gb=4.0,
+        cpu=1.0,
+        task_id="start_container_with_custom_container_registry",
+    )
 
+    t3 = AzureContainerInstancesOperator(
+        ci_conn_id="azure_default",
+        registry_conn_id=None,
+        resource_group="resource-group",
+        name="aci-test-{{ ds }}",
+        image="hello-world",
+        region="WestUS2",
+        environment_variables={},
+        volumes=[
+            AzureContainerVolumeHook().get_file_volume(
+                mount_name="mountname",
+                share_name=AZURE_VOLUME_SHARE_NAME,
+                storage_account_name=AZURE_STORAGE_ACOOUNT,
+            )
+        ],

Review Comment:
   I just found out I use `AzureContainerVolumeHook` the wrong way. Just update it with the correct usage



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org