-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
Simplify caching mechanisms for CI and PROD images (regular PR) #45261
Closed
+2,556
−3,662
Closed
Changes from all commits
Commits
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 was deleted.
Oops, something went wrong.
This file contains 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 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,72 @@ | ||
# 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: 'Prepare all CI images' | ||
description: 'Recreates current python CI images from artifacts for all python versions' | ||
inputs: | ||
python-versions-list-as-string: | ||
description: 'Stringified array of all Python versions to test - separated by spaces.' | ||
required: true | ||
platform: | ||
description: 'Platform for the build - linux/amd64 or linux/arm64' | ||
required: true | ||
outputs: | ||
host-python-version: | ||
description: Python version used in host | ||
value: ${{ steps.breeze.outputs.host-python-version }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Cleanup docker" | ||
run: ./scripts/ci/cleanup_docker.sh | ||
shell: bash | ||
# TODO: Currently we cannot loop through the list of python versions and have dynamic list of | ||
# tasks. Instead we hardcode all possible python versions and they - but | ||
# this should be implemented in stash action as list of keys to download. | ||
# That includes 3.8 - 3.12 as we are backporting it to v2-10-test branch | ||
# This is captured in https://github.com/apache/airflow/issues/45268 | ||
- name: "Restore CI docker image ${{ inputs.platform }}:3.8" | ||
uses: ./.github/actions/prepare_single_ci_image | ||
with: | ||
platform: ${{ inputs.platform }} | ||
python: "3.8" | ||
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }} | ||
- name: "Restore CI docker image ${{ inputs.platform }}:3.9" | ||
uses: ./.github/actions/prepare_single_ci_image | ||
with: | ||
platform: ${{ inputs.platform }} | ||
python: "3.9" | ||
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }} | ||
- name: "Restore CI docker image ${{ inputs.platform }}:3.10" | ||
uses: ./.github/actions/prepare_single_ci_image | ||
with: | ||
platform: ${{ inputs.platform }} | ||
python: "3.10" | ||
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }} | ||
- name: "Restore CI docker image ${{ inputs.platform }}:3.11" | ||
uses: ./.github/actions/prepare_single_ci_image | ||
with: | ||
platform: ${{ inputs.platform }} | ||
python: "3.11" | ||
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }} | ||
- name: "Restore CI docker image ${{ inputs.platform }}:3.12" | ||
uses: ./.github/actions/prepare_single_ci_image | ||
with: | ||
platform: ${{ inputs.platform }} | ||
python: "3.12" | ||
python-versions-list-as-string: ${{ inputs.python-versions-list-as-string }} |
This file contains 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 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,47 @@ | ||
# 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: 'Prepare single CI image' | ||
description: > | ||
Recreates current python image from artifacts (needed for the hard-coded actions calling all | ||
possible Python versions in "prepare_all_ci_images" action. Hopefully we can get rid of it when | ||
the https://github.com/apache/airflow/issues/45268 is resolved and we contribute capability of | ||
downloading multiple keys to the stash action. | ||
inputs: | ||
python: | ||
description: 'Python version for image to prepare' | ||
required: true | ||
python-versions-list-as-string: | ||
description: 'Stringified array of all Python versions to prepare - separated by spaces.' | ||
required: true | ||
platform: | ||
description: 'Platform for the build - linux/amd64 or linux/arm64' | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Restore CI docker images ${{ inputs.platform }}:${{ inputs.python }}" | ||
uses: apache/infrastructure-actions/stash/restore@c94b890bbedc2fc61466d28e6bd9966bc6c6643c | ||
with: | ||
key: "ci-image-save-${{ inputs.platform }}-${{ inputs.python }}" | ||
path: "/tmp/" | ||
if: contains(inputs.python-versions-list-as-string, inputs.python) | ||
- name: "Load CI image ${{ inputs.platform }}:${{ inputs.python }}" | ||
run: breeze ci-image load --platform "${{ inputs.platform }}" --python "${{ inputs.python }}" | ||
shell: bash | ||
if: contains(inputs.python-versions-list-as-string, inputs.python) |
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc: @assignUser -> will need an option to restore several keys in a single action for that. You might see some people from our team contributing to the stash action of yours :)