Skip to content

Commit

Permalink
Merge branch 'dev' into remove-jax-haiku
Browse files Browse the repository at this point in the history
  • Loading branch information
khoaguin authored May 23, 2024
2 parents 4b8cc4c + 39318dc commit 55487fc
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 130 deletions.
15 changes: 0 additions & 15 deletions .github/workflows/nightlies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,7 @@ jobs:
uses: OpenMined/PySyft/.github/workflows/pr-tests-stack.yml@dev
secrets: inherit

# call-pr-tests-stack-arm64:
# if: github.repository == 'OpenMined/PySyft' # don't run on forks
# uses: OpenMined/PySyft/.github/workflows/pr-tests-stack-arm64.yml@dev
# secrets: inherit

call-pr-tests-stack-public:
if: github.repository == 'OpenMined/PySyft' # don't run on forks
uses: OpenMined/PySyft/.github/workflows/pr-tests-stack-public.yml@dev
secrets: inherit

call-container-scan:
if: github.repository == 'OpenMined/PySyft' # don't run on forks
uses: OpenMined/PySyft/.github/workflows/container-scan.yml@dev
secrets: inherit

# call-rhel-tests:
# if: github.repository == 'OpenMined/PySyft' # don't run on forks
# uses: OpenMined/PySyft/.github/workflows/rhel-tests.yml@dev
# secrets: inherit
104 changes: 0 additions & 104 deletions .github/workflows/pr-tests-stack-arm64.yml

This file was deleted.

22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ $ pip install -U syft[data_science]
# from Jupyter / Python
import syft as sy
sy.requires(">=0.8.6,<0.8.7")
node = sy.orchestra.launch(name="my-domain", port=8080, dev_mode=True, reset=True)
node = sy.orchestra.launch(
name="my-domain",
port=8080,
create_producer=True,
n_consumers=1,
dev_mode=True,
reset=True, # resets database
)
```

```bash
Expand All @@ -39,7 +46,11 @@ Starting syft-node server on 0.0.0.0:8080
```python
import syft as sy
sy.requires(">=0.8.6,<0.8.7")
domain_client = sy.login(port=8080, email="[email protected]", password="changethis")
domain_client = sy.login(
port=8080,
email="[email protected]",
password="changethis"
)
```

## PySyft in 10 minutes
Expand All @@ -58,6 +69,7 @@ domain_client = sy.login(port=8080, email="[email protected]", password="change
- <a href="notebooks/api/0.8/09-blob-storage.ipynb">09-blob-storage.ipynb</a>
- <a href="notebooks/api/0.8/10-container-images.ipynb">10-container-images.ipynb</a>
- <a href="notebooks/api/0.8/11-container-images-k8s.ipynb">11-container-images-k8s.ipynb</a>
- <a href="notebooks/api/0.8/12-custom-api-endpoint.ipynb">12-custom-api-endpoint.ipynb</a>

## Deploy Kubernetes Helm Chart

Expand Down Expand Up @@ -102,15 +114,15 @@ For AWS EKS
helm install ... --set ingress.className="alb"
```

For Google GKE we need the [`gce` annotation](https://cloud.google.com/kubernetes-engine/docs/how-to/load-balance-ingress#create-ingress) annotation.
For Google GKE we need the [`gce` annotation](https://cloud.google.com/kubernetes-engine/docs/how-to/load-balance-ingress#create-ingress).

```sh
helm install ... --set ingress.class="gce"
```

## Note:

🚨 Our old deployment tool `Hagrid` has been `Deprecated`. For the updated deployment options kindly refer to
🚨 Our old deployment tool `HAGrid` has been `deprecated`. For the updated deployment options kindly refer to:

- 📚 <a href="https://github.com/OpenMined/PySyft/tree/dev/notebooks/tutorials/deployments">Deployments</a>

Expand All @@ -121,7 +133,7 @@ helm install ... --set ingress.class="gce"

# Install Notes

- PySyft 0.8.1 Requires: 🐍 `python 3.10 - 3.12` - Run: `pip install -U syft`
- PySyft 0.8.6 Requires: 🐍 `python 3.10 - 3.12` - Run: `pip install -U syft`
- PyGrid Requires: 🐳 `docker` or ☸️ `kubernetes`

# Versions
Expand Down
4 changes: 2 additions & 2 deletions packages/syft/src/syft/service/code/user_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,13 @@ def _coll_repr_(self) -> dict[str, Any]:
def user(self) -> UserView | SyftError:
api = APIRegistry.api_for(
node_uid=self.syft_node_location,
user_verify_key=self.user_verify_key,
user_verify_key=self.syft_client_verify_key,
)
if api is None:
return SyftError(
message=f"Can't access Syft API. You must login to {self.syft_node_location}"
)
return api.services.user.get_current_user()
return api.services.user.get_by_verify_key(self.user_verify_key)

@property
def status(self) -> UserCodeStatusCollection | SyftError:
Expand Down
9 changes: 6 additions & 3 deletions packages/syft/src/syft/service/request/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,14 @@ def approve(
)
if message and metadata and metadata.show_warnings and not disable_warnings:
prompt_warning_message(message=message, confirm=True)
msg = (
"Approving request ",
f"on change {self.code.service_func_name} " if is_code_request else "",
f"for domain {api.node_name}",
)

print(f"Approving request for domain {api.node_name}")
print("".join(msg))
res = api.services.request.apply(self.id, **kwargs)
# if isinstance(res, SyftSuccess):

return res

def deny(self, reason: str) -> SyftSuccess | SyftError:
Expand Down
19 changes: 18 additions & 1 deletion packages/syft/src/syft/service/user/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from .user import UserViewPage
from .user import check_pwd
from .user import salt_and_hash_password
from .user_roles import ADMIN_ROLE_LEVEL
from .user_roles import DATA_OWNER_ROLE_LEVEL
from .user_roles import DATA_SCIENTIST_ROLE_LEVEL
from .user_roles import GUEST_ROLE_LEVEL
Expand Down Expand Up @@ -220,7 +221,23 @@ def get_current_user(self, context: AuthedServiceContext) -> UserView | SyftErro
credentials=context.credentials, verify_key=context.credentials
)
if result.is_ok():
# this seems weird that we get back None as Ok(None)
user = result.ok()
if user:
return user.to(UserView)
else:
SyftError(message="User not found!")
return SyftError(message=str(result.err()))

@service_method(
path="user.get_by_verify_key", name="get_by_verify_key", roles=ADMIN_ROLE_LEVEL
)
def get_by_verify_key_endpoint(
self, context: AuthedServiceContext, verify_key: SyftVerifyKey
) -> UserView | SyftError:
result = self.stash.get_by_verify_key(
credentials=context.credentials, verify_key=verify_key
)
if result.is_ok():
user = result.ok()
if user:
return user.to(UserView)
Expand Down

0 comments on commit 55487fc

Please sign in to comment.