-
Notifications
You must be signed in to change notification settings - Fork 28
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
use parallel workflows #150
Conversation
|
.github/workflows/build.yml
Outdated
echo "::set-output name=build_macos::['macos-latest']" | ||
echo "::set-output name=test_macos::['macos-10.15', 'macos-11']" | ||
echo "::set-output name=build_linux::['ubuntu-latest']" | ||
echo "::set-output name=test_linux::['ubuntu-18.04', 'ubuntu-20.04']" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had previously:
- Build matrix: [windows-2016, macos-10.15, ubuntu-latest]
- Test matrix: [windows-latest, macos-latest, ubuntu-latest]
This PR should mimic that, and configuration changes are made in another PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - back to previous non // set-up
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW it will be simpler to write this step in Python when you will make this workflow more complex; db/shell-python does that. (And db/shell-python-extended shows how this Python code can be modified in order to implement some complex processing in future PRs, if desired)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done - taken
.github/workflows/build.yml
Outdated
echo "::set-output name=build_linux::['ubuntu-latest']" | ||
echo "::set-output name=test_linux::['ubuntu-18.04', 'ubuntu-20.04']" | ||
|
||
my_echo: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this job; do not keep debugging stuff in production code, this is useless and may add more bugs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.github/workflows/build.yml
Outdated
shell: bash | ||
runs-on: ${{ matrix.os }} | ||
|
||
env: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
env is the same for all jobs and could be declared globally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
.github/workflows/build.yml
Outdated
if: steps.cache-build-dependencies.outputs.cache-hit != 'true' | ||
run: echo "SKDECIDE_SKIP_DEPS=0" >> $GITHUB_ENV | ||
|
||
- name: Build Windows wheel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove mentions of OS from step names (in all steps), this is no more useful when jobs are split by OS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$ grep -i -E 'name:.*(linux|macos|windows)' .github/workflows/build.yml
- name: Install omp on MacOS
- name: Install and restore ccache for macOs
- name: Let cmake use ccache for macOs
- name: Restore docker dev image for Linux
- name: Restore ccache cache for Linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep -i -E 'name:.*(linux|macos|windows)' .github/workflows/build.yml [🐍 scikit-decide]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
.github/workflows/build.yml
Outdated
compiler: [gnu] | ||
fail-fast: true | ||
defaults: | ||
run: | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why, but test failures occur only when running in bash, remove that stance to have the same behavior as before. Remove it from all 3 test-* jobs, they were not set previously and are useless anyway on Unix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok back to previous state.
.github/workflows/build.yml
Outdated
@@ -352,7 +553,7 @@ jobs: | |||
|
|||
upload-nightly: | |||
if: (github.ref == 'refs/heads/master') && (github.repository == 'airbus/scikit-decide') && (github.event_name == 'schedule') | |||
needs: [test-unix, test-macos, test-windows] | |||
needs: [build-docs, test-macos, test-windows] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As explained in the description of the PR. Building the doc is done as early as possible. Since it is done on ubuntu
it is done after tests have been performed. Therefore build-docs
depends now from test-linux
and upload-nightly
depends on build-docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously upload-nightly and build-docs were independent, both depending on test-*. There is no reason to change that in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok went back to same structure
.github/workflows/build.yml
Outdated
strategy: | ||
matrix: | ||
os: ${{ fromJSON(needs.init.outputs.build_windows) }} | ||
python-version: ${{ fromJSON(needs.init.outputs.python_versions) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python-version on the left and python_versions on the right, that is not ideal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
build.yml looks good, you can squash commits after changing the setup step as suggested.
But release.yml is wrong, you copy/pasted build.yml, you should instead have duplicated the steps in release.yml. We do not want to use ccache in release.yml, maybe there are other differences, I do not want to check, this would require too much time.
In fact release.yml could be left as is, we won't implement [ci: skip] keywords in this workflow, so it is less important. If you do want to change it anyway, please make sure that the new release.yml does the exact same thing as the old one.
.github/workflows/build.yml
Outdated
python_version = ["3.7", "3.8", "3.9"] | ||
build = { "macos": ["macos-10.15"], "linux": ["ubuntu-latest"], "windows": ["windows-2016"] } | ||
test = { "macos": ["macos-latest"], "linux": ["ubuntu-latest"], "windows": ["windows-latest"] } | ||
print("::set-output name=python_version::['3.7', '3.8', '3.9']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should write
print(f"::set-output name=python_version::{python_version}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not fixed after rebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not fixed
.github/workflows/release.yml
Outdated
python_version = ["3.7", "3.8", "3.9"] | ||
build = { "macos": ["macos-10.15"], "linux": ["ubuntu-latest"], "windows": ["windows-2016"] } | ||
test = { "macos": ["macos-latest"], "linux": ["ubuntu-latest"], "windows": ["windows-latest"] } | ||
print("::set-output name=python_version::['3.7', '3.8', '3.9']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
print(f"::set-output name=python_version::{python_version}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
[...]
And if you want to modify release.yml, you should rebase on current master which also modified this file. |
I have re-squashed and kept 2 commits one for each file. |
I cannot imagine why that would be useful.
Since release.yml is only triggered by pushing tags, this would mean that you delete and re-push a tag for a published version, this is certainly not desirable. |
.github/workflows/build.yml
Outdated
python_version = ["3.7", "3.8", "3.9"] | ||
build = { "macos": ["macos-10.15"], "linux": ["ubuntu-latest"], "windows": ["windows-2016"] } | ||
test = { "macos": ["macos-latest"], "linux": ["ubuntu-latest"], "windows": ["windows-latest"] } | ||
print("::set-output name=python_version::['3.7', '3.8', '3.9']") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
still not fixed
Indeed the changes for |
… for linux The environment is made global for the workflow
This PR structures the build in 3 different branches:
each branch is in charge of an operating system family
each build/test job takes 2 parameters to define a strategy :
one for the python versions
one for the different versions of the os we want to build or test on
latest
OS except for windows were we usewindows-2016
. Latest versions are currently:the doc is build as soon as possible i.e. as soon as the tests on linux are finished.
This structure does not increase the build time (it slightly decreases it