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
[MNT] split optional dependencies and CI testing per components #5101
Comments
|
Let's consider a case: I (any contributor) create a PR modifying If I am not wrong, the way it currently works is I think this is not required, as I (the contributor) and reviewers will know that it is enough to look between only forecasting modules. It'll be much smaller list to loop through just So, the way I see it, it'll help us to have logically similar smaller groups of tests, and easy to debug. Also, I don't know how coverage gets combined from multiple jobs currently, but this will allow us to report coverage per component as well. (To be honest, my suggestion was really based on unnecessary search over all components and smaller logical grouping. Coverage seemed like a nice possible side effect now, didn't think of it earlier.) Even if you don't agree about 2nd or 3rd tasks, I think the 4th task (manually triggerable CI job to run all tests) is still relevant? Or, do we have a way to test this now already? I remembered some CRON job discussion @hazrulakmal suggested somewhere, but don't know if it's done already or not. |
I see - I consider this a valid, and strong argument for a lookup architecture instead of the current filtering architecture. Where lookup/filtering refers to the logic to find the tests to execute. Filtering would be: find all tests first, and then decide for each and everyone which to run. Examples are exhaustive search then filter by condition or property. Lookup would be: determine a list of tests to run first, and then find them. Examples would be dispatch or list lookup. Noting that the "split by module" archithecture proposed in the OP moves from the current, which is entirely filtering based, to a lookup/filtering hybrid. But, also noting, that the argument above is not specifically in favour of this solution (which I consider a bit over-complicating). Following this line of analysis, would a pure lookup architecture not be best, hence? |
I agree that this is desirable and we should do this. The current solution is here: #5083 (manual trigger to run all tests), but CRON and automated seems better. I just don't know how to set it up, off the top of my head. I could probably learn it, but then it becomes a time prioritization exercise. |
I'm glad to convince you, but got a bit worried by this:
Just to confirm we're talking about same thing, here's what I was trying to suggest: current case: old-all.ymlname: test workflow
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
test-job-id:
name: test job name
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: repository checkout step
uses: actions/checkout@v3
- name: python environment step
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: dependencies installation step
run: python3 -m pip install .[all_extras]
- name: unit test step
run: python3 -m pytest
- name: test coverage step
uses: codecov/codecov-action@v3 proposed case: new-all.ymlname: all test workflow
on:
schedule:
- cron: 0 0 * * 0
workflow_dispatch:
jobs:
all-test-job-id:
name: all test job name
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: repository checkout step
uses: actions/checkout@v3
- name: python environment step
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: dependencies installation step
run: python3 -m pip install .[all_extras]
- name: unit test step
run: python3 -m pytest sktime
- name: test coverage step
uses: codecov/codecov-action@v3 new-base.ymlname: base test workflow
on:
pull_request:
branches:
- main
paths:
- sktime/base
push:
branches:
- main
paths:
- sktime/base
jobs:
base-test-job-id:
name: base test job name
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: repository checkout step
uses: actions/checkout@v3
- name: python environment step
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: dependencies installation step
run: python3 -m pip install .
- name: unit test step
run: python3 -m pytest sktime/base
- name: test coverage step
uses: codecov/codecov-action@v3 new-forecast.ymlname: forecast test workflow
on:
pull_request:
branches:
- main
paths:
- sktime/foreasting
push:
branches:
- main
paths:
- sktime/foreasting
jobs:
foreast-test-job-id:
name: forecast test job name
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
os:
- macos-latest
- ubuntu-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: repository checkout step
uses: actions/checkout@v3
- name: python environment step
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: dependencies installation step
run: python3 -m pip install .[forecasting]
- name: unit test step
run: python3 -m pytest sktime/forecasting
- name: test coverage step
uses: codecov/codecov-action@v3 etc.
So, my idea was that for a new PR, And for manual/scheduled trigger of all tests, Given the above, can you please elaborate on these? I didn't understand those points.
|
Ah, I did not appreciate that this would also reduce requirement conflicts! That's a new argument in favour (at least in my head, if might have been obvious to others earlier in the thread). I now have a question about this - how would this play along with the pandas 2 vs pandas 1 testing, which imo we still need to support both for a while? |
Hm, I think I did not succeed to communicate the lookup model? I mean, there is a third, not discussed option which your strongest (first) argument seems to be in favour of, because it is a general argument in favour of lookup based architecture, rather than primarily in favour of your proposed chunking of dependency sets (which is closer to lookup than status quo, but not the "pure" form of it). Is it clear what I meant by lookup architeture? |
Sorry, but I'm completely lost.
My understanding was this:
I'm guessing you meant something else, and still struggling to identify the 3rd pure form option that is supposed to be coming from my own arguments 😞 |
Hm, ok, let me maybe explain better. The general context is the task of retrieval, "find all X with the properties Y". High-level, there's a slow (but general) and a fast (but specific) way to do this. The slow way is, first find all X; then, for each X check whether it has property Y. If there is a large number of X, and a small fraction of those with property Y, this can be arbitrarily inefficient. A faster way would be to index the property Y, or more generally, specific properties. E.g., to prepare a list of X with property Y. That way, we only access that list, based on the "indexing" of Y. In terms of abstract data strutures, the "slow" way could be implemented by a list of X which we have to go through. Each list element points to tags/properties. The "fast" way could be implemented by a lookup dictionary, i.e., properties pointing to sub-lists of X. Currently, we are doing the first; what I was saying, we should consider moving to a smarter indexing. |
Are you saying something along the lines of what I was saying here: #4762? With I think I understand the two points you said above, but I'm still confused on how to relate this to package/workflow split though. Or may may be that's where I'm stuck, you're not talking about that at all and suggesting to replace |
Yes, I think so - not from a user perspective though, but as an architectural principle in test collection. |
The package/workflow split restricts the set of estimators |
@yarnabrina, I have thought about this and think the "lookup" would probably be much harder to realise than the "split by estimator type" that you propose. I also think that splitting is better than the status quo. So, I am now convinced of doing this! |
…5304) Part 2, 3 and 4 of #5101 Depends on #5375 1. new extra with just test dependencies 2. action to run tests in `sktime/base` with only core and test dependencies 3. action to run tests in `sktime/<component>` with only core, test and component specific dependencies 4. workflow to run base framework tests only when `sktime/base` gets modified 5. workflow to run component specific tests only when `sktime/<component>` gets modified 6. workflow to run all (base framework and all components) tests every SUnday 00:00 and manually if desired
Based on my understanding, #5136 + #5304 implement the proposals in this issue. However, they do not yet replace the existing CI, and they run alongside. This is to reduce breaking changes in the sense that don't break what is working unless we know for sure new CI has all capability of old CI and does something extra that is beneficial. However, having both CI run will increase CI time significantly, and there may be some limit in Github free planning as well. Therefore, requesting @fkiraly, @benHeid, @achieveordie, @hazrulakmal and other @sktime/core-developers to take a look at these pull requests and let me know what is missing in new CI as of now. I'll add my observations about what is missing below.
|
I was of the opinion that the new tests should focus on testing estimators, we can then remove this from the old tests.
Then we should have the planned meeting where we ask each other about the new and old CI. I assumed you were familiar with these and had a plan on the mid-term state of tests... Imo we should clarify the mid-term plan before the next release (early Nov?) and then decide which state we leave the old tests in. |
Answering further Q by @yarnabrina from #5424:
Yes, and we should aim to reduce overall test time and do the math carefully. Let's try to plan in the next dev meeting (Oct 27), or is that inconvenient due to holidays? |
Oct 27 UTC 3 pm is fine for me.
I'm not sure I follow, but along with other CI confusions, we can discuss in the next dev call. |
@fkiraly hopefully this is the right issue to talk about old CI retirement/deprecation, as this initiated new CI plans. All tasks as per the main issue is already addressed over different PR's. I suggest the following for old CI:
(Note: if you and other @sktime/core-developers agree, 1+2 is basically equivalent to commenting those 2 sections and adding a CRON job configuration, so that can be done as well.) |
Sounds good, although I would like to ensure I can easily switch to new workflow (test & release) before we completely remove the old CI. There are four issues currently, for me:
|
Closing this as it's implemented already, and further discussions on new CI can take place in #5706 |
I want to suggest a continuation from the recent introduction of CI testing only per module.
As of now,
sktime
offers only one optional dependencies:all_extras
, which is massive and definitely has some packages which have overlapping (if not conflicting) dependencies. My suggestion is to introduce few more optional dependencies, one per each component:What
pip install sktime[forecasting]
will do is installsktime
and all soft dependencies by all forecasters insktime
, and similarly for other components.There can be further classifications, for example
forecasting-dl
vsforecasting-non-dl
can be one split, as deep learning packages (e.g.torch
) often have serious system dependencies which may not be always possible to be used by all users in all environments.After addition of these, I want to propose to split the CI test job into component wise parts. For example, instead of using one single job on
python 3.9
andmacos
, we can have multiple, one for each component. Each of this component runs only if change is detected in that directory or inbase
(Github Actions support this natively) and if selected, runs the tests on modified modules in that component after only installing the relevant sub-dependencies.Proposed tasks
pyproject.toml
per componentInviting @fkiraly, @benHeid, @achieveordie to consider this suggestion and share feedbacks.
The text was updated successfully, but these errors were encountered: