Skip to content
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

[WIP] Admin API (deprecated PR) #8528

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
abc7f09
Adding initial admin api interface
madhavajay Feb 26, 2024
2b3d48f
Allow custom api endpoints to be overwritten
madhavajay Feb 26, 2024
7b104bd
Adding k8s notebook without service account
madhavajay Feb 26, 2024
e344a35
Automatically detect platform in devspace yaml
madhavajay Feb 26, 2024
141a73b
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 8, 2024
6827ed5
Update k8s notebook to BigQuery use case
IonesioJunior Mar 8, 2024
636493f
- Move APIStash to its own source file
IonesioJunior Mar 11, 2024
21b4cb6
Fix stash.update signature
IonesioJunior Mar 11, 2024
4281139
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 11, 2024
f5566aa
Fix new mypy/lint issues
IonesioJunior Mar 11, 2024
94bb4aa
Fix import order
IonesioJunior Mar 11, 2024
d3baf0a
Replace SYFT_OBJECT_VERSION
IonesioJunior Mar 11, 2024
d24b4df
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 11, 2024
3927b6e
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 12, 2024
5896bb6
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 13, 2024
a167c5c
ADD new Object structures for CustomAPI Service
IonesioJunior Mar 13, 2024
66f6581
ADD new api endpoint services
IonesioJunior Mar 13, 2024
c2a99e7
Update API service
IonesioJunior Mar 13, 2024
fc62ba2
Fix linting for devspace
IonesioJunior Mar 13, 2024
2903ce8
ADD some validation checks / ADD public/private switch method
IonesioJunior Mar 13, 2024
45ea077
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 14, 2024
d34d493
Merge branch 'dev' into madhava/admin_api
IonesioJunior Mar 14, 2024
7a7c426
Merge branch 'dev' into madhava/admin_api
jcardonnet Mar 15, 2024
b1ee99c
Ensure get_by_path returns a single item from the stash. Add document…
jcardonnet Mar 15, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
482 changes: 482 additions & 0 deletions notebooks/Experimental/k8s.ipynb

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions packages/grid/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,32 @@ vars:
CONTAINER_REGISTRY: "docker.io"
NODE_NAME: "mynode"
VERSION: "0.8.5-beta.6"
PLATFORM: $(uname -m | grep -q 'arm64' && echo "arm64" || echo "amd64")


# This is a list of `images` that DevSpace can build for this project
# We recommend to skip image building during development (devspace dev) as much as possible
images:
backend:
image: "${CONTAINER_REGISTRY}/${DOCKER_IMAGE_BACKEND}"
buildKit: {}
buildKit: { args: ["--platform", "linux/${PLATFORM}"] }
dockerfile: ./backend/backend.dockerfile
context: ../
tags:
- dev-${DEVSPACE_TIMESTAMP}
frontend:
image: "${CONTAINER_REGISTRY}/${DOCKER_IMAGE_FRONTEND}"
buildKit:
args: ["--target", "grid-ui-production"]
args:
["--target", "grid-ui-production", "--platform", "linux/${PLATFORM}"]
dockerfile: ./frontend/frontend.dockerfile
target: "grid-ui-production"
context: ./frontend
tags:
- dev-${DEVSPACE_TIMESTAMP}
seaweedfs:
image: "${CONTAINER_REGISTRY}/${DOCKER_IMAGE_SEAWEEDFS}"
buildKit: {}
buildKit: { args: ["--platform", "linux/${PLATFORM}"] }
buildArgs:
SEAWEEDFS_VERSION: ${SEAWEEDFS_VERSION}
dockerfile: ./seaweedfs/seaweedfs.dockerfile
Expand Down
2 changes: 2 additions & 0 deletions packages/syft/src/syft/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
from .service.action.action_object import ActionObject # noqa: F401
from .service.action.plan import Plan # noqa: F401
from .service.action.plan import planify # noqa: F401
from .service.api.api import api_endpoint # noqa: F401
from .service.api.api import create_new_api_endpoint as TwinAPIEndpoint # noqa: F401
from .service.code.user_code import UserCodeStatus # noqa: F401; noqa: F401
from .service.code.user_code import syft_function # noqa: F401; noqa: F401
from .service.code.user_code import syft_function_single_use # noqa: F401; noqa: F401
Expand Down
22 changes: 22 additions & 0 deletions packages/syft/src/syft/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,8 @@ def for_user(
user_verify_key: SyftVerifyKey | None = None,
) -> SyftAPI:
# relative
from ..service.api.api_service import APIService

# TODO: Maybe there is a possibility of merging ServiceConfig and APIEndpoint
from ..service.code.user_code_service import UserCodeService

Expand Down Expand Up @@ -717,6 +719,26 @@ def for_user(
)
endpoints[unique_path] = endpoint

# get admin defined custom api endpoints
method = node.get_method_with_context(APIService.get_endpoints, context)
custom_endpoints = method()
for custom_endpoint in custom_endpoints:
pre_kwargs = {"path": custom_endpoint.path}
service_path = "api.call"
path = custom_endpoint.path
api_end = custom_endpoint.path.split(".")[-1]
endpoint = APIEndpoint(
service_path=service_path,
module_path=path,
name=api_end,
description="",
doc_string="",
signature=custom_endpoint.signature,
has_self=False,
pre_kwargs=pre_kwargs,
)
endpoints[path] = endpoint

return SyftAPI(
node_name=node.name,
node_uid=node.id,
Expand Down
3 changes: 3 additions & 0 deletions packages/syft/src/syft/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from ..service.action.action_store import DictActionStore
from ..service.action.action_store import MongoActionStore
from ..service.action.action_store import SQLiteActionStore
from ..service.api.api_service import APIService
from ..service.blob_storage.service import BlobStorageService
from ..service.code.status_service import UserCodeStatusService
from ..service.code.user_code_service import UserCodeService
Expand Down Expand Up @@ -371,6 +372,7 @@ def __init__(
SyftWorkerImageService,
SyftWorkerPoolService,
SyftImageRegistryService,
APIService,
SyncService,
OutputService,
UserCodeStatusService,
Expand Down Expand Up @@ -990,6 +992,7 @@ def _construct_services(self) -> None:
SyftWorkerImageService,
SyftWorkerPoolService,
SyftImageRegistryService,
APIService,
SyncService,
OutputService,
UserCodeStatusService,
Expand Down
Loading
Loading