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

Move Kubernetes modules out of contrib to match 2.0 layout #8904

Merged
merged 1 commit into from May 29, 2020

Conversation

dimberman
Copy link
Contributor

@dimberman dimberman commented May 18, 2020

Moves k8s internal files out of the contrib folder without moving K8sPodOperator avoid any breaking changes


Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Unit tests coverage for changes (not needed for documentation changes)
  • Target Github ISSUE in description if exists
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

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.
Read the Pull Request Guidelines for more information.

@boring-cyborg boring-cyborg bot added area:docs area:Scheduler Scheduler or dag parsing Issues area:webserver Webserver related Issues labels May 18, 2020
@dimberman
Copy link
Contributor Author

Many k8soperator/k8sexecutor PRs need to be essentially recreated from scratch because git can no longer merge. I'm hoping to make a few PRs like this to bring 1-10 and master closer together

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

On my phone right now so can't easily check, but I think we need an import-shim to make any old imports in end-user code stay working

@dimberman dimberman force-pushed the k8s-file-move branch 2 times, most recently from ebef081 to 14329ce Compare May 18, 2020 21:09
.github/workflows/ci.yml Outdated Show resolved Hide resolved
@dimberman
Copy link
Contributor Author

@ashb some point tomorrow I might need some help on this PR. I'm getting a bunch of flake8 failures that seem completely unrelated to any code changes I made so not sure if something is funky with 1-10-test

@dimberman
Copy link
Contributor Author

dimberman commented May 18, 2020

@potiuk do you have any idea why all of these unrelated flake tests would fail?


tests/contrib/utils/base_gcp_system_test_case.py:89:0: F523 '...'.format(...) has unused arguments at position(s): 0
airflow/jobs/backfill_job.py:559:33: F523 '...'.format(...) has unused arguments at position(s): 0, 1
airflow/contrib/utils/gcp_field_validator.py:253:17: F523 '...'.format(...) has unused arguments at position(s): 1
airflow/operators/docker_operator.py:268:17: E741 ambiguous variable name 'l'
tests/contrib/operators/test_gcs_to_gcs_operator.py:290:21: F523 '...'.format(...) has unused arguments at position(s): 1
airflow/contrib/operators/file_to_wasb.py:60:13: F523 '...'.format(...) has unused arguments at position(s): 0, 1, 2
airflow/contrib/operators/qubole_check_operator.py:226:17: E122 continuation line missing indentation or outdented


@kaxil
Copy link
Member

kaxil commented May 19, 2020

@potiuk do you have any idea why all of these unrelated flake tests would fail?


tests/contrib/utils/base_gcp_system_test_case.py:89:0: F523 '...'.format(...) has unused arguments at position(s): 0
airflow/jobs/backfill_job.py:559:33: F523 '...'.format(...) has unused arguments at position(s): 0, 1
airflow/contrib/utils/gcp_field_validator.py:253:17: F523 '...'.format(...) has unused arguments at position(s): 1
airflow/operators/docker_operator.py:268:17: E741 ambiguous variable name 'l'
tests/contrib/operators/test_gcs_to_gcs_operator.py:290:21: F523 '...'.format(...) has unused arguments at position(s): 1
airflow/contrib/operators/file_to_wasb.py:60:13: F523 '...'.format(...) has unused arguments at position(s): 0, 1, 2
airflow/contrib/operators/qubole_check_operator.py:226:17: E122 continuation line missing indentation or outdented

That is most likely caused by the new version release of flake8 on May 12 that may have introduced extra checks ! - https://pypi.org/project/flake8/

@potiuk
Copy link
Member

potiuk commented May 19, 2020

Yep. It's very likely. I think we fixed similar problems in one of the commits in master. Looking at the requirements.txt Flake8 3.8.0 (and then 3.8.1 right after) has been released 12th of May. You simply need to fix those @dimberman

@dimberman
Copy link
Contributor Author

Thanks @potiuk @kaxil just wanted to make sure I wasn't making the problem worse :)

Copy link
Member

@kaxil kaxil left a comment

Choose a reason for hiding this comment

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

PR targets v1-10-test so needs to be backwards-compatible. So just needs to add original paths to keep it compatible otherwise LGTM

Comment on lines 60 to 61
'Uploading {} to wasb://{} '
'as {}'.format(self.file_path, self.container_name, self.blob_name)
Copy link
Member

Choose a reason for hiding this comment

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

Was this changes because of a flake8 error ? We use %s format for logs so that the arguments are passed properly when logging levels are changed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. This was because of flake8 errors.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaxil any thoughts on what to do here? change them or set ignore flags?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

also if you're running .format on the string before it's even parsed does it even matter?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@kaxil fixed

Copy link
Member

Choose a reason for hiding this comment

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

The fix here is to do

        self.log.info(
            'Uploading %s to wasb://%s as %s',
            self.file_path, self.container_name, self.blob_name)

That way if the logging level is disabled, no time is wasted formatting the string

Copy link
Contributor Author

@dimberman dimberman May 19, 2020

Choose a reason for hiding this comment

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

@ashb If possible I'd like to avoid making changes unrelated to the commit on this PR (especially since it's going straight to 1-10). Should we make a separate PR for fixing these logs/flake8 tests?

Copy link
Member

Choose a reason for hiding this comment

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

Oh gotcha. I mean you are already changing this, so it's going to conflict anyway.

Potato potato.

@dimberman dimberman force-pushed the k8s-file-move branch 2 times, most recently from 31d03c6 to a49aebb Compare May 21, 2020 15:44
@ashb ashb changed the title Move k8s files out of contrib Move Kubernetes modules out of contrib to match 2.0 layout May 21, 2020
@ashb
Copy link
Member

ashb commented May 21, 2020

@dimberman Needs rebasing now please.

@dimberman dimberman force-pushed the k8s-file-move branch 2 times, most recently from 15e7728 to c96119c Compare May 26, 2020 16:02
@dimberman dimberman merged commit 4daccda into apache:v1-10-test May 29, 2020
@dimberman dimberman deleted the k8s-file-move branch May 29, 2020 15:44
dimberman added a commit that referenced this pull request May 29, 2020
Considering that the k8s executor is now supported by core
committers, we should move it from contrib to the primary executor
directory.

Co-authored-by: Daniel Imberman <daniel@astronomer.io>
kaxil pushed a commit that referenced this pull request Jul 1, 2020
Considering that the k8s executor is now supported by core
committers, we should move it from contrib to the primary executor
directory.

Co-authored-by: Daniel Imberman <daniel@astronomer.io>
cfei18 pushed a commit to cfei18/incubator-airflow that referenced this pull request Mar 5, 2021
Considering that the k8s executor is now supported by core
committers, we should move it from contrib to the primary executor
directory.

Co-authored-by: Daniel Imberman <daniel@astronomer.io>
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 area:webserver Webserver related Issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants