Skip to content

Commit f74dbaf

Browse files
JoanFMjina-bot
andauthored
chore: limit stateful feature on Windows (jina-ai#5872)
Co-authored-by: Jina Dev Bot <[email protected]>
1 parent 76c815b commit f74dbaf

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

docs/concepts/orchestration/scale-out.md

+7
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ This feature requires at least Python3.8 version when working on MacOS.
6565
6666
````
6767

68+
````{admonition} Feature not supported on Windows
69+
:class: note
70+
71+
This feature is not supported when using Windows
72+
73+
````
74+
6875
````{admonition} DocArray 0.30
6976
:class: note
7077

jina/orchestrate/deployments/__init__.py

+13-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
import subprocess
77
import threading
88
import multiprocessing
9+
import platform
10+
import sys
911
import time
1012
from argparse import Namespace
1113
from collections import defaultdict
@@ -493,7 +495,17 @@ def __init__(
493495
f'It is not supported to have {ProtocolType.WEBSOCKET.to_string()} deployment for '
494496
f'Deployments with more than one shard'
495497
)
496-
498+
is_mac_os = platform.system() == 'Darwin'
499+
is_windows_os = platform.system() == 'Windows'
500+
is_37 = sys.version_info.major == 3 and sys.version_info.minor == 7
501+
502+
if self.args.stateful and (is_windows_os or (is_mac_os and is_37)):
503+
if is_windows_os:
504+
raise RuntimeError(f'Stateful feature is not available on Windows')
505+
if is_mac_os:
506+
raise RuntimeError(
507+
f'Stateful feature when running on MacOS requires Python3.8 or newer version'
508+
)
497509
if self.args.stateful and (
498510
ProtocolType.WEBSOCKET in self.args.protocol
499511
or ProtocolType.HTTP in self.args.protocol

setup.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,10 @@ def get_extra_requires(path, add_all=True):
171171
pass
172172

173173
is_mac_os = platform.system() == 'Darwin'
174+
is_windows_os = platform.system() == 'Windows'
174175
is_37 = sys.version_info.major == 3 and sys.version_info.minor == 7
175176

176-
if ret_code == 0 and (not is_mac_os or not is_37):
177+
if ret_code == 0 and not is_windows_os and (not is_mac_os or not is_37):
177178
extra_golang_kw = {
178179
'build_golang': {'root': 'jraft', 'strip': False},
179180
'ext_modules': [

0 commit comments

Comments
 (0)