MCPcopy Create free account
hub / github.com/PaddlePaddle/PaddleCloud / SampleSet

Class SampleSet

pipeline/src/dataset.py:9–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7
8
9class SampleSet(launch_crd.K8sCR):
10
11 def __init__(self, client=None):
12 super(SampleSet, self).__init__("batch.paddlepaddle.org", "samplesets", "v1alpha1", client)
13
14 def is_expected_conditions(self, inst, expected_conditions):
15 conditions = inst.get('status', {}).get("phase")
16 if not conditions:
17 return False, ""
18 if conditions in expected_conditions:
19 return True, conditions
20 else:
21 return False, conditions
22
23 def get_spec(self, spec):
24 return {
25 "apiVersion": "%s/%s" % (self.group, self.version),
26 "kind": "SampleSet",
27 "metadata": {
28 "name": "data-center",
29 "namespace": spec.get("namespace"),
30 },
31 "spec": {
32 "partitions": spec.get("partitions"),
33 "noSync": True,
34 "secretRef": {
35 "name": "data-center"
36 }
37 },
38 }
39
40 def get_action_status(self, action=None):
41 return ["Ready"], ["SyncFailed", "PartialReady"]
42
43
44class SampleJob(launch_crd.K8sCR):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected