Skip to content

Commit

Permalink
Bring back documentation publishing to Canary builds
Browse files Browse the repository at this point in the history
We are using the same approach as in
apache/airflow-site#1055 where we utilise
/mnt directory to store checked out airflow-site.

This requires to switch back to public runners for canary builds
as public runners have space available in /mnt

Fixes: #41931
  • Loading branch information
potiuk committed Oct 31, 2024
1 parent 06088a3 commit 8170ac6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 15 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/static-checks-mypy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,6 @@ jobs:
timeout-minutes: 150
name: "Publish documentation"
needs: build-docs
# For canary runs we need to push documentation to AWS S3 and preparing it takes a lot of space
# So we should use self-hosted ASF runners for this
runs-on: ${{ fromJSON(inputs.runs-on-as-json-docs-build) }}
env:
GITHUB_REPOSITORY: ${{ github.repository }}
Expand All @@ -248,9 +246,7 @@ jobs:
INCLUDE_SUCCESS_OUTPUTS: "${{ inputs.include-success-outputs }}"
PYTHON_MAJOR_MINOR_VERSION: "${{ inputs.default-python-version }}"
VERBOSE: "true"
# Temporary disabled it until self-hosted ASF runners will be working again
if: false
# if: inputs.canary-run == 'true' && inputs.branch == 'main'
if: inputs.canary-run == 'true' && inputs.branch == 'main'
steps:
- name: "Cleanup repo"
shell: bash
Expand All @@ -266,16 +262,22 @@ jobs:
with:
name: airflow-docs
path: './docs/_build'
- name: Check disk space available
run: df -h
- name: Create /mnt/airflow-site directory
run: sudo mkdir -p /mnt/airflow-site && sudo chown -R "${USER}" /mnt/airflow-site
- name: "Clone airflow-site"
run: >
git clone https://github.com/apache/airflow-site.git ${GITHUB_WORKSPACE}/airflow-site &&
echo "AIRFLOW_SITE_DIRECTORY=${GITHUB_WORKSPACE}/airflow-site" >> "$GITHUB_ENV"
git clone https://github.com/apache/airflow-site.git /mnt/airflow-site/airflow-site &&
echo "AIRFLOW_SITE_DIRECTORY=/mnt/airflow-site/airflow-site" >> "$GITHUB_ENV"
- name: "Prepare breeze & CI image: ${{ inputs.default-python-version }}:${{ inputs.image-tag }}"
uses: ./.github/actions/prepare_breeze_and_image
- name: "Publish docs"
run: >
breeze release-management publish-docs --override-versioned --run-in-parallel
${{ inputs.docs-list-as-string }}
- name: Check disk space available
run: df -h
- name: "Generate back references for providers"
run: breeze release-management add-back-references all-providers
- name: "Generate back references for apache-airflow"
Expand All @@ -302,3 +304,4 @@ jobs:
- name: "Upload documentation to AWS S3"
if: inputs.branch == 'main'
run: aws s3 sync --delete ./docs/_build s3://apache-airflow-docs
working-directory: /mnt/airflow-site/airflow-site
9 changes: 5 additions & 4 deletions dev/breeze/src/airflow_breeze/utils/selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1228,10 +1228,11 @@ def runs_on_as_json_self_hosted_asf(self) -> str:

@cached_property
def runs_on_as_json_docs_build(self) -> str:
if self._is_canary_run():
return RUNS_ON_SELF_HOSTED_ASF_RUNNER
else:
return RUNS_ON_PUBLIC_RUNNER
# We used to run docs build on self-hosted runners because they had more space, but
# It turned out that public runners have a lot of space in /mnt folder that we can utilise
# but in the future we might want to switch back to self-hosted runners so we have this
# separate property to determine that and place to implement different logic if needed
return RUNS_ON_PUBLIC_RUNNER

@cached_property
def runs_on_as_json_public(self) -> str:
Expand Down
5 changes: 1 addition & 4 deletions dev/breeze/tests/test_selective_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1909,11 +1909,8 @@ def test_helm_tests_trigger_ci_build(files: tuple[str, ...], expected_outputs: d
"apache/airflow",
(),
dict(),
# TODO: revert it when we fix self-hosted runners
'["ubuntu-22.04"]',
'["self-hosted", "asf-runner"]',
# '["self-hosted", "Linux", "X64"]',
# TODO: revert it when we fix self-hosted runners
'["ubuntu-22.04"]',
"false",
"false",
# "true",
Expand Down

0 comments on commit 8170ac6

Please sign in to comment.