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

[KED-2961] Tidy CircleCI config #1102

Merged
merged 51 commits into from
Dec 16, 2021
Merged

Conversation

antonymilne
Copy link
Contributor

@antonymilne antonymilne commented Dec 8, 2021

Description

I started moving the private-kedro-sync scripts over to this repo but it got very messy very quickly. So I've decided to do a tidy up of what we've got first before we add even more stuff to it. The result is we now have 150 fewer lines in the CircleCI config and it's (I hope) easier to follow and add the new jobs to.

Functionally this is almost identical to what we had before. These are the checks we were doing:
image

The only difference is that I've removed the one marked as removed since I don't think it was there on purpose. Aside from that, all the same checks as before are still there and run identically to before (small exception: I removed install of pre-push but this shouldn't change anything - see inline comments).

Development notes

General principles of the refactoring:

  • I've reduced the number of "layers of indirection" by moving stuff from commands to jobs
  • I've used matrix so we don't need a separate job for every version of Python we're testing
  • this extends the use of parameters, which we were already using for Windows, to also choose the docker image

Tested by checking through all the CircleCI jobs - all seem to be working correctly.

Checklist

  • Read the contributing guidelines
  • Opened this PR as a 'Draft Pull Request' if it is work-in-progress
  • Updated the documentation to reflect the code changes
  • Added a description of this change in the RELEASE.md file
  • Added tests to cover my changes

@antonymilne antonymilne force-pushed the feature/tidy-circleci-config#ked-2961 branch from 44a6065 to ed08221 Compare December 8, 2021 12:39
.circleci/config.yml Outdated Show resolved Hide resolved
Copy link
Contributor

@lorenabalan lorenabalan left a comment

Choose a reason for hiding this comment

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

This looks great, I love how much we've cut down on the fluff! I had some minor comments but otherwise happy with this, thank you for looking into this! 👏 🧹 ✨

.circleci/config.yml Outdated Show resolved Hide resolved
@antonymilne
Copy link
Contributor Author

antonymilne commented Dec 15, 2021

I've managed to simplify win_unit_tests a bit more.

  • The special case for Python = 3.8 wasn't needed; tests passed fine with pytest .\tests --ignore .\tests\extras\datasets\spark --ignore .\tests\extras\datasets\tensorflow --ignore tests\framework\session\test_session_hooks.py --no-cov on all versions
  • I've altered this to make test-no-spark, removed pyproject_no_spark.toml and passed --no-cov in make test-no-spark instead (which is what we were using anyway in the above command)
  • Tensorflow tests actually were working on 3.7 and 3.8 but not 3.6 on windows. I've added a special case for 3.6 to do what is effectively make test-no-spark but also ignoring tensorflow tests. When I do a follow up PR to develop this special conditional bit can be removed

Comment on lines +215 to +228
- unless:
condition:
equal: ["3.6", <<parameters.python_version>>]
steps:
- run:
name: Run unit tests without spark
command: conda activate kedro_builder; make test-no-spark
- when:
condition:
equal: ["3.6", <<parameters.python_version>>]
steps:
- run:
name: Run unit tests without spark or tensorflow
command: conda activate kedro_builder; pytest tests --no-cov --ignore tests/extras/datasets/spark --ignore tests/extras/datasets/tensorflow --numprocesses 4 --dist loadfile
Copy link
Contributor

Choose a reason for hiding this comment

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

Tensorflow tests actually were working on 3.7 and 3.8 but not 3.6 on windows. I've added a special case for 3.6 to do what is effectively make test-no-spark but also ignoring tensorflow tests. When I do a follow up PR to develop this special conditional bit can be removed

So on Windows we never run spark tests, and additionally on python 3.6 specifically we also don't run tensorflow tests. But previously we were not running neither spark nor tensorflow tests on all python versions on Windows? Is that right?

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, exactly. So now we are running tensorflow tests on 3.7 and 3.8 since they (seem to) work.

Copy link
Contributor

@lorenabalan lorenabalan left a comment

Choose a reason for hiding this comment

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

This generally looks good to me but it was very hard to follow the latest set of changes! Moving forward can we please separate functional changes from refactoring changes even for CI config? I expected the change in builds to be either in a separate PR or in one compact commit so I can see the diff better.

@antonymilne
Copy link
Contributor Author

Yes, agreed - sorry! Unfortunately by its nature this CI stuff requires a lot of different pushes to test stuff out, hence the many, many commits. I tried to make it clearer by linking to just the diff that the latest changes produced: simplify win_unit_tests a bit more.

Copy link
Member

@idanov idanov left a comment

Choose a reason for hiding this comment

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

This is awesome 🚀 It is a bit of a large diff for one PR indeed, but it will make our life so much easier going forward and especially when adding and removing python versions from the build. The "matrix" functionality in CCI is quite nice.

@antonymilne antonymilne merged commit fbc6a7c into main Dec 16, 2021
@antonymilne antonymilne deleted the feature/tidy-circleci-config#ked-2961 branch December 16, 2021 09:55
rashidakanchwala pushed a commit that referenced this pull request Jan 10, 2022
Signed-off-by: Rashida Kanchwala <rashida.kanchwala@quantumblack.com>
yetudada pushed a commit that referenced this pull request Jan 28, 2022
Signed-off-by: Yetunde Dada <yetudada@users.noreply.github.com>
Galileo-Galilei pushed a commit to Galileo-Galilei/kedro that referenced this pull request Feb 19, 2022
lvijnck pushed a commit to lvijnck/kedro that referenced this pull request Apr 7, 2022
Signed-off-by: Laurens Vijnck <laurens_vijnck@mckinsey.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants