-
Notifications
You must be signed in to change notification settings - Fork 16.8k
Add Apache Airflow Provider Registry #62261
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
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a3dfa84
Add Apache Airflow Provider Registry
kaxil f90f1ca
Fix registry Eleventy build: move frontmatter to line 1 of .njk templ…
kaxil 1cd7881
Add backfill support and fix version dropdown for registry
kaxil 3049a1a
Update version banner dynamically and fix publish-versions latest fal…
kaxil e282d67
Add incremental per-provider registry builds
kaxil 9ab5026
Add registry/AGENTS.md so standards are followed by other contributors
kaxil 694920e
Fix phantom class names in registry metadata extraction
kaxil 32d9eba
Add tests for build_global_inheritance_map and cache base class lookup
kaxil b8cd6f7
Move provider logos from registry to providers/ directories
kaxil 47c8778
Refactor extract_connections.py to use ProvidersManager
kaxil 0ac41bd
Use Sphinx objects.inv for docs URL resolution in extract_metadata.py
kaxil 498f02a
Document relationship between extract_metadata.py and provider YAML v…
kaxil b327277
Add runtime class discovery to extract_parameters.py (--discover flag)
kaxil 4ea1775
Add runtime_modules.json and output/ to dev/registry .gitignore
kaxil 6448eee
Replace AST class parsing with runtime discovery for modules.json
kaxil 9555a8d
Rebase fixes
kaxil 6471567
Fix registry preview links for backfilled provider versions
kaxil 9ef263f
Fix registry parameter extraction for task decorators
kaxil a38a865
Fix homepage popular providers ranking
kaxil File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,232 @@ | ||
| # 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. | ||
| # | ||
| --- | ||
| name: Build & Publish Registry | ||
| on: # yamllint disable-line rule:truthy | ||
| workflow_dispatch: | ||
| inputs: | ||
| destination: | ||
| description: "Publish to live or staging S3 bucket" | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - staging | ||
| - live | ||
| default: staging | ||
| provider: | ||
| description: "Provider ID(s) for incremental build (space-separated, empty = full build)" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| workflow_call: | ||
| inputs: | ||
| destination: | ||
| description: "Publish to live or staging S3 bucket" | ||
| required: false | ||
| type: string | ||
| default: staging | ||
| provider: | ||
| description: "Provider ID(s) for incremental build (space-separated, empty = full build)" | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| secrets: | ||
| DOCS_AWS_ACCESS_KEY_ID: | ||
| required: true | ||
| DOCS_AWS_SECRET_ACCESS_KEY: | ||
| required: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| build-and-publish-registry: | ||
| timeout-minutes: 30 | ||
| name: "Build & Publish Registry" | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| id-token: write | ||
| if: > | ||
| github.event_name == 'workflow_call' || | ||
| contains(fromJSON('[ | ||
| "ashb", | ||
| "bugraoz93", | ||
| "eladkal", | ||
| "ephraimbuddy", | ||
| "jedcunningham", | ||
| "jscheffl", | ||
| "kaxil", | ||
| "pierrejeambrun", | ||
| "shahar1", | ||
| "potiuk", | ||
| "utkarsharma2", | ||
| "vincbeck" | ||
| ]'), github.event.sender.login) | ||
kaxil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: "Checkout repository" | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| # --- Breeze setup --- | ||
| # All three extraction scripts run inside breeze so that | ||
| # extract_parameters.py and extract_connections.py can import provider | ||
| # classes at runtime. extract_metadata.py also runs in breeze for | ||
| # consistency — it writes to dev/registry/ (mounted) so the other two | ||
| # scripts can read providers.json / modules.json from there. | ||
| - name: "Install Breeze" | ||
| uses: ./.github/actions/breeze | ||
| with: | ||
| python-version: "3.12" | ||
|
|
||
| - name: "Build CI image" | ||
| # Fallback to raw docker buildx when breeze cache is stale — same | ||
| # pattern as publish-docs-to-s3.yml. | ||
| run: > | ||
| breeze ci-image build --python 3.12 || | ||
| docker buildx build --load --builder default --progress=auto --pull | ||
| --build-arg AIRFLOW_EXTRAS=devel-ci --build-arg AIRFLOW_PRE_CACHED_PIP_PACKAGES=false | ||
| --build-arg AIRFLOW_USE_UV=true --build-arg BUILD_PROGRESS=auto | ||
| --build-arg INSTALL_MYSQL_CLIENT_TYPE=mariadb | ||
| --build-arg VERSION_SUFFIX_FOR_PYPI=dev0 | ||
| -t ghcr.io/apache/airflow/main/ci/python3.12:latest --target main . | ||
| -f Dockerfile.ci --platform linux/amd64 | ||
|
|
||
| - name: "Install AWS CLI v2" | ||
| run: | | ||
| curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip | ||
| unzip -q /tmp/awscliv2.zip -d /tmp | ||
| rm /tmp/awscliv2.zip | ||
| sudo /tmp/aws/install --update | ||
| rm -rf /tmp/aws/ | ||
|
|
||
| - name: "Configure AWS credentials" | ||
| uses: aws-actions/configure-aws-credentials@010d0da01d0b5a38af31e9c3470dbfdabdecca3a # v4.0.1 | ||
| with: | ||
| aws-access-key-id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }} | ||
| aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }} | ||
| aws-region: us-east-2 | ||
kaxil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: "Determine S3 destination" | ||
| id: destination | ||
| env: | ||
| DESTINATION: ${{ inputs.destination || 'staging' }} | ||
| run: | | ||
| if [[ "${DESTINATION}" == "live" ]]; then | ||
| echo "bucket=s3://live-docs-airflow-apache-org/registry/" >> "${GITHUB_OUTPUT}" | ||
| else | ||
| echo "bucket=s3://staging-docs-airflow-apache-org/registry/" >> "${GITHUB_OUTPUT}" | ||
| fi | ||
| echo "Publishing registry to ${DESTINATION}" | ||
|
|
||
| # --- Incremental: download existing data from S3 --- | ||
| - name: "Download existing registry data from S3" | ||
| id: download-existing | ||
| if: inputs.provider != '' | ||
| env: | ||
| S3_BUCKET: ${{ steps.destination.outputs.bucket }} | ||
| run: | | ||
| mkdir -p /tmp/existing-registry | ||
| PROVIDERS_URL="${S3_BUCKET}api/providers.json" | ||
| MODULES_URL="${S3_BUCKET}api/modules.json" | ||
| if aws s3 cp "${PROVIDERS_URL}" /tmp/existing-registry/providers.json 2>/dev/null; then | ||
| echo "found=true" >> "${GITHUB_OUTPUT}" | ||
| aws s3 cp "${MODULES_URL}" /tmp/existing-registry/modules.json || true | ||
| else | ||
| echo "found=false" >> "${GITHUB_OUTPUT}" | ||
| echo "No existing registry data on S3" | ||
| fi | ||
|
|
||
| # --- Extract provider metadata --- | ||
| - name: "Extract registry data (breeze)" | ||
| env: | ||
| PROVIDER: ${{ inputs.provider }} | ||
| run: | | ||
| if [[ -n "${PROVIDER}" ]]; then | ||
| breeze registry extract-data --python 3.12 --provider "${PROVIDER}" | ||
| else | ||
| breeze registry extract-data --python 3.12 | ||
| fi | ||
|
|
||
| # --- Incremental: merge new data with existing --- | ||
| - name: "Merge with existing registry data" | ||
| if: inputs.provider != '' && steps.download-existing.outputs.found == 'true' | ||
| run: | | ||
| uv run dev/registry/merge_registry_data.py \ | ||
| --existing-providers /tmp/existing-registry/providers.json \ | ||
| --existing-modules /tmp/existing-registry/modules.json \ | ||
| --new-providers dev/registry/providers.json \ | ||
| --new-modules dev/registry/modules.json \ | ||
| --output dev/registry/ | ||
kaxil marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: "Copy breeze output to registry data" | ||
| run: | | ||
| mkdir -p registry/src/_data/versions | ||
| cp dev/registry/providers.json registry/src/_data/providers.json | ||
| cp dev/registry/modules.json registry/src/_data/modules.json | ||
| if [ -d dev/registry/output/versions ]; then | ||
| cp -r dev/registry/output/versions/* registry/src/_data/versions/ | ||
| fi | ||
| # Copy provider logos extracted from providers/*/docs/integration-logos/ | ||
| if [ -d dev/registry/logos ]; then | ||
| mkdir -p registry/public/logos | ||
| cp -r dev/registry/logos/* registry/public/logos/ | ||
| fi | ||
|
|
||
| - name: "Setup pnpm" | ||
| uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # v4.0.0 | ||
| with: | ||
| version: 9 | ||
|
|
||
| - name: "Setup Node.js" | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 | ||
| with: | ||
| node-version: 20 | ||
| cache: 'pnpm' | ||
| cache-dependency-path: 'registry/pnpm-lock.yaml' | ||
|
|
||
| - name: "Install Node.js dependencies" | ||
| working-directory: registry | ||
| run: pnpm install --frozen-lockfile | ||
|
|
||
| - name: "Build registry site" | ||
| working-directory: registry | ||
| env: | ||
| REGISTRY_PATH_PREFIX: "/registry/" | ||
| run: pnpm build | ||
|
|
||
| - name: "Upload registry artifact" | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: registry-site | ||
| path: registry/_site | ||
| retention-days: 7 | ||
| if-no-files-found: error | ||
|
|
||
| - name: "Sync registry to S3" | ||
| env: | ||
| S3_BUCKET: ${{ steps.destination.outputs.bucket }} | ||
| run: | | ||
| aws s3 sync registry/_site/ "${S3_BUCKET}" \ | ||
| --cache-control "public, max-age=300" | ||
|
|
||
| - name: "Publish version metadata" | ||
| env: | ||
| S3_BUCKET: ${{ steps.destination.outputs.bucket }} | ||
| run: breeze registry publish-versions --s3-bucket "${S3_BUCKET}" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| # 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. | ||
| # | ||
| --- | ||
| name: Registry Tests | ||
| on: # yamllint disable-line rule:truthy | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - 'dev/registry/**' | ||
| - 'registry/**' | ||
| - 'providers/*/provider.yaml' | ||
| - 'providers/*/*/provider.yaml' | ||
| - '.github/workflows/registry-tests.yml' | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - 'dev/registry/**' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: registry-tests-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| registry-tests: | ||
| name: "Registry extraction tests" | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - name: "Checkout repository" | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: "Setup Python" | ||
| uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | ||
| with: | ||
| python-version: "3.12" # 3.11+ required for stdlib tomllib | ||
|
|
||
| - name: "Install uv" | ||
| run: python -m pip install uv | ||
|
|
||
| - name: "Install test dependencies" | ||
| run: uv pip install --system pytest pyyaml | ||
|
|
||
| - name: "Run registry extraction tests" | ||
| run: pytest dev/registry/tests/ -v -o "addopts=" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.