Skip to content
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

KubernetesExecutor should default to template image if used #19484

Merged
merged 3 commits into from
Nov 9, 2021

Conversation

dstandish
Copy link
Contributor

Currently, the user must specify image and tag in airflow.cfg, even when they are using a pod template file. If the pod template file specifies an image and tag, the user should not be forced to also specify this in airflow.cfg.


^ 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.

@boring-cyborg boring-cyborg bot added provider:cncf-kubernetes Kubernetes provider related issues area:Scheduler Scheduler or dag parsing Issues labels Nov 8, 2021
@dstandish dstandish force-pushed the k8s-config-default-to-template branch from a123a9d to 684a5a1 Compare November 8, 2021 23:41
Currently, the user must specify image and tag in airflow.cfg, even when they are using a pod template file.  If the pod template file specifies an image and tag, the user should not be forced to also specify this in airflow.cfg.
@dstandish dstandish force-pushed the k8s-config-default-to-template branch from 684a5a1 to 98e4a1a Compare November 8, 2021 23:42
Comment on lines -41 to -42
class TestPodGenerator(unittest.TestCase):
def setUp(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

converting to pytest is required when combining pytest params and unittest.mock

@@ -45,7 +45,10 @@ def __init__(self):

self.worker_container_repository = conf.get(self.kubernetes_section, 'worker_container_repository')
self.worker_container_tag = conf.get(self.kubernetes_section, 'worker_container_tag')
self.kube_image = f'{self.worker_container_repository}:{self.worker_container_tag}'
if self.worker_container_repository and self.worker_container_tag:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

we could probably loosen this to allow user to specify image only (and not tag) but this is the current behavior. currently if either is not specified it won't work unless specified in executor_config

Copy link
Member

@jedcunningham jedcunningham left a comment

Choose a reason for hiding this comment

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

You beat me to it, I found this on Friday :)

@github-actions github-actions bot added the full tests needed We need to run full set of tests for this PR to merge label Nov 9, 2021
@github-actions
Copy link

github-actions bot commented Nov 9, 2021

The PR most likely needs to run full matrix of tests because it modifies parts of the core of Airflow. However, committers might decide to merge it quickly and take the risk. If they don't merge it quickly - please rebase it to the latest main at your convenience, or amend the last commit of the PR, and push it with --force-with-lease.

@dstandish
Copy link
Contributor Author

looks like the one failure is unrelated

@jedcunningham jedcunningham added this to the Airflow 2.2.3 milestone Nov 9, 2021
@kaxil kaxil merged commit d18e2b0 into apache:main Nov 9, 2021
@kaxil kaxil added the type:bug-fix Changelog: Bug Fixes label Nov 9, 2021
jedcunningham pushed a commit that referenced this pull request Dec 7, 2021
Currently, the user must specify image and tag in airflow.cfg, even when they are using a pod template file.  If the pod template file specifies an image and tag, the user should not be forced to also specify this in airflow.cfg.

(cherry picked from commit d18e2b0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Scheduler Scheduler or dag parsing Issues full tests needed We need to run full set of tests for this PR to merge provider:cncf-kubernetes Kubernetes provider related issues type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants