Skip to content

Commit

Permalink
feat: pass internal flag to telemetry (#5134)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoanFM committed Sep 7, 2022
1 parent ddf90ef commit d1faf6e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions jina/helper.py
Expand Up @@ -966,6 +966,7 @@ def get_full_version() -> Optional[Tuple[Dict, Dict]]:
'session-id': str(random_uuid(use_uuid1=True)),
'uptime': __uptime__,
'ci-vendor': get_ci_vendor() or __unset_msg__,
'internal': 'jina-ai' in os.getenv('GITHUB_ACTION_REPOSITORY', __unset_msg__)
}

env_info = {k: os.getenv(k, __unset_msg__) for k in __jina_env__}
Expand Down
@@ -1,4 +1,5 @@
import threading
import multiprocessing
import time

import pytest
Expand Down Expand Up @@ -36,15 +37,14 @@ def test_flow_external_executor_with_gateway():
def serve_exec(**kwargs):
FooExec.serve(**kwargs)

e = threading.Event()
t = threading.Thread(
e = multiprocessing.Event()
t = multiprocessing.Process(
name='serve-exec',
target=serve_exec,
kwargs={'port_expose': external_gateway_port, 'stop_event': e},
daemon=True,
kwargs={'port': external_gateway_port, 'stop_event': e},
)
t.start()
time.sleep(3) # allow exec to start
time.sleep(5) # allow exec to start

with Flow().add(
name='external_gateway_exec', external=True, port=external_gateway_port
Expand All @@ -53,6 +53,8 @@ def serve_exec(**kwargs):
assert docs.texts == ['foo']

e.set()
t.terminate()
t.join()


class BarExec(Executor):
Expand Down

0 comments on commit d1faf6e

Please sign in to comment.