Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 46d71bf

Browse files
Update compute plan (#89)
* Concider existing IDs in dag * Create fct updateComputePlan * Add smart contract to list * Add test * Update EXAMPLES * Changes after reviews * Fix testuple update compute plan * Rename CPTrainTask to TrainTask * Fix rebase mistakes
1 parent 973ea33 commit 46d71bf

File tree

12 files changed

+348
-117
lines changed

12 files changed

+348
-117
lines changed

EXAMPLES.md

Lines changed: 118 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1425,9 +1425,13 @@ peer chaincode invoke -n mycc -c '{"Args":["createComputePlan","{\"tag\":\"a tag
14251425
##### Command output:
14261426
```json
14271427
{
1428+
"IDToKey": {
1429+
"firstTraintupleID": "432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1430+
"secondTraintupleID": "d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299"
1431+
},
14281432
"aggregatetupleKeys": null,
14291433
"compositeTraintupleKeys": null,
1430-
"computePlanID": "c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4",
1434+
"computePlanID": "aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859",
14311435
"doneCount": 0,
14321436
"status": "todo",
14331437
"tag": "a tag is simply a string",
@@ -1441,6 +1445,82 @@ peer chaincode invoke -n mycc -c '{"Args":["createComputePlan","{\"tag\":\"a tag
14411445
"tupleCount": 3
14421446
}
14431447
```
1448+
#### ------------ Update a ComputePlan ------------
1449+
Smart contract: `updateComputePlan`
1450+
1451+
##### JSON Inputs:
1452+
```go
1453+
{
1454+
"computePlanID": string (required,required,len=64,hexadecimal),
1455+
"traintuples": (omitempty) [{
1456+
"dataManagerKey": string (required,len=64,hexadecimal),
1457+
"dataSampleKeys": [string] (required,dive,len=64,hexadecimal),
1458+
"algoKey": string (required,len=64,hexadecimal),
1459+
"id": string (required,lte=64),
1460+
"inModelsIDs": [string] (omitempty,dive,lte=64),
1461+
"tag": string (omitempty,lte=64),
1462+
}],
1463+
"aggregatetuples": (omitempty) [{
1464+
"algoKey": string (required,len=64,hexadecimal),
1465+
"id": string (required,lte=64),
1466+
"inModelsIDs": [string] (omitempty,dive,lte=64),
1467+
"tag": string (omitempty,lte=64),
1468+
"worker": string (required),
1469+
}],
1470+
"compositeTraintuples": (omitempty) [{
1471+
"dataManagerKey": string (required,len=64,hexadecimal),
1472+
"dataSampleKeys": [string] (required,dive,len=64,hexadecimal),
1473+
"algoKey": string (required,len=64,hexadecimal),
1474+
"id": string (required,lte=64),
1475+
"inHeadModelID": string (required_with=InTrunkModelID,omitempty,len=64,hexadecimal),
1476+
"inTrunkModelID": string (required_with=InHeadModelID,omitempty,len=64,hexadecimal),
1477+
"OutTrunkModelPermissions": (required){
1478+
"process": (required){
1479+
"public": bool (required),
1480+
"authorizedIDs": [string] (required),
1481+
},
1482+
},
1483+
"tag": string (omitempty,lte=64),
1484+
}],
1485+
"testtuples": (omitempty) [{
1486+
"dataManagerKey": string (omitempty,len=64,hexadecimal),
1487+
"dataSampleKeys": [string] (omitempty,dive,len=64,hexadecimal),
1488+
"objectiveKey": string (required,len=64,hexadecimal),
1489+
"tag": string (omitempty,lte=64),
1490+
"traintupleID": string (required,lte=64),
1491+
}],
1492+
}
1493+
```
1494+
##### Command peer example:
1495+
```bash
1496+
peer chaincode invoke -n mycc -c '{"Args":["updateComputePlan","{\"computePlanID\":\"aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859\",\"traintuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"aa1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"algoKey\":\"fd1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"id\":\"thirdTraintupleID\",\"inModelsIDs\":[\"firstTraintupleID\",\"secondTraintupleID\"],\"tag\":\"\"}],\"aggregatetuples\":null,\"compositeTraintuples\":null,\"testtuples\":[{\"dataManagerKey\":\"da1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"dataSampleKeys\":[\"bb1bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\",\"bb2bb7c31f62244c0f3a761cc168804227115793d01c270021fe3f7935482dcc\"],\"objectiveKey\":\"5c1d9cd1c2c1082dde0921b56d11030c81f62fbb51932758b58ac2569dd0b379\",\"tag\":\"\",\"traintupleID\":\"thirdTraintupleID\"}]}"]}' -C myc
1497+
```
1498+
##### Command output:
1499+
```json
1500+
{
1501+
"IDToKey": {
1502+
"firstTraintupleID": "432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1503+
"secondTraintupleID": "d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1504+
"thirdTraintupleID": "c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
1505+
},
1506+
"aggregatetupleKeys": null,
1507+
"compositeTraintupleKeys": null,
1508+
"computePlanID": "aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859",
1509+
"doneCount": 0,
1510+
"status": "todo",
1511+
"tag": "a tag is simply a string",
1512+
"testtupleKeys": [
1513+
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96",
1514+
"edf0895a4b0a5d4dcc12077f491bbd4b2d13237b5ea5e813689ec32c74ef1937"
1515+
],
1516+
"traintupleKeys": [
1517+
"432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1518+
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1519+
"c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
1520+
],
1521+
"tupleCount": 5
1522+
}
1523+
```
14441524
#### ------------ Query an ObjectiveLeaderboard ------------
14451525
Smart contract: `queryObjectiveLeaderboard`
14461526

@@ -1502,6 +1582,7 @@ peer chaincode invoke -n mycc -c '{"Args":["queryObjectiveLeaderboard","{\"objec
15021582
]
15031583
}
15041584
```
1585+
#### ------------ Query Compute Plan(s) ------------
15051586
Smart contract: `queryComputePlan`
15061587

15071588
##### JSON Inputs:
@@ -1512,25 +1593,32 @@ Smart contract: `queryComputePlan`
15121593
```
15131594
##### Command peer example:
15141595
```bash
1515-
peer chaincode invoke -n mycc -c '{"Args":["queryComputePlan","{\"key\":\"c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4\"}"]}' -C myc
1596+
peer chaincode invoke -n mycc -c '{"Args":["queryComputePlan","{\"key\":\"aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859\"}"]}' -C myc
15161597
```
15171598
##### Command output:
15181599
```json
15191600
{
1601+
"IDToKey": {
1602+
"firstTraintupleID": "432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1603+
"secondTraintupleID": "d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1604+
"thirdTraintupleID": "c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
1605+
},
15201606
"aggregatetupleKeys": null,
15211607
"compositeTraintupleKeys": null,
1522-
"computePlanID": "c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4",
1608+
"computePlanID": "aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859",
15231609
"doneCount": 0,
15241610
"status": "todo",
15251611
"tag": "a tag is simply a string",
15261612
"testtupleKeys": [
1527-
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96"
1613+
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96",
1614+
"edf0895a4b0a5d4dcc12077f491bbd4b2d13237b5ea5e813689ec32c74ef1937"
15281615
],
15291616
"traintupleKeys": [
15301617
"432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1531-
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299"
1618+
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1619+
"c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
15321620
],
1533-
"tupleCount": 3
1621+
"tupleCount": 5
15341622
}
15351623
```
15361624
##### Command peer example:
@@ -1541,23 +1629,31 @@ peer chaincode invoke -n mycc -c '{"Args":["queryComputePlans"]}' -C myc
15411629
```json
15421630
[
15431631
{
1632+
"IDToKey": {
1633+
"firstTraintupleID": "432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1634+
"secondTraintupleID": "d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1635+
"thirdTraintupleID": "c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
1636+
},
15441637
"aggregatetupleKeys": null,
15451638
"compositeTraintupleKeys": null,
1546-
"computePlanID": "c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4",
1639+
"computePlanID": "aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859",
15471640
"doneCount": 0,
15481641
"status": "todo",
15491642
"tag": "a tag is simply a string",
15501643
"testtupleKeys": [
1551-
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96"
1644+
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96",
1645+
"edf0895a4b0a5d4dcc12077f491bbd4b2d13237b5ea5e813689ec32c74ef1937"
15521646
],
15531647
"traintupleKeys": [
15541648
"432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1555-
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299"
1649+
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1650+
"c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
15561651
],
1557-
"tupleCount": 3
1652+
"tupleCount": 5
15581653
}
15591654
]
15601655
```
1656+
#### ------------ Cancel a ComputePlan ------------
15611657
Smart contract: `cancelComputePlan`
15621658

15631659
##### JSON Inputs:
@@ -1568,24 +1664,31 @@ Smart contract: `cancelComputePlan`
15681664
```
15691665
##### Command peer example:
15701666
```bash
1571-
peer chaincode invoke -n mycc -c '{"Args":["cancelComputePlan","{\"key\":\"c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4\"}"]}' -C myc
1667+
peer chaincode invoke -n mycc -c '{"Args":["cancelComputePlan","{\"key\":\"aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859\"}"]}' -C myc
15721668
```
15731669
##### Command output:
15741670
```json
15751671
{
1672+
"IDToKey": {
1673+
"firstTraintupleID": "432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1674+
"secondTraintupleID": "d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1675+
"thirdTraintupleID": "c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
1676+
},
15761677
"aggregatetupleKeys": null,
15771678
"compositeTraintupleKeys": null,
1578-
"computePlanID": "c51b1a4fe5a6c5abe5595ed530fbf1a9d822e6f22c57a029102db82ae71b41e4",
1679+
"computePlanID": "aef05c54d9dec12072fdcea31eee999b857fdee4a4a8beb265e263c53b2f2859",
15791680
"doneCount": 0,
15801681
"status": "canceled",
15811682
"tag": "a tag is simply a string",
15821683
"testtupleKeys": [
1583-
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96"
1684+
"1dbd49d84e00ad6f339f416af0decfaf2db8f14412786de65b597e49a6820f96",
1685+
"edf0895a4b0a5d4dcc12077f491bbd4b2d13237b5ea5e813689ec32c74ef1937"
15841686
],
15851687
"traintupleKeys": [
15861688
"432fcffdf68892f5e4adeeed8bb618beaeaecf709f840671eca724a3e3109369",
1587-
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299"
1689+
"d23f8cf290b902417ae698d68e2c6835483521d54fcbece31208517759b7c299",
1690+
"c163663889566a4c51fad3765107774891f8ed456dcc859a9a1a7fcd17b11386"
15881691
],
1589-
"tupleCount": 3
1692+
"tupleCount": 5
15901693
}
15911694
```

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Note for internal use only: See the [technical specifications](https://github.co
8787
- `registerDataSample`
8888
- `registerNode`
8989
- `registerObjective`
90+
- `updateComputePlan`
9091
- `updateDataManager`
9192
- `updateDataSample`
9293

0 commit comments

Comments
 (0)