forked from globus/globus-compute
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix CI and the way dependencies are specified
test and dev are extras for installing tools, no multiple requirements files scattered across the repo. CI workflows should not be installing multiple distinct applications into a single venv and then trying to test. This muddies the waters and makes the purpose and requirements of each CI step unclear. Therefore, in addition to putting the requirement data where it really belongs, this fixes the workflows to specify a better isolated test configuration. Workflow jobs are used more thoughtfully to produce isolated VMs for distinct build and testing processes. New daily tests run Monday-through-Friday in the AM for US timezones, doing `safety check` and little else. Safety checking on dependencies is done separately for funcx-sdk and funcx-endpoint. The CI workflow for testing PRs and branches also does `safety check`, but importantly the hourly test does not. Notifications from the daily and hourly workflows are done in a separate dedicated job. This means that new jobs can be added upstream without needing distinct or rewritten notification logic. The absence of any pytest run for the funcx-sdk package is more obvious and identified properly as a problem. It is paired with the "import test" so that when enabled, the import test removal will be localized to the same area of the workflow file. Linting is a dedicated job which runs as part of the CI workflow and uses pre-commit on the full repo. No additional lint steps (e.g. one-off flake8 runs) are used or should be needed. Testing documentation is updated minimally to refer to the installation of extras, rather than requirements files. The doc site requirements for some (undocumented) reason are installing funcx-sdk test requirements. This has been removed. Any documentation requirements can continue to be specified in the doc directory, or under a new `[docs]` extra if necessary. It should not "inherit" the requirements of the testing process. The codecov integration does not deliver value in the absence of good unit testing and a test matrix of size greater than 1. Therefore, until such a time as codecov is useful and a worthwhile configuration can be identified, the integration has been removed. The funcx-endpoint setup.py file was autoformatted with `black` to simplify the formatting of the requirements data. No workflow steps are allowed to use `actions/checkout@master`. This is unnecessary and dangerous usage. `checkout@v2` is used -- as the GitHub Action's own documentation instructs users to do -- instead.
- Loading branch information
Showing
13 changed files
with
254 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: daily | ||
on: | ||
# build every weekday at 4:00 AM UTC | ||
schedule: | ||
- cron: '0 4 * * 1-5' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
safety-check-sdk: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
- uses: actions/setup-python@v1 | ||
- name: install requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install './funcx_sdk' | ||
python -m pip install safety | ||
- name: run safety check | ||
run: safety check | ||
|
||
safety-check-endpoint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
- uses: actions/setup-python@v1 | ||
- name: install requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install './funcx_endpoint' | ||
python -m pip install safety | ||
- name: run safety check | ||
run: safety check | ||
|
||
notify: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- safety-check-sdk | ||
- safety-check-endpoint | ||
if: failure() | ||
steps: | ||
# FIXME: make this send to a listhost or Slack | ||
- name: Send mail | ||
uses: dawidd6/action-send-mail@v3 | ||
with: | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
username: ${{secrets.MAIL_USERNAME}} | ||
password: ${{secrets.MAIL_PASSWORD}} | ||
subject: ${{ github.repository }} - Daily Check ${{ job.status }} | ||
to: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] | ||
from: funcX Tests # <[email protected]> | ||
body: The daily ${{ github.repository }} workflow failed! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ on: | |
description: "manual test" | ||
|
||
jobs: | ||
tutorial_test: | ||
smoke-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -22,25 +22,26 @@ jobs: | |
- name: Install dependencies for funcx-sdk and test requirements | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install ./funcx_sdk | ||
python -m pip install -r funcx_sdk/test-requirements.txt | ||
- name: Check for vulnerabilities in libraries | ||
run: | | ||
pip install safety | ||
safety check | ||
python -m pip install './funcx_sdk[test]' | ||
python -m pip install safety | ||
- name: Run smoke tests to check liveness of hosted services | ||
run: | | ||
pytest -v funcx_endpoint/tests/smoke_tests --api-client-id ${{ secrets.API_CLIENT_ID }} --api-client-secret ${{ secrets.API_CLIENT_SECRET }} | ||
# FIXME: make this send to a listhost or Slack | ||
- name: Send mail | ||
if: ${{ failure() }} | ||
uses: dawidd6/action-send-mail@v3 | ||
with: | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
username: ${{secrets.MAIL_USERNAME}} | ||
password: ${{secrets.MAIL_PASSWORD}} | ||
subject: ${{ github.repository }} - Tutorial test ${{ job.status }} | ||
to: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] | ||
from: funcX Tests # <[email protected]> | ||
body: The ${{ github.repository }} test ${{ github.workflow }} exited with status - ${{ job.status }}! | ||
notify: | ||
runs-on: ubuntu-latest | ||
needs: [smoke-test] | ||
if: failure() | ||
steps: | ||
# FIXME: make this send to a listhost or Slack | ||
- name: Send mail | ||
uses: dawidd6/action-send-mail@v3 | ||
with: | ||
server_address: smtp.gmail.com | ||
server_port: 465 | ||
username: ${{secrets.MAIL_USERNAME}} | ||
password: ${{secrets.MAIL_PASSWORD}} | ||
subject: ${{ github.repository }} - Tutorial test ${{ job.status }} | ||
to: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected] | ||
from: funcX Tests # <[email protected]> | ||
body: The hourly ${{ github.repository }} workflow failed! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
-r ../funcx_sdk/requirements.txt | ||
-r ../funcx_sdk/test-requirements.txt | ||
../funcx_sdk | ||
nbsphinx | ||
sphinx_rtd_theme |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.