Skip to content

Commit

Permalink
Merge pull request #8632 from madhavajay/madhava/rathole
Browse files Browse the repository at this point in the history
Added initial prototype for rathole
  • Loading branch information
yashgorana authored Jun 30, 2024
2 parents c80d3c2 + c2ab102 commit 9939108
Show file tree
Hide file tree
Showing 43 changed files with 1,820 additions and 392 deletions.
209 changes: 209 additions & 0 deletions notebooks/Experimental/Network.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "bd9a2226-3e53-4f27-9213-75a8c3ff9176",
"metadata": {},
"outputs": [],
"source": [
"# syft absolute\n",
"import syft as sy"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fddf8d07-d154-4284-a27b-d74e35d3f851",
"metadata": {},
"outputs": [],
"source": [
"gateway_client = sy.login(\n",
" url=\"http://localhost\", port=9081, email=\"[email protected]\", password=\"changethis\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8f7b106d-b784-45d8-b54d-4ce2de2da453",
"metadata": {},
"outputs": [],
"source": [
"domain_client = sy.login(\n",
" url=\"http://localhost\", port=9082, email=\"[email protected]\", password=\"changethis\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ff504949-620d-4e26-beee-0d39e0e502eb",
"metadata": {},
"outputs": [],
"source": [
"domain_client.connect_to_gateway(gateway_client, reverse_tunnel=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ba7bc71a-4e6a-4429-9588-7b3d0ed19e27",
"metadata": {},
"outputs": [],
"source": [
"gateway_client.api.services.request"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "5b4984e1-331e-4fd8-b012-768fc613f48a",
"metadata": {},
"outputs": [],
"source": [
"# gateway_client.api.services.request[0].approve()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "90dc44bd",
"metadata": {},
"outputs": [],
"source": [
"node_peers = gateway_client.api.network.get_all_peers()\n",
"node_peers"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8c06aaa6-4157-42d1-959f-9d47722a3420",
"metadata": {},
"outputs": [],
"source": [
"node_peer = gateway_client.api.network.get_all_peers()[0]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cb63a77b",
"metadata": {},
"outputs": [],
"source": [
"node_peer.node_routes"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "61882e86",
"metadata": {},
"outputs": [],
"source": [
"node_peer.node_routes[0].__dict__"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fb19dbc6-869b-46dc-92e3-5e75ee6d0b06",
"metadata": {},
"outputs": [],
"source": [
"domain_client.api.network.get_all_peers()[0].node_routes[0].__dict__"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "32d09a51",
"metadata": {},
"outputs": [],
"source": [
"# node_peer.client_with_key(sy.SyftSigningKey.generate())"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b7d9e41d",
"metadata": {},
"outputs": [],
"source": [
"# gateway_client.api.network.delete_route(node_peer.verify_key, node_peer.node_routes[1])"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8fa24ec7",
"metadata": {},
"outputs": [],
"source": [
"gateway_client"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3a081250-abc3-43a3-9e06-ff0c3a362ebf",
"metadata": {},
"outputs": [],
"source": [
"gateway_client.peers"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b6fedfe4-9362-47c9-9342-5cf6eacde8ab",
"metadata": {},
"outputs": [],
"source": [
"domain_client_proxy = gateway_client.peers[0]"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f1940e00-0337-4b56-88c2-d70f397a7016",
"metadata": {},
"outputs": [],
"source": [
"domain_client_proxy.connection"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "613125c5-6321-4238-852c-ff0cfcd9526a",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.1.-1"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
3 changes: 3 additions & 0 deletions packages/grid/backend/grid/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ def get_emails_enabled(self) -> Self:
ASSOCIATION_REQUEST_AUTO_APPROVAL: bool = str_to_bool(
os.getenv("ASSOCIATION_REQUEST_AUTO_APPROVAL", "False")
)
REVERSE_TUNNEL_ENABLED: bool = str_to_bool(
os.getenv("REVERSE_TUNNEL_ENABLED", "false")
)
model_config = SettingsConfigDict(case_sensitive=True)


Expand Down
4 changes: 4 additions & 0 deletions packages/grid/default.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TRAEFIK_PUBLIC_TAG=traefik-public
STACK_NAME=grid-openmined-org
DOCKER_IMAGE_BACKEND=openmined/grid-backend
DOCKER_IMAGE_FRONTEND=openmined/grid-frontend
DOCKER_IMAGE_RATHOLE=openmined/grid-rathole
DOCKER_IMAGE_TRAEFIK=traefik
TRAEFIK_VERSION=v2.11.0
REDIS_VERSION=6.2
Expand Down Expand Up @@ -109,3 +110,6 @@ ENABLE_SIGNUP=False

# Enclave Attestation
DOCKER_IMAGE_ENCLAVE_ATTESTATION=openmined/grid-enclave-attestation

# Rathole Config
RATHOLE_PORT=2333
Loading

0 comments on commit 9939108

Please sign in to comment.