Skip to content

Commit 0078f22

Browse files
feat: add bulk_cid in requestorder
1 parent 3609370 commit 0078f22

File tree

7 files changed

+38
-0
lines changed

7 files changed

+38
-0
lines changed

CLI.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,7 @@ Options:
10671067
| --dataset \<address\|"deployed"\> | dataset address, use "deployed" to use last deployed from "deployed.json" |
10681068
| --workerpool \<address\|"deployed"\> | workerpool address, use "deployed" to use last deployed from "deployed.json" |
10691069
| --args \<string\> | specify the arguments to pass to the app |
1070+
| --bulk-cid \<CID\> | specify the bulk CID to use for the request |
10701071
| --input-files \<fileUrl\> | specify the URL of input files to be used by the app<br/>\* usage: --input-files https://example.com/foo.txt,https://example.com/bar.zip |
10711072
| --secret \<secretMapping...\> | specify the requester secrets mappings (\<appSecretKey\>=\<requesterSecretName\>) to use in the app (only available for TEE tasks, use with --tag tee)<br/>\* usage: <br/> \* \[command\] \[args\] --secret 1=login 2=password<br/> \* \[command\] \[args\] --secret 1=login --secret 2=password<br/> \* \[command\] --secret 1=login --secret 2=password -- \[args\]<br/>\* please note that this option is variadic, any number of mappings can be passed, use `--` to stop the list<br/> |
10721073
| --category \<id\> | id of the task category |
@@ -1109,6 +1110,7 @@ Options:
11091110
| --dataset-price \<amount unit...\> | dataset price per task (default unit nRLC) |
11101111
| --workerpool-price \<amount unit...\> | workerpool price per task (default unit nRLC) |
11111112
| --args \<string\> | specify the arguments to pass to the app |
1113+
| --bulk-cid \<CID\> | specify the bulk CID to use for the request |
11121114
| --input-files \<fileUrl\> | specify the URL of input files to be used by the app<br/>\* usage: --input-files https://example.com/foo.txt,https://example.com/bar.zip |
11131115
| --secret \<secretMapping...\> | specify the requester secrets mappings (\<appSecretKey\>=\<requesterSecretName\>) to use in the app (only available for TEE tasks, use with --tag tee)<br/>\* usage: <br/> \* \[command\] \[args\] --secret 1=login 2=password<br/> \* \[command\] \[args\] --secret 1=login --secret 2=password<br/> \* \[command\] --secret 1=login --secret 2=password -- \[args\]<br/>\* please note that this option is variadic, any number of mappings can be passed, use `--` to stop the list<br/> |
11141116
| --category \<id\> | id of the task category |

docs/interfaces/internal_.RequestorderParams.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
### Properties
1010

11+
- [bulk\_cid](internal_.RequestorderParams.md#bulk_cid)
1112
- [iexec\_args](internal_.RequestorderParams.md#iexec_args)
1213
- [iexec\_input\_files](internal_.RequestorderParams.md#iexec_input_files)
1314
- [iexec\_result\_encryption](internal_.RequestorderParams.md#iexec_result_encryption)
@@ -17,6 +18,16 @@
1718

1819
## Properties
1920

21+
### bulk\_cid
22+
23+
`Optional` **bulk\_cid**: `string`
24+
25+
bulk CID for the request
26+
27+
default none
28+
29+
___
30+
2031
### iexec\_args
2132

2233
`Optional` **iexec\_args**: `string`

src/cli/cmd/iexec-app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
datasetorderSchema,
2020
apporderSchema,
2121
requestorderSchema,
22+
stringSchema,
2223
} from '../../common/utils/validator.js';
2324
import { sconeTeeApp, gramineTeeApp } from '../utils/templates.js';
2425
import {
@@ -574,6 +575,7 @@ run
574575
.option(...orderOption.dataset())
575576
.option(...orderOption.workerpool())
576577
.option(...orderOption.requestArgs())
578+
.option(...orderOption.requestBulkCid())
577579
.option(...orderOption.requestInputFiles())
578580
.option(...orderOption.requestSecrets())
579581
.option(...orderOption.category())
@@ -674,6 +676,8 @@ run
674676

675677
const inputParams = await paramsSchema().validate(opts.params);
676678
const inputParamsArgs = await paramsArgsSchema().validate(opts.args);
679+
// TODO bulkCid validation
680+
const inputParamsBulkCid = await stringSchema().validate(opts.bulkCid);
677681
const inputParamsInputFiles =
678682
await paramsInputFilesArraySchema().validate(opts.inputFiles);
679683

@@ -708,6 +712,9 @@ run
708712
...(inputParamsArgs !== undefined && {
709713
[IEXEC_REQUEST_PARAMS.IEXEC_ARGS]: inputParamsArgs,
710714
}),
715+
...(inputParamsBulkCid !== undefined && {
716+
[IEXEC_REQUEST_PARAMS.IEXEC_BULK_CID]: inputParamsBulkCid,
717+
}),
711718
...(inputParamsInputFiles !== undefined && {
712719
[IEXEC_REQUEST_PARAMS.IEXEC_INPUT_FILES]: inputParamsInputFiles,
713720
}),
@@ -1169,6 +1176,7 @@ requestRun
11691176
.option(...orderOption.datasetprice())
11701177
.option(...orderOption.workerpoolprice())
11711178
.option(...orderOption.requestArgs())
1179+
.option(...orderOption.requestBulkCid())
11721180
.option(...orderOption.requestInputFiles())
11731181
.option(...orderOption.requestSecrets())
11741182
.option(...orderOption.category())
@@ -1228,6 +1236,8 @@ requestRun
12281236

12291237
const inputParams = await paramsSchema().validate(opts.params);
12301238
const inputParamsArgs = await paramsArgsSchema().validate(opts.args);
1239+
// TODO bulkCid validation
1240+
const inputParamsBulkCid = await stringSchema().validate(opts.bulkCid);
12311241
const inputParamsInputFiles =
12321242
await paramsInputFilesArraySchema().validate(opts.inputFiles);
12331243
const inputParamsSecrets =
@@ -1261,6 +1271,9 @@ requestRun
12611271
...(inputParamsArgs !== undefined && {
12621272
[IEXEC_REQUEST_PARAMS.IEXEC_ARGS]: inputParamsArgs,
12631273
}),
1274+
...(inputParamsBulkCid !== undefined && {
1275+
[IEXEC_REQUEST_PARAMS.IEXEC_BULK_CID]: inputParamsBulkCid,
1276+
}),
12641277
...(inputParamsInputFiles !== undefined && {
12651278
[IEXEC_REQUEST_PARAMS.IEXEC_INPUT_FILES]: inputParamsInputFiles,
12661279
}),

src/cli/utils/cli-helper.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -498,6 +498,10 @@ export const orderOption = {
498498
'--args <string>',
499499
'specify the arguments to pass to the app',
500500
],
501+
requestBulkCid: () => [
502+
'--bulk-cid <CID>',
503+
'specify the bulk CID to use for the request',
504+
],
501505
requestSecrets: () => [
502506
'--secret <secretMapping...>',
503507
'specify the requester secrets mappings (<appSecretKey>=<requesterSecretName>) to use in the app (only available for TEE tasks, use with --tag tee)\n* usage: \n * [command] [args] --secret 1=login 2=password\n * [command] [args] --secret 1=login --secret 2=password\n * [command] --secret 1=login --secret 2=password -- [args]\n* please note that this option is variadic, any number of mappings can be passed, use `--` to stop the list\n',

src/common/utils/constant.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export const IEXEC_REQUEST_PARAMS = {
4343
IEXEC_RESULT_ENCRYPTION: 'iexec_result_encryption',
4444
IEXEC_RESULT_STORAGE_PROVIDER: 'iexec_result_storage_provider',
4545
IEXEC_RESULT_STORAGE_PROXY: 'iexec_result_storage_proxy',
46+
IEXEC_BULK_CID: 'bulk_cid',
4647
};
4748

4849
export const ANY = 'any';

src/common/utils/validator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ export const objParamsSchema = () =>
312312
object({
313313
[IEXEC_REQUEST_PARAMS.IEXEC_ARGS]: paramsArgsSchema(),
314314
[IEXEC_REQUEST_PARAMS.IEXEC_INPUT_FILES]: paramsInputFilesArraySchema(),
315+
[IEXEC_REQUEST_PARAMS.IEXEC_BULK_CID]: string().notRequired(), // TODO add CID validation
315316
[IEXEC_REQUEST_PARAMS.IEXEC_RESULT_ENCRYPTION]: paramsEncryptResultSchema(),
316317
[IEXEC_REQUEST_PARAMS.IEXEC_RESULT_STORAGE_PROVIDER]: string().when(
317318
'$isCallback',

src/lib/IExecOrderModule.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,12 @@ export interface RequestorderParams {
257257
* result proxy url
258258
*/
259259
iexec_result_storage_proxy?: string;
260+
/**
261+
* bulk CID for the request
262+
*
263+
* default none
264+
*/
265+
bulk_cid?: string;
260266
}
261267

262268
/**

0 commit comments

Comments
 (0)