-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
133 changed files
with
2,217 additions
and
4,487 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,51 @@ | ||
name: Bandit Code Scan | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
- v1.7.x | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
jobs: | ||
bandit_scan: | ||
if: github.event.pull_request.draft == false | ||
permissions: | ||
contents: read # for actions/checkout to fetch code | ||
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results | ||
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status | ||
name: Bandit Scan | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set Filename Suffix Report Date and Time | ||
run: | | ||
echo "REPORT_DATE=$(date +'%d-%b-%Y_%H-%M-%S')" >> $GITHUB_ENV | ||
- name: Define SARIF Report Path | ||
run: echo "SARIF_REPORT_PATH=${{ github.workspace }}/results.sarif" >> $GITHUB_ENV | ||
|
||
- name: Perform Bandit Analysis | ||
uses: PyCQA/bandit-action@v1 | ||
with: | ||
configfile: 'DEFAULT' | ||
profile: 'DEFAULT' | ||
tests: 'DEFAULT' | ||
skips: 'DEFAULT' | ||
severity: 'DEFAULT' | ||
confidence: 'DEFAULT' | ||
exclude: '.svn,CVS,.bzr,.hg,.git,__pycache__,.tox,.eggs,*.egg' | ||
baseline: 'DEFAULT' | ||
ini: 'DEFAULT' | ||
targets: '.' | ||
|
||
- name: Upload Bandit SARIF Report as Artifact | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "bandit-report-summary_${{ env.REPORT_DATE }}" | ||
path: ${{ env.SARIF_REPORT_PATH }} |
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,66 @@ | ||
#--------------------------------------------------------------------------- | ||
# Workflow to run 301_MNIST_Watermarking notebook | ||
# Authors - Noopur, Payal Chaurasiya | ||
#--------------------------------------------------------------------------- | ||
name: Federated Runtime 301 MNIST Watermarking | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review] | ||
|
||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
test_federated_runtime_301_watermarking_notebook: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 20 | ||
steps: | ||
- name: Checkout OpenFL repository | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 2 # needed for detecting changes | ||
submodules: "true" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install dependencies # Without this step, fx command will not work | ||
id: install_dependencies | ||
run: | | ||
python -m pip install --upgrade pip ipython ipykernel | ||
pip install . | ||
pip install -r test-requirements.txt | ||
- name: Run Federated Runtime 301 MNIST Watermarking via pytest | ||
id: run_tests | ||
run: | | ||
python -m pytest -s tests/end_to_end/test_suites/wf_federated_runtime_tests.py -k test_federated_runtime_301_watermarking | ||
echo "Federated Runtime 301 MNIST Watermarking test run completed" | ||
- name: Print test summary | ||
id: print_test_summary | ||
if: ${{ always() }} | ||
run: | | ||
export PYTHONPATH="$PYTHONPATH:." | ||
python tests/end_to_end/utils/summary_helper.py --func_name "print_federated_runtime_score" | ||
echo "Test summary printed" | ||
- name: Tar files | ||
if: ${{ always() }} # collect artifacts regardless of failures | ||
run: | | ||
tar -cvf notebook_301.tar --exclude="__pycache__" $HOME/results --ignore-failed-read | ||
echo "TAR file created" | ||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ always() }} # collect artifacts regardless of failures | ||
with: | ||
name: federated_runtime_301_watermarking_${{ github.run_id }} | ||
path: notebook_301.tar |
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
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
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 |
---|---|---|
|
@@ -14,10 +14,10 @@ permissions: | |
contents: read | ||
|
||
jobs: | ||
run_notebook: | ||
wf_local_101_mnist: | ||
if: github.event.pull_request.draft == false | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout OpenFL repository | ||
uses: actions/[email protected] | ||
|
@@ -31,16 +31,17 @@ jobs: | |
with: | ||
python-version: "3.10" | ||
|
||
- name: Install Jupyter Lab Package | ||
run: pip install jupyterlab | ||
- name: Install Papermill Package | ||
run: python -m pip install --upgrade pip ipython ipykernel papermill | ||
|
||
- name: Run Notebook | ||
run: | | ||
jupyter nbconvert --execute --to notebook ./openfl-tutorials/experimental/workflow/101_MNIST.ipynb | ||
cd openfl-tutorials/experimental/workflow | ||
papermill 101_MNIST.ipynb 101_MNIST_output.ipynb --request-save-on-cell-execute --log-output --autosave-cell-every 30 | ||
echo "Notebook run completed" | ||
- name: Tar files | ||
run: tar -cvf notebook.tar ./openfl-tutorials/experimental/workflow/101_MNIST.nbconvert.ipynb | ||
run: tar -cvf notebook.tar ./openfl-tutorials/experimental/workflow/101_MNIST_output.ipynb | ||
|
||
- name: Upload Artifacts | ||
uses: actions/upload-artifact@v4 | ||
|
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
Oops, something went wrong.