Skip to content

Conversation

@Bowrna
Copy link
Contributor

@Bowrna Bowrna commented Mar 17, 2022

closes : #21102
related: #21102


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.

@Bowrna
Copy link
Contributor Author

Bowrna commented Mar 30, 2022

@potiuk
--cache:max should be added also in the CI image (because it is multi-segment image now)
#22492 (comment)

I will add this as part of this PR.

@Bowrna Bowrna force-pushed the prepare-image-cache branch from 38ffc3e to 0f32a0a Compare March 30, 2022 06:52
@Bowrna
Copy link
Contributor Author

Bowrna commented Mar 30, 2022

@potiuk i want to know how we can pass the CI flag in python? In bash we set it as env var. Do we need to pass that as flag when we rewrite in python?

if [[ ${CI} == "true" ]]; then
EXTRA_DOCKER_PROD_BUILD_FLAGS+=(
"--build-arg" "PIP_PROGRESS_BAR=off"
)
fi
if [[ -n "${AIRFLOW_CONSTRAINTS_LOCATION}" ]]; then
extra_docker_ci_flags+=(
"--build-arg" "AIRFLOW_CONSTRAINTS_LOCATION=${AIRFLOW_CONSTRAINTS_LOCATION}"
)
fi

@Bowrna Bowrna force-pushed the prepare-image-cache branch 2 times, most recently from d553191 to 6cc513b Compare March 30, 2022 11:45
@Bowrna Bowrna marked this pull request as ready for review March 30, 2022 11:45
@Bowrna Bowrna force-pushed the prepare-image-cache branch 2 times, most recently from 5830eee to 4a0260a Compare March 31, 2022 02:34
@Bowrna
Copy link
Contributor Author

Bowrna commented Mar 31, 2022

@potiuk I made changes specified in this #22618
Please verify it

@Bowrna
Copy link
Contributor Author

Bowrna commented Mar 31, 2022

@potiuk i want to know how we can pass the CI flag in python? In bash we set it as env var. Do we need to pass that as flag when we rewrite in python?

if [[ ${CI} == "true" ]]; then
EXTRA_DOCKER_PROD_BUILD_FLAGS+=(
"--build-arg" "PIP_PROGRESS_BAR=off"
)
fi
if [[ -n "${AIRFLOW_CONSTRAINTS_LOCATION}" ]]; then
extra_docker_ci_flags+=(
"--build-arg" "AIRFLOW_CONSTRAINTS_LOCATION=${AIRFLOW_CONSTRAINTS_LOCATION}"
)
fi

@potiuk Please share your view on this when you get time.

@Bowrna Bowrna force-pushed the prepare-image-cache branch from 4a0260a to 1a6ad6e Compare March 31, 2022 08:07
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
upgrade_to_newer_dependencies: bool,
upgrade_to_newer_dependencies: bool,

This should be Optional[str] actually :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was the fix I made here -> #22597

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@potiuk Is it Optional[str] for prod image too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added more fixes on the parameter in #22649 :). You will need to rebase and resolve conflicts :)

@Bowrna Bowrna force-pushed the prepare-image-cache branch from 1a6ad6e to 3bc073b Compare March 31, 2022 11:22
@potiuk
Copy link
Member

potiuk commented Mar 31, 2022

@potiuk i want to know how we can pass the CI flag in python? In bash we set it as env var. Do we need to pass that as flag when we rewrite in python?

if [[ ${CI} == "true" ]]; then
EXTRA_DOCKER_PROD_BUILD_FLAGS+=(
"--build-arg" "PIP_PROGRESS_BAR=off"
)
fi
if [[ -n "${AIRFLOW_CONSTRAINTS_LOCATION}" ]]; then
extra_docker_ci_flags+=(
"--build-arg" "AIRFLOW_CONSTRAINTS_LOCATION=${AIRFLOW_CONSTRAINTS_LOCATION}"
)
fi

@potiuk Please share your view on this when you get time.

Same as in Bash. Just add the PIP_PROGRESS_BAR==off if CI is set to true. There is no need to pass it further. But in order to do it nicely you can add --ci parameter with CI envvar via click.

@Bowrna Bowrna force-pushed the prepare-image-cache branch from 3bc073b to 733bbe1 Compare April 1, 2022 03:51
@Bowrna
Copy link
Contributor Author

Bowrna commented Apr 1, 2022

@potiuk Added fix for flag upgrade_to_newer_dependencies :)

@Bowrna Bowrna force-pushed the prepare-image-cache branch from 733bbe1 to bb10913 Compare April 1, 2022 06:23
@Bowrna
Copy link
Contributor Author

Bowrna commented Apr 1, 2022

@potiuk i want to know how we can pass the CI flag in python? In bash we set it as env var. Do we need to pass that as flag when we rewrite in python?

if [[ ${CI} == "true" ]]; then
EXTRA_DOCKER_PROD_BUILD_FLAGS+=(
"--build-arg" "PIP_PROGRESS_BAR=off"
)
fi
if [[ -n "${AIRFLOW_CONSTRAINTS_LOCATION}" ]]; then
extra_docker_ci_flags+=(
"--build-arg" "AIRFLOW_CONSTRAINTS_LOCATION=${AIRFLOW_CONSTRAINTS_LOCATION}"
)
fi

@potiuk Please share your view on this when you get time.

Same as in Bash. Just add the PIP_PROGRESS_BAR==off if CI is set to true. There is no need to pass it further. But in order to do it nicely you can add --ci parameter with CI envvar via click.

@potiuk Added this support too

@potiuk potiuk merged commit dc75f5d into apache:main Apr 1, 2022
)
option_ci_flag = click.option(
'--ci',
help='Enabling this option will off the pip progress bar',
Copy link
Contributor

@joppevos joppevos Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume it should be "...will TURN off the pip..."? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Breeze: Add 'prepare-image-cache' in Breeze

3 participants