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

merge dev #9259

Merged
merged 33 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7a270bf
added dirty methods for request status filtering
teo-milea Aug 30, 2024
dc390b8
added data review notebook
teo-milea Aug 30, 2024
05d793d
merge eelco branch
teo-milea Aug 30, 2024
dcc33b4
fix merge
teo-milea Aug 30, 2024
5ee7acc
added deposit result
teo-milea Aug 30, 2024
2a0e032
Merge branch 'dev' of github.com:OpenMined/PySyft into teo/data_revie…
teo-milea Sep 2, 2024
22c9b5a
added tests for data review
teo-milea Sep 2, 2024
23d65ec
fix linting
teo-milea Sep 2, 2024
f1dd128
Merge branch 'dev' into teo/data_review_test
teo-milea Sep 2, 2024
68dc536
remove unused assert
teo-milea Sep 2, 2024
f3e5d93
Merge branch 'dev' into teo/data_review_test
teo-milea Sep 2, 2024
7f7c977
Merge branch 'dev' into teo/data_review_test
koenvanderveen Sep 3, 2024
b886389
delete the stateful set of worker pool once the pool is deleted
shubham3121 Sep 3, 2024
1b6af41
Merge branch 'dev' into shubham/pool-different-image
koenvanderveen Sep 3, 2024
b5f5c3f
Increate create_pool_timeout
IonesioJunior Sep 3, 2024
90b00b7
[syft]bump version
alfred-openmined-bot Sep 3, 2024
1da40cb
add waits to delete_pool
BrendanSchell Sep 3, 2024
2f5a804
Merge branch 'dev' into shubham/pool-different-image
BrendanSchell Sep 3, 2024
8f09272
Merge pull request #9249 from OpenMined/shubham/pool-different-image
BrendanSchell Sep 3, 2024
a81e4b6
Adding dynaconf
madhavajay Sep 4, 2024
1b40e37
Fix bug if there is no root folder in test_settings
madhavajay Sep 4, 2024
1f8f56c
Marking this flappy test as xfail
madhavajay Sep 4, 2024
abb62db
Merge pull request #9253 from madhavajay/madhava/dynaconf
madhavajay Sep 4, 2024
d6da660
Merge pull request #9254 from madhavajay/madhava/fix_test_settings
madhavajay Sep 4, 2024
3f7960a
Merge pull request #9255 from madhavajay/madhava/mark_gateway_test_xfail
madhavajay Sep 4, 2024
d60722a
Merge pull request #9236 from OpenMined/teo/data_review_test
madhavajay Sep 4, 2024
5cfc524
[syft]bump version
alfred-openmined-bot Sep 4, 2024
686e422
Fix for base condition where there is no root dir
madhavajay Sep 4, 2024
91e98f7
Merge pull request #9256 from madhavajay/madhava/test_fix
madhavajay Sep 4, 2024
129daa9
[helm] configure otlp endpoint
yashgorana Sep 4, 2024
9d04be3
[helm] fix template error
yashgorana Sep 4, 2024
e7bbcc7
[backend] drop echo
yashgorana Sep 4, 2024
1096dd2
Merge pull request #9258 from OpenMined/yash/otel-config
madhavajay Sep 4, 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
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.9.1-beta.9
current_version = 0.9.1-beta.11
tag = False
tag_name = {new_version}
commit = True
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mono Repo Global Version
__version__ = "0.9.1-beta.9"
__version__ = "0.9.1-beta.11"
# elsewhere we can call this file: `python VERSION` and simply take the stdout

# stdlib
Expand Down
273 changes: 273 additions & 0 deletions notebooks/scenarios/bigquery/042-data_review.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,273 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# stdlib\n",
"import os\n",
"\n",
"environment = os.environ.get(\"ORCHESTRA_DEPLOYMENT_TYPE\", \"python\")\n",
"environment"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# third party\n",
"\n",
"# syft absolute\n",
"import syft as sy"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"SERVER_PORT = \"8080\"\n",
"SERVER_URL = f\"http://localhost:{SERVER_PORT}\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"server = sy.orchestra.launch(\n",
" name=\"bigquery-high\",\n",
" dev_mode=True,\n",
" server_side_type=\"high\",\n",
" # reset=True,\n",
" port=SERVER_PORT,\n",
" n_consumers=4, # How many workers to be spawned\n",
" create_producer=True, # Can produce more workers\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"ADMIN_EMAIL, ADMIN_PW = \"[email protected]\", \"bqpw2\"\n",
"high_client = sy.login(\n",
" url=\"http://localhost:8080\", email=ADMIN_EMAIL, password=ADMIN_PW\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_approved()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests[2].code"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests[2].code()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"job = high_client.requests[2].code(blocking=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"job.wait().get()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_pending()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for request in high_client.requests.get_all_pending():\n",
" if request.code.service_func_name.startswith(\"wrong_syntax_query\"):\n",
" bad_request = request\n",
" if request.code.service_func_name.startswith(\"simple_query\"):\n",
" good_request = request"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"good_job = good_request.code(blocking=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"good_job.wait()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"good_request.deposit_result(good_job.info, approve=True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"high_client.requests.get_all_approved()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# stdlib\n",
"import json\n",
"\n",
"# third party\n",
"from job_helpers import resolve_request\n",
"\n",
"request_dict = {}\n",
"\n",
"for request in high_client.requests:\n",
" request_id, request_status = resolve_request(request)\n",
" request_dict[str(request_id)] = str(request_status)\n",
"\n",
"with open(\".requests.json\", \"w\") as fp:\n",
" json.dump(request_dict, fp)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bad_job = bad_request.code(blocking=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"bad_job"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"retry_good_job = good_request.code(blocking=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"retry_good_job.wait()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "syft_3.12",
"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.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
39 changes: 38 additions & 1 deletion notebooks/scenarios/bigquery/job_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import re
import secrets
import textwrap
from typing import Any

# third party
from helpers import TestUser
Expand Down Expand Up @@ -282,6 +283,15 @@ def create_jobs(users: list[TestUser], total_jobs: int = 10) -> list[TestJob]:
return jobs


def submit_job(job: TestJob) -> tuple[Any, str]:
client = job.client
response = client.api.services.bigquery.submit_query(
func_name=job.func_name, query=job.query
)
job.code_path = extract_code_path(response)
return response


def extract_code_path(response) -> str | None:
pattern = r"client\.code\.(\w+)\(\)"
match = re.search(pattern, str(response))
Expand All @@ -291,9 +301,36 @@ def extract_code_path(response) -> str | None:
return None


def resolve_request(request):
service_func_name = request.code.service_func_name
if service_func_name.startswith("simple_query"):
request.approve() # approve because it is good
if service_func_name.startswith("wrong_asset_query"):
request.approve() # approve because it is bad
if service_func_name.startswith("wrong_syntax_query"):
request.approve() # approve because it is bad
if service_func_name.startswith("job_too_much_text"):
request.deny(reason="too long, boring!") # deny because it is bad
if service_func_name.startswith("job_long_name"):
request.deny(reason="too long, boring!") # deny because it is bad
if service_func_name.startswith("job_funcname_xss"):
request.deny(reason="too long, boring!") # never reach doesnt matter
if service_func_name.startswith("job_query_xss"):
request.approve() # approve because it is bad
if service_func_name.startswith("job_many_columns"):
request.approve() # approve because it is bad

return (request.id, request.status)


create_job_functions = [
create_simple_query_job, # quick way to increase the odds
create_simple_query_job,
create_simple_query_job,
create_simple_query_job,
create_simple_query_job,
create_simple_query_job,
# create_wrong_asset_query,
create_wrong_asset_query,
create_wrong_syntax_query,
create_long_query_job,
create_query_long_name,
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/VERSION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Mono Repo Global Version
__version__ = "0.9.1-beta.9"
__version__ = "0.9.1-beta.11"
# elsewhere we can call this file: `python VERSION` and simply take the stdout

# stdlib
Expand Down
2 changes: 1 addition & 1 deletion packages/grid/backend/grid/images/worker_cpu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# NOTE: This dockerfile will be built inside a syft-backend container in PROD
# Hence COPY will not work the same way in DEV vs. PROD

ARG SYFT_VERSION_TAG="0.9.1-beta.9"
ARG SYFT_VERSION_TAG="0.9.1-beta.11"
FROM openmined/syft-backend:${SYFT_VERSION_TAG}

# should match base image python version
Expand Down
12 changes: 1 addition & 11 deletions packages/grid/backend/grid/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ APPDIR=${APPDIR:-$HOME/app}
RELOAD=""
ROOT_PROC=""

echo "Starting with TRACING=${TRACING}"

if [[ ${DEV_MODE} == "True" ]];
then
echo "Hot-reload Enabled"
Expand All @@ -30,18 +28,10 @@ fi

if [[ ${TRACING} == "true" ]];
then
echo "OpenTelemetry Enabled"

# TODOs:
# ! Handle case when OTEL_EXPORTER_OTLP_ENDPOINT is not set.
# ! syft-signoz-otel-collector.platform:4317 should be plumbed through helm charts
# ? Kubernetes OTel operator is recommended by signoz
export OTEL_PYTHON_LOG_CORRELATION=${OTEL_PYTHON_LOG_CORRELATION:-true}
export OTEL_EXPORTER_OTLP_ENDPOINT=${OTEL_EXPORTER_OTLP_ENDPOINT:-"http://syft-signoz-otel-collector.platform:4317"}
export OTEL_EXPORTER_OTLP_PROTOCOL=${OTEL_EXPORTER_OTLP_PROTOCOL:-grpc}

# TODO: uvicorn postfork is not stable with OpenTelemetry
# ROOT_PROC="opentelemetry-instrument"
echo "OpenTelemetry Enabled. Endpoint=$OTEL_EXPORTER_OTLP_ENDPOINT Protocol=$OTEL_EXPORTER_OTLP_PROTOCOL"
else
echo "OpenTelemetry Disabled"
fi
Expand Down
Loading
Loading