Skip to content

Commit

Permalink
Move breeze commands to sub-commands (apache#25449)
Browse files Browse the repository at this point in the history
* mOve breeze commands to sub-commands

Originally Python version of Breeze had only a handful of commands,
while moving from Bash, but we are close to completion of the
transition and the number of commands grew quite a lot bringit it
on par to the commands we used to have in the Bash version of Breeze.

However, only a small subset of the commands is actually useful to
average developer, most of the more advanced commands are used in
specific circumstances (release management, configuring Breeze
once or rebuilding the image or even runing non-interactive test
session are rarely used. Therefore it makes much more sense to
surface the common commands as the top-level commands and move
the less frequent commands to subcommands to move them out from
the main help page.

At the same time, the BREEZE.rst documentation got a little messy
during the move and this is the right time to structure it similarly
to breeze commands:

* prerequisites and installation
* first-time configuration
* regular task description
* more advanced tasks grupped in the same subcommands as in Breeze
* diving deeper into details of Breeze implentation for those
  who wish to understand how Breeze works under-the-hood

Aliases for the common commands that users could already get used to
were created, and deprecation warnings are printed in casee those
commands are used (guiding the user to the new commands to use).

Less frequently used options for shell command are still available
in `shell` but they have been removed from the default command to
remove clutter. You can still used them by explicitly specifying
the `shell` commnd.

Configuration for rich click has been separated out from the
command group implementation to separate packages. This allows
for less problems with circular imports - none of the commands
are needed when rich-click configuration is being prepared, which
happens before main `click` command is parsed, which allows to
run imports of the "code" as late as possible.

* Update manage-dags-files.rst
  • Loading branch information
potiuk authored Aug 2, 2022
1 parent 10b198a commit b91fd99
Show file tree
Hide file tree
Showing 122 changed files with 8,255 additions and 7,365 deletions.
36 changes: 19 additions & 17 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
env:
PR_LABELS: "${{ steps.get-latest-pr-labels.outputs.pull-request-labels }}"
COMMIT_REF: "${{ env.TARGET_COMMIT_SHA }}"
run: breeze selective-check
run: breeze ci selective-check
- name: env
run: printenv
env:
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
cache-dependency-path: ./dev/breeze/setup*
- run: ./scripts/ci/install_breeze.sh
- name: "Free space"
run: breeze free-space
run: breeze ci free-space
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
Expand All @@ -238,24 +238,24 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
- name: >-
Build & Push AMD64 CI images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
${{ needs.build-info.outputs.all-python-versions-list-as-string }}
run: breeze build-image --push-image --tag-as-latest --run-in-parallel
run: breeze ci-image build --push --tag-as-latest --run-in-parallel
env:
UPGRADE_TO_NEWER_DEPENDENCIES: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
DOCKER_CACHE: ${{ needs.build-info.outputs.cache-directive }}
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
PYTHON_VERSIONS: ${{ needs.build-info.outputs.all-python-versions-list-as-string }}
- name: Push empty CI image ${{ env.PYTHON_MAJOR_MINOR_VERSION }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}
if: failure() || cancelled()
run: breeze build-image --push-image --empty-image --run-in-parallel
run: breeze ci-image build --push --empty-image --run-in-parallel
env:
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
- name: "Candidates for pip resolver backtrack triggers"
if: failure() || cancelled()
run: >
breeze find-newer-dependencies --max-age 1
breeze ci find-newer-dependencies --max-age 1
--python "${{ needs.build-info.outputs.default-python-version }}"
- name: "Fix ownership"
run: breeze fix-ownership
run: breeze ci fix-ownership
if: always()

build-prod-images:
Expand Down Expand Up @@ -313,7 +313,7 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
cache-dependency-path: ./dev/breeze/setup*
- run: ./scripts/ci/install_breeze.sh
- name: "Free space"
run: breeze free-space
run: breeze ci free-space
- name: Cache pre-commit envs
uses: actions/cache@v3
with:
Expand All @@ -328,7 +328,7 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
- name: >
Pull CI image for PROD build:
${{ needs.build-info.outputs.default-python-version }}:${{ env.IMAGE_TAG_FOR_THE_BUILD }}
run: breeze pull-image --tag-as-latest
run: breeze ci-image pull --tag-as-latest
env:
# Always use default Python version of CI image for preparing packages
PYTHON_MAJOR_MINOR_VERSION: ${{ needs.build-info.outputs.default-python-version }}
Expand All @@ -337,23 +337,25 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
run: rm -fv ./dist/* ./docker-context-files/*
- name: "Prepare providers packages"
run: >
breeze prepare-provider-packages
breeze release-management prepare-provider-packages
--package-list-file ./scripts/ci/installed_providers.txt
--package-format wheel
--version-suffix-for-pypi dev0
if: needs.build-info.outputs.default-branch == 'main'
- name: "Prepare airflow package"
run: breeze prepare-airflow-package --package-format wheel --version-suffix-for-pypi dev0
run: >
breeze release-management prepare-airflow-package
--package-format wheel --version-suffix-for-pypi dev0
- name: "Move dist packages to docker-context files"
run: mv -v ./dist/*.whl ./docker-context-files
- name: >-
Build & Push PROD images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
${{ needs.build-info.outputs.all-python-versions-list-as-string }}
run: >
breeze build-prod-image
breeze prod-image build
--run-in-parallel
--tag-as-latest
--push-image
--push
--install-packages-from-context
env:
UPGRADE_TO_NEWER_DEPENDENCIES: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
Expand All @@ -362,11 +364,11 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
PYTHON_VERSIONS: ${{ needs.build-info.outputs.all-python-versions-list-as-string }}
- name: Push empty PROD images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
if: failure() || cancelled()
run: breeze build-prod-image --cleanup-context --push-image --empty-image --run-in-parallel
run: breeze prod-image build --cleanup-context --push --empty-image --run-in-parallel
env:
IMAGE_TAG: ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
- name: "Fix ownership"
run: breeze fix-ownership
run: breeze ci fix-ownership
if: always()


Expand Down Expand Up @@ -420,14 +422,14 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
python-version: ${{ needs.build-info.outputs.default-python-version }}
- run: ./scripts/ci/install_breeze.sh
- name: "Free space"
run: breeze free-space
run: breeze ci free-space
- name: "Start ARM instance"
run: ./scripts/ci/images/ci_start_arm_instance_and_connect_to_docker.sh
- name: >
Build ARM CI images ${{ env.IMAGE_TAG_FOR_THE_BUILD }}
${{ needs.build-info.outputs.all-python-versions-list-as-string }}
run: >
breeze build-image --run-in-parallel --builder airflow_cache --platform "linux/arm64"
breeze ci-image build --run-in-parallel --builder airflow_cache --platform "linux/arm64"
env:
UPGRADE_TO_NEWER_DEPENDENCIES: ${{ needs.build-info.outputs.upgrade-to-newer-dependencies }}
DOCKER_CACHE: ${{ needs.build-info.outputs.cache-directive }}
Expand All @@ -437,5 +439,5 @@ ${{ hashFiles('.pre-commit-config.yaml') }}"
run: ./scripts/ci/images/ci_stop_arm_instance.sh
if: always()
- name: "Fix ownership"
run: breeze fix-ownership
run: breeze ci fix-ownership
if: always()
Loading

0 comments on commit b91fd99

Please sign in to comment.