This is an automated email from the ASF dual-hosted git repository. potiuk pushed a commit to branch v2-3-test in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 99e5a0dee76f32241c04546500631610576cc6ce Author: Jarek Potiuk <[email protected]> AuthorDate: Wed May 4 00:15:52 2022 +0200 Move non-opencontainer labeling of the image to breeze from Dockerfile (#23379) * Extract "extra" labeling of the image to breeze from Dockerfile Fixes: #21046 * Add more ArtifictHub-specific labels Co-authored-by: Kamil BreguĊa <[email protected]> (cherry picked from commit 5b1ab96865a6e8f18784f88f88f8b17981450cc6) --- Dockerfile | 5 +--- .../build_image/prod/build_prod_params.py | 35 ++++++++++++++++++++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index cab6cbadff..8a156174a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1571,9 +1571,6 @@ LABEL org.apache.airflow.distro="debian" \ org.opencontainers.image.licenses="Apache-2.0" \ org.opencontainers.image.ref.name="airflow" \ org.opencontainers.image.title="Production Airflow Image" \ - org.opencontainers.image.description="Reference, production-ready Apache Airflow image" \ - io.artifacthub.package.license='Apache-2.0' \ - io.artifacthub.package.readme-url='${AIRFLOW_IMAGE_README_URL}' - + org.opencontainers.image.description="Reference, production-ready Apache Airflow image" ENTRYPOINT ["/usr/bin/dumb-init", "--", "/entrypoint"] CMD [] diff --git a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py index aa781b486a..0260907fbd 100644 --- a/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py +++ b/dev/breeze/src/airflow_breeze/build_image/prod/build_prod_params.py @@ -15,6 +15,7 @@ # specific language governing permissions and limitations # under the License. """Parameters to build PROD image.""" +import json import os import re import sys @@ -53,7 +54,6 @@ class BuildProdParams: airflow_is_in_context: bool = False install_packages_from_context: bool = False upgrade_to_newer_dependencies: bool = False - airflow_version: str = get_airflow_version() python: str = "3.7" airflow_branch_for_pypi_preloading: str = AIRFLOW_BRANCH install_airflow_reference: str = "" @@ -87,6 +87,13 @@ class BuildProdParams: debian_version: str = "bullseye" answer: Optional[str] = None + @property + def airflow_version(self) -> str: + if self.install_airflow_version: + return self.install_airflow_version + else: + return get_airflow_version() + @property def airflow_branch(self) -> str: return self.airflow_branch_for_pypi_preloading @@ -172,7 +179,6 @@ class BuildProdParams: ] ) extra_build_flags.extend(self.args_for_remote_install) - self.airflow_version = self.install_airflow_reference elif len(self.install_airflow_version) > 0: if not re.match(r'^[0-9\.]+((a|b|rc|alpha|beta|pre)[0-9]+)?$', self.install_airflow_version): get_console().print( @@ -185,8 +191,15 @@ class BuildProdParams: ["--build-arg", f"AIRFLOW_VERSION_SPECIFICATION==={self.install_airflow_version}"] ) extra_build_flags.extend(["--build-arg", f"AIRFLOW_VERSION={self.install_airflow_version}"]) + constraints_base = ( + f"https://raw.githubusercontent.com/{self.github_repository}/" + f"{self.airflow_constraints_reference}" + ) + constraints_location = ( + f"{constraints_base}/constraints-{self.install_airflow_version}/constraints-{self.python}.txt" + ) + self.airflow_constraints_location = constraints_location extra_build_flags.extend(self.args_for_remote_install) - self.airflow_version = self.install_airflow_version else: extra_build_flags.extend( [ @@ -204,6 +217,22 @@ class BuildProdParams: f"AIRFLOW_CONSTRAINTS_REFERENCE={self.default_constraints_branch}", ] ) + + maintainers = json.dumps([{"name": "Apache Airflow PMC", "email": "[email protected]"}]) + logo_url = "https://github.com/apache/airflow/raw/main/docs/apache-airflow/img/logos/wordmark_1.png" + readme_url = "https://raw.githubusercontent.com/apache/airflow/main/docs/docker-stack/README.md" + extra_build_flags.extend( + [ + "--label", + "io.artifacthub.package.license=Apache-2.0", + "--label", + f"io.artifacthub.package.readme-url={readme_url}", + "--label", + f"io.artifacthub.package.maintainers={maintainers}", + "--label", + f"io.artifacthub.package.logo-url={logo_url}", + ] + ) return extra_build_flags @property
