Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add OPA support #573

Merged
merged 22 commits into from
Feb 11, 2025
Merged

feat: Add OPA support #573

merged 22 commits into from
Feb 11, 2025

Conversation

siegfriedweber
Copy link
Member

@siegfriedweber siegfriedweber commented Jan 17, 2025

Description

part of #446

Add OPA support

  • Extend the Airflow clusterConfig with OPA authorization
  • Implement an integration test for OPA
  • Document the OPA integration

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes

Author

Preview Give feedback

Reviewer

Preview Give feedback

Acceptance

Preview Give feedback

@siegfriedweber siegfriedweber marked this pull request as ready for review January 30, 2025 11:27
@siegfriedweber siegfriedweber requested a review from a team January 30, 2025 11:31
@sbernauer sbernauer requested a review from razvan February 10, 2025 08:10
@razvan
Copy link
Member

razvan commented Feb 10, 2025

This PR it's self looks good as is and the tests work with Airflow 2.10.4.

Unfortunately there is an incompatibility with Airflow 2.9.x images:

[2025-02-10T13:30:30.952+0000] {cli_parser.py:78} WARNING - Authentication manager is not configured and webserver will not be able to start.                                                                          
[2025-02-10T13:30:30.953+0000] {cli_parser.py:81} ERROR - The object could not be loaded. Please check "auth_manager" key in "core" section. Current value: "opa_auth_manager.opa_fab_auth_manager.OpaFabAuthManager". 
Traceback (most recent call last):                                                                                                                                                                                     
  File "/stackable/app/lib64/python3.9/site-packages/airflow/configuration.py", line 1214, in getimport                                                                                                                
    return import_string(full_qualified_path)                                                                                                                                                                          
  File "/stackable/app/lib64/python3.9/site-packages/airflow/utils/module_loading.py", line 39, in import_string                                                                                                       
    module = import_module(module_path)                                                                                                                                                                                
  File "/usr/lib64/python3.9/importlib/__init__.py", line 127, in import_module                                                                                                                                        
    return _bootstrap._gcd_import(name[level:], package, level)                                                                                                                                                        
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import                                                                                                                                                      
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load                                                                                                                                                   
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked                                                                                                                                           
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked                                                                                                                                                    
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module                                                                                                                                              
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed                                                                                                                                         
  File "/stackable/app/lib64/python3.9/site-packages/opa_auth_manager/opa_fab_auth_manager.py", line 21, in <module>                                                                                                   
    from typing import override                                                                                                                                                                                        
ImportError: cannot import name 'override' from 'typing' (/usr/lib64/python3.9/typing.py)                                                                                                                              

I will wait with the approval until the 2.9 images are updated.

razvan
razvan previously approved these changes Feb 11, 2025
Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider this a win:

--- FAIL: kuttl (5087.26s)
    --- FAIL: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-insecure-tls_openshift-false_executor-celery (366.39s)
        --- PASS: kuttl/harness/opa_airflow-2.10.2_opa-latest-0.67.1_openshift-false (224.79s)
        --- FAIL: kuttl/harness/logging_airflow-2.10.2_openshift-false_executor-kubernetes (581.15s)
        --- PASS: kuttl/harness/logging_airflow-2.10.2_openshift-false_executor-celery (312.79s)
        --- PASS: kuttl/harness/orphaned-resources_airflow-latest-2.10.2_openshift-false (212.39s)
        --- PASS: kuttl/harness/overrides_airflow-latest-2.10.2_openshift-false (246.64s)
        --- PASS: kuttl/harness/mount-dags-gitsync_airflow-latest-2.10.2_openshift-false_executor-kubernetes (259.02s)
        --- PASS: kuttl/harness/mount-dags-gitsync_airflow-latest-2.10.2_openshift-false_executor-celery (272.32s)
        --- PASS: kuttl/harness/smoke_airflow-2.10.2_openshift-false_executor-kubernetes (228.87s)
        --- PASS: kuttl/harness/smoke_airflow-2.10.2_openshift-false_executor-celery (250.84s)
        --- PASS: kuttl/harness/cluster-operation_airflow-latest-2.10.2_openshift-false (270.83s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-no-tls_openshift-false_executor-kubernetes (192.61s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-server-verification-tls_openshift-false_executor-celery (225.76s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-no-tls_openshift-false_executor-celery (238.66s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-insecure-tls_openshift-false_executor-kubernetes (200.72s)
        --- PASS: kuttl/harness/ldap_airflow-latest-2.10.2_ldap-authentication-server-verification-tls_openshift-false_executor-kubernetes (201.16s)
        --- PASS: kuttl/harness/mount-dags-configmap_airflow-latest-2.10.2_openshift-false_executor-kubernetes (153.32s)
        --- PASS: kuttl/harness/mount-dags-configmap_airflow-latest-2.10.2_openshift-false_executor-celery (200.66s)
        --- PASS: kuttl/harness/oidc_airflow-2.10.2_openshift-false (247.67s)
        --- PASS: kuttl/harness/resources_airflow-latest-2.10.2_openshift-false (199.85s)
FAIL
ERROR:root:kuttl failed

Copy link
Member

@razvan razvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@siegfriedweber siegfriedweber added this pull request to the merge queue Feb 11, 2025
Merged via the queue into main with commit 2e24a41 Feb 11, 2025
17 checks passed
@siegfriedweber siegfriedweber deleted the feat/opa branch February 11, 2025 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Development: Done
Development

Successfully merging this pull request may close these issues.

2 participants