cloudpss 4.0.16__py3-none-any.whl → 4.0.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- cloudpss/runner/MessageStreamReceiver.py +2 -3
- cloudpss/runner/runner.py +13 -6
- cloudpss/version.py +1 -1
- {cloudpss-4.0.16.dist-info → cloudpss-4.0.18.dist-info}/METADATA +2 -2
- {cloudpss-4.0.16.dist-info → cloudpss-4.0.18.dist-info}/RECORD +7 -7
- {cloudpss-4.0.16.dist-info → cloudpss-4.0.18.dist-info}/WHEEL +0 -0
- {cloudpss-4.0.16.dist-info → cloudpss-4.0.18.dist-info}/top_level.txt +0 -0
@@ -19,7 +19,7 @@ class Message(object):
|
|
19
19
|
class MessageStreamReceiver(object):
|
20
20
|
"""消息流读取函数结果"""
|
21
21
|
|
22
|
-
def __init__(self, id, db):
|
22
|
+
def __init__(self, id, db, **kwargs):
|
23
23
|
self.origin = os.environ.get('CLOUDPSS_API_URL',
|
24
24
|
'https://cloudpss.net/')
|
25
25
|
self.id = id
|
@@ -61,8 +61,6 @@ class MessageStreamReceiver(object):
|
|
61
61
|
if "when" not in msg:
|
62
62
|
msg['when']= datetime.datetime.now()
|
63
63
|
self.db.storeMessage(msg)
|
64
|
-
if(msg['type']=='terminate'):
|
65
|
-
self.close(self.ws)
|
66
64
|
|
67
65
|
def on_error(self, ws, error):
|
68
66
|
msg = {
|
@@ -88,6 +86,7 @@ class MessageStreamReceiver(object):
|
|
88
86
|
|
89
87
|
def close(self, ws):
|
90
88
|
ws.close()
|
89
|
+
self._status = 1
|
91
90
|
|
92
91
|
def status(self):
|
93
92
|
return self._status
|
cloudpss/runner/runner.py
CHANGED
@@ -74,6 +74,7 @@ class Runner(Generic[T]):
|
|
74
74
|
"""
|
75
75
|
if self.receiver is None:
|
76
76
|
raise Exception('not find receiver')
|
77
|
+
time.sleep(0)
|
77
78
|
return self.receiver.status()
|
78
79
|
|
79
80
|
def __listen(self, **kwargs):
|
@@ -142,6 +143,16 @@ class Runner(Generic[T]):
|
|
142
143
|
t= [ i.split('=') for i in re.split(r'\s+',debug) if i.find('=')>0]
|
143
144
|
for i in t:
|
144
145
|
debugargs[i[0]]=i[1]
|
146
|
+
|
147
|
+
context= [
|
148
|
+
function,
|
149
|
+
rid,
|
150
|
+
f"model/@sdk/{str(int(time.time() * random.random()))}",
|
151
|
+
]
|
152
|
+
|
153
|
+
PARENT_JOB_ID =kwargs.get("PARENT_JOB_ID",None)
|
154
|
+
if PARENT_JOB_ID is not None:
|
155
|
+
context.append(f"job/parent/{PARENT_JOB_ID}")
|
145
156
|
variables = {
|
146
157
|
"input": {
|
147
158
|
"args": {
|
@@ -150,11 +161,7 @@ class Runner(Generic[T]):
|
|
150
161
|
"_ModelArgs": config["args"],
|
151
162
|
"implement":implement
|
152
163
|
},
|
153
|
-
"context":
|
154
|
-
function,
|
155
|
-
rid,
|
156
|
-
f"model/@sdk/{str(int(time.time() * random.random()))}",
|
157
|
-
],
|
164
|
+
"context": context,
|
158
165
|
"policy": policy,
|
159
166
|
"debug":debugargs
|
160
167
|
}
|
@@ -184,7 +191,7 @@ class Runner(Generic[T]):
|
|
184
191
|
|
185
192
|
|
186
193
|
query = '''mutation($input:CreateJobInput!){job:createJob(input:$input){id input output status position}}'''
|
187
|
-
variables = Runner.__createJobVariables(job, config, revisionHash, rid,policy)
|
194
|
+
variables = Runner.__createJobVariables(job, config, revisionHash, rid,policy, **kwargs)
|
188
195
|
r = graphql_request(query, variables)
|
189
196
|
if 'errors' in r:
|
190
197
|
raise Exception(r['errors'])
|
cloudpss/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '4.0.
|
1
|
+
__version__ = '4.0.18'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: cloudpss
|
3
|
-
Version: 4.0.
|
3
|
+
Version: 4.0.18
|
4
4
|
Summary: cloudpss sdk
|
5
5
|
Home-page: https://www.cloudpss.net
|
6
6
|
Author: cloudpss
|
@@ -18,7 +18,7 @@ Requires-Dist: PyJWT
|
|
18
18
|
Requires-Dist: numpy
|
19
19
|
Requires-Dist: PyYAML
|
20
20
|
Requires-Dist: requests
|
21
|
-
Requires-Dist: websocket-client
|
21
|
+
Requires-Dist: websocket-client (>=1.4.0)
|
22
22
|
Requires-Dist: pytz
|
23
23
|
Requires-Dist: deprecated
|
24
24
|
Requires-Dist: zstandard
|
@@ -1,6 +1,6 @@
|
|
1
1
|
cloudpss/__init__.py,sha256=Ov8K45KxSsPalPErvTRUb2GvPdJ3myucFqx7s37_YZo,777
|
2
2
|
cloudpss/verify.py,sha256=KF4Gd59DGvCyIEkRD7rNnekWw22XxJpi3DW6keb6j4c,1498
|
3
|
-
cloudpss/version.py,sha256=
|
3
|
+
cloudpss/version.py,sha256=HtpvLSSEp0Li-XbWpJi-tnvxg2kOETfbOBfNmmqOwaQ,22
|
4
4
|
cloudpss/asyncio/__init__.py,sha256=CJGopQl_vz3z3fJsK7NjMX5uzkzfrJrbqKVhyYqlYWc,198
|
5
5
|
cloudpss/asyncio/job/__init__.py,sha256=3UIFZYjJTzuckM61o8kim1c3PWt2SSHTL72jrGu5IzI,51
|
6
6
|
cloudpss/asyncio/job/job.py,sha256=ExA-8JVOWWW5neVvNazPk4i3Z-q8xqYBL4qXU1m3rgM,3891
|
@@ -57,11 +57,11 @@ cloudpss/runner/DSLabResult.py,sha256=xJqKA3e1KSXQmLDe9_T6fG1exdE9j7EjfIfvBMmqiJ
|
|
57
57
|
cloudpss/runner/IESLabEvaluationResult.py,sha256=uFNLiN5kzlzSGlLIq3ybuRwB-ufYytflVrXV5g7voOU,5841
|
58
58
|
cloudpss/runner/IESLabPlanResult.py,sha256=dCyTbMtITy9XDjE42knrpJrvaH7dvFgfQMZbx9hybRs,6862
|
59
59
|
cloudpss/runner/IESLabTypicalDayResult.py,sha256=3egAzmv32sr4wKaVgLxsM75ScSb08F4-iLEbuPkoi_c,8001
|
60
|
-
cloudpss/runner/MessageStreamReceiver.py,sha256=
|
60
|
+
cloudpss/runner/MessageStreamReceiver.py,sha256=dT-rKslQbRt3bMTGXupa1YrocHl2zTWOCHlsXcbgfhs,2812
|
61
61
|
cloudpss/runner/__init__.py,sha256=aZ00V2AzQNBbER0xi6pqFFyiLFM-6r1fxvzdxxUJA_4,241
|
62
62
|
cloudpss/runner/receiver.py,sha256=d8vOtBJ_Iqo3syJXgFFxwii1MXF7CyHRoXy6eT81Zq4,4096
|
63
63
|
cloudpss/runner/result.py,sha256=GFpd7848gsLRuzhVcWbCwmAjR84Lhik_3pNCjOV8VOY,13291
|
64
|
-
cloudpss/runner/runner.py,sha256=
|
64
|
+
cloudpss/runner/runner.py,sha256=A100N93JsKKougZItU88Fw8W8X3k8TuCPXqy8ECrlTQ,8003
|
65
65
|
cloudpss/runner/storage.py,sha256=zFET_zwPIOF2Cnh9sgFiS0HFxV1OmVsU34bGUQ6PpkA,4162
|
66
66
|
cloudpss/runner/transform.py,sha256=krOgTZiJSJAb5QSwerAqlbC4Ma0PKi__0WOZlAxw4O8,11613
|
67
67
|
cloudpss/utils/IO.py,sha256=Uh1NOlBn15Jl5_aWS2QRO2-QsKlFT9o8DPtP8-8Z2PA,5314
|
@@ -71,7 +71,7 @@ cloudpss/utils/graphqlUtil.py,sha256=swl6XT1UmUQHdHjMWw3M0i8meEmVKNQvX0SHsbgg8TU
|
|
71
71
|
cloudpss/utils/httprequests.py,sha256=-RYi1Dc4QDqqupuw0x-lq74dFvCqPrZfCJKgrdolEpk,1643
|
72
72
|
cloudpss/utils/matlab.py,sha256=SLwVt790BjklJK2XNELt9R2n_1ej9Y8QsTIdFkKXLWE,795
|
73
73
|
cloudpss/utils/yamlLoader.py,sha256=KRlRkHFltOjqxa_sesdBLf1W5J7XTgvubszsSw-XR0U,2885
|
74
|
-
cloudpss-4.0.
|
75
|
-
cloudpss-4.0.
|
76
|
-
cloudpss-4.0.
|
77
|
-
cloudpss-4.0.
|
74
|
+
cloudpss-4.0.18.dist-info/METADATA,sha256=LU9FgheEEf9VhPnO0CLONapU-EY7T5b_2bS07AY-x5E,2379
|
75
|
+
cloudpss-4.0.18.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
76
|
+
cloudpss-4.0.18.dist-info/top_level.txt,sha256=wS9qPU4-aWM9ouzMOx34Nlq-GkdQKpr9vBskwut1BD8,9
|
77
|
+
cloudpss-4.0.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|