-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
247 changed files
with
8,820 additions
and
5,206 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,50 @@ | ||
name: PR Tests - Lint Helm Charts | ||
|
||
on: | ||
# temporary disabled | ||
# pull_request: | ||
# branches: | ||
# - dev | ||
# paths: | ||
# - packages/grid/helm/syft/** | ||
|
||
workflow_dispatch: | ||
inputs: | ||
none: | ||
description: "Run Tests Manually" | ||
required: false | ||
|
||
concurrency: | ||
group: pr-tests-helm-lint | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pr-tests-helm-lint: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
brew update | ||
brew tap FairwindsOps/tap | ||
brew install kube-linter FairwindsOps/tap/polaris | ||
# Install python deps | ||
pip install --upgrade pip | ||
pip install tox | ||
kube-linter version | ||
polaris version | ||
- name: Run Polaris | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
polaris audit --helm-chart packages/grid/helm/syft --helm-values packages/grid/helm/syft/values.yaml --format=pretty --only-show-failed-tests | ||
- name: Run Linter | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
tox -e syft.lint.helm |
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 @@ | ||
name: PR Tests - Helm Upgrade | ||
|
||
on: | ||
# Re-enable when we have a stable helm chart | ||
# pull_request: | ||
# branches: | ||
# - dev | ||
# paths: | ||
# - packages/grid/helm/syft/** | ||
|
||
workflow_dispatch: | ||
inputs: | ||
upgrade_type: | ||
description: "Select upgrade path type" | ||
required: false | ||
default: "BetaToDev" | ||
type: choice | ||
options: | ||
- BetaToDev | ||
- ProdToBeta | ||
- ProdToDev | ||
|
||
concurrency: | ||
group: pr-tests-helm-upgrade | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pr-tests-helm-upgrade: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install dependencies | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
brew update | ||
# Install python deps | ||
pip install --upgrade pip | ||
pip install tox | ||
# Install kubernetes | ||
brew install helm k3d devspace kubectl | ||
- name: Setup cluster | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
tox -e dev.k8s.start | ||
- name: Upgrade helm chart | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
# default upgrade is beta to dev, but override with input if provided | ||
UPGRADE_TYPE_INPUT=${{ github.event.inputs.upgrade_type }} | ||
export UPGRADE_TYPE=${UPGRADE_TYPE_INPUT:-BetaToDev} | ||
tox -e syft.test.helm.upgrade | ||
- name: Destroy cluster | ||
if: always() | ||
run: | | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
tox -e dev.k8s.destroyall |
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# Debugging PySyft | ||
|
||
We currently provide information on how to debug PySyft using Visual Studio Code and PyCharm. If you have any other IDE or debugger that you would like to add to this list, please feel free to contribute. | ||
|
||
## VSCode | ||
|
||
If you're running Add the following in `.vscode/launch.json` | ||
|
||
``` | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python Debugger: Remote Attach", | ||
"type": "debugpy", | ||
"request": "attach", | ||
"connect": { | ||
"host": "localhost", | ||
"port": 5678 | ||
}, | ||
"justMyCode": false, | ||
"internalConsoleOptions": "openOnSessionStart", | ||
"pathMappings": [ | ||
{ | ||
"localRoot": "${workspaceFolder}/packages/syft/src", | ||
"remoteRoot": "/root/app/syft/src" | ||
}, | ||
{ | ||
"localRoot": "${workspaceFolder}/packages/grid/backend/grid", | ||
"remoteRoot": "/root/app/grid" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
Then run | ||
|
||
```bash | ||
tox -e dev.k8s.hotreload | ||
``` | ||
|
||
And you can attach the debugger running on port 5678. | ||
|
||
## PyCharm | ||
|
||
Add the following to `packages/grid/backend/grid/__init__.py` | ||
|
||
```py | ||
import pydevd_pycharm | ||
pydevd_pycharm.settrace('your-local-addr', port=5678, suspend=False) | ||
``` | ||
|
||
Ensure that `your-local-addr` is reachable from the containers. | ||
|
||
Next, replace the debugpy install and `DEBUG_CMD` in `packages/grid/backend/grid/start.sh`: | ||
|
||
```bash | ||
# only set by kubernetes to avoid conflict with docker tests | ||
if [[ ${DEBUGGER_ENABLED} == "True" ]]; | ||
then | ||
pip install --user pydevd-pycharm==233.14475.56 # remove debugpy, add pydevd-pycharm | ||
DEBUG_CMD="" # empty the debug command | ||
fi | ||
``` | ||
|
||
If it fails to connect, check the backend logs. You might need to install a different pydevd-pycharm version. The version to be installed is shown in the log error message. | ||
|
||
Whenever you start a container, it attempts to connect to PyCharm. | ||
|
||
```bash | ||
tox -e dev.k8s.hotreload | ||
``` |
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.