From 0d64714f908f7d63bfb2b546ebdb45c8097944a1 Mon Sep 17 00:00:00 2001 From: Claudiu Micu Date: Wed, 22 Mar 2023 15:42:26 +0200 Subject: [PATCH] fix: remove non-orchestration mode from the project as it's not maintained anymore, at least for the medium term. The only mode flame will have for now will be the orchestration mode, which means that all the wokers are managed by the flame system. --- api/job_components.partials.yml | 60 +++--- cmd/controller/app/job/builder.go | 20 +- .../app/job/builder_example_test.go | 66 ++++--- cmd/flamectl/resources/job/job.go | 2 +- docs/01-introduction.md | 12 -- docs/03-a-ubuntu.md | 2 +- docs/04-examples.md | 4 +- docs/05-flame-basics.md | 2 +- docs/index.html | 80 ++++---- examples/adult/README.md | 177 ------------------ examples/adult/adult.zip | Bin 4925 -> 0 bytes examples/adult/dataSpec.json | 1 - examples/adult/job.json | 10 - examples/adult/modelSpec.json | 16 -- examples/adult/schema.json | 52 ----- examples/asyncfl_hier_mnist/README.md | 4 +- examples/asyncfl_hier_mnist/dataSpec.json | 23 +-- examples/distributed_training/README.md | 4 +- examples/distributed_training/dataSpec.json | 17 +- examples/hier_mnist/README.md | 4 +- examples/hier_mnist/dataSpec.json | 23 +-- examples/medmnist/README.md | 2 +- examples/medmnist/dataSpec.json | 31 ++- examples/mnist/dataSpec.json | 13 +- .../mnist_non_orchestration_mode/README.md | 156 --------------- .../dataSpec.json | 8 - .../mnist_non_orchestration_mode/job.json | 10 - .../mnist_non_orchestration_mode.zip | Bin 3893 -> 0 bytes .../modelSpec.json | 18 -- .../mnist_non_orchestration_mode/schema.json | 52 ----- examples/parallel_experiment/README.md | 20 +- examples/parallel_experiment/dataSpec.json | 23 +-- pkg/openapi/model_job_spec.go | 19 +- pkg/openapi/model_job_spec_all_of.go | 59 ++++++ ...a_spec.go => model_role_dataset_groups.go} | 23 +-- 35 files changed, 271 insertions(+), 742 deletions(-) delete mode 100644 examples/adult/README.md delete mode 100644 examples/adult/adult.zip delete mode 100644 examples/adult/dataSpec.json delete mode 100644 examples/adult/job.json delete mode 100644 examples/adult/modelSpec.json delete mode 100644 examples/adult/schema.json delete mode 100644 examples/mnist_non_orchestration_mode/README.md delete mode 100644 examples/mnist_non_orchestration_mode/dataSpec.json delete mode 100644 examples/mnist_non_orchestration_mode/job.json delete mode 100644 examples/mnist_non_orchestration_mode/mnist_non_orchestration_mode.zip delete mode 100644 examples/mnist_non_orchestration_mode/modelSpec.json delete mode 100644 examples/mnist_non_orchestration_mode/schema.json create mode 100644 pkg/openapi/model_job_spec_all_of.go rename pkg/openapi/{model_data_spec.go => model_role_dataset_groups.go} (55%) diff --git a/api/job_components.partials.yml b/api/job_components.partials.yml index 64ae852fd..4d9242017 100644 --- a/api/job_components.partials.yml +++ b/api/job_components.partials.yml @@ -79,46 +79,38 @@ CommBackend: ######################################## DataSpec: description: Dataset specification - type: object - properties: - fromUser: - $ref: '#/components/schemas/FromUser' - fromSystem: - $ref: '#/components/schemas/FromSystem' + type: array + items: + $ref: '#/components/schemas/RoleDatasetGroups' example: - fromUser: - default: 1 # there is one user-fed dataset under default realm - uk: 2 # there are two user-fed datasets (hence two compute nodes) under uk realm - us/foo: 3 # there are three user-fed datasets under us/foo realm - fromSystem: - trainer: - "default/eu": + - role: trainer + datasetGroups: + "eu": - 61609290fa724deafdb2a4fa # id of dataset registered in the flame system - 61609290fa724deafdb2a4fb # id of dataset registered in the flame system - "default/us": + "us": - 61609290fa724deafdb2a4fc # id of dataset registered in the flame system -######################################## -# FromUser -######################################## -FromUser: - # an object is a key-value pair of realm and count - type: object - additionalProperties: - type: integer - format: int32 - -######################################## -# FromSystem -######################################## -FromSystem: +RoleDatasetGroups: + description: Dataset specification type: object - additionalProperties: - type: object - additionalProperties: - type: array - items: - type: string + properties: + role: + type: string + datasetGroups: + type: object + additionalProperties: + type: array + items: + type: string + example: + role: trainer + datasetGroups: + "eu": + - 61609290fa724deafdb2a4fa # id of dataset registered in the flame system + - 61609290fa724deafdb2a4fb # id of dataset registered in the flame system + "us": + - 61609290fa724deafdb2a4fc # id of dataset registered in the flame system ######################################## # Model Spec diff --git a/cmd/controller/app/job/builder.go b/cmd/controller/app/job/builder.go index a35b580d3..28cb6fffa 100644 --- a/cmd/controller/app/job/builder.go +++ b/cmd/controller/app/job/builder.go @@ -153,7 +153,10 @@ func (b *JobBuilder) setup() error { b.roleCode = zippedRoleCode // Iterating for each dataset id to fetch dataset info and update the datasets array. - for roleName, groups := range b.jobSpec.DataSpec.FromSystem { + for _, dataSpec := range b.jobSpec.DataSpec { + roleName := dataSpec.Role + groups := dataSpec.DatasetGroups + if len(groups) == 0 { return fmt.Errorf("no dataset group specified for trainer role %s", roleName) } @@ -220,21 +223,6 @@ func (b *JobBuilder) build() ([]objects.Task, []string, error) { continue } - // TODO: this is absolute and should be removed - for group, count := range b.jobSpec.DataSpec.FromUser { - for i := 0; i < int(count); i++ { - task := tmpl.Task - - task.Type = openapi.USER - task.JobConfig.Realm = group - task.JobConfig.GroupAssociation = b.getGroupAssociationByGroup(roleName, group) - - task.GenerateTaskId(i) - - tasks = append(tasks, task) - } - } - var count int groups := sortedKeys(b.datasets[roleName]) diff --git a/cmd/controller/app/job/builder_example_test.go b/cmd/controller/app/job/builder_example_test.go index fdb7a9d46..f2c215355 100644 --- a/cmd/controller/app/job/builder_example_test.go +++ b/cmd/controller/app/job/builder_example_test.go @@ -98,10 +98,13 @@ func Test_asyncfl_hier_mnist(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "eu": []string{datasetEuGermanyID, datasetEuUkID}, - "na": []string{datasetNaCanadaID, datasetNaUsID}, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "eu": []string{datasetEuGermanyID, datasetEuUkID}, + "na": []string{datasetNaCanadaID, datasetNaUsID}, + }, }, } jobStatus, err := dbService.CreateJob(userID, jobSpecData) @@ -169,9 +172,12 @@ func Test_distributed_training(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "us": []string{dataset1ID, dataset2ID, dataset3ID}, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "us": []string{dataset1ID, dataset2ID, dataset3ID}, + }, }, } jobStatus, err := dbService.CreateJob(userID, jobSpecData) @@ -242,10 +248,13 @@ func Test_hier_mnist(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "eu": []string{datasetEuGermanyID, datasetEuUkID}, - "na": []string{datasetNaCanadaID, datasetNaUsID}, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "eu": []string{datasetEuGermanyID, datasetEuUkID}, + "na": []string{datasetNaCanadaID, datasetNaUsID}, + }, }, } jobStatus, err := dbService.CreateJob(userID, jobSpecData) @@ -335,11 +344,14 @@ func Test_medmnist(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "us": []string{ - dataset1ID, dataset2ID, dataset3ID, dataset4ID, dataset5ID, - dataset6ID, dataset7ID, dataset8ID, dataset9ID, dataset10ID, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "us": []string{ + dataset1ID, dataset2ID, dataset3ID, dataset4ID, dataset5ID, + dataset6ID, dataset7ID, dataset8ID, dataset9ID, dataset10ID, + }, }, }, } @@ -402,9 +414,12 @@ func Test_mnist(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "us": []string{datasetID}, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "us": []string{datasetID}, + }, }, } jobStatus, err := dbService.CreateJob(userID, jobSpecData) @@ -471,11 +486,14 @@ func Test_parallel_experiment(t *testing.T) { var jobSpecData openapi.JobSpec readFileToStruct(t, rootExample+"/job.json", &jobSpecData) - jobSpecData.DataSpec.FromSystem = map[string]map[string][]string{ - "trainer": { - "asia": []string{datasetAsiaID}, - "uk": []string{datasetEuUkID}, - "us": []string{datasetUsWestID}, + jobSpecData.DataSpec = []openapi.RoleDatasetGroups{ + { + Role: "trainer", + DatasetGroups: map[string][]string{ + "asia": []string{datasetAsiaID}, + "uk": []string{datasetEuUkID}, + "us": []string{datasetUsWestID}, + }, }, } jobStatus, err := dbService.CreateJob(userID, jobSpecData) diff --git a/cmd/flamectl/resources/job/job.go b/cmd/flamectl/resources/job/job.go index c97b91547..2cc1068f2 100644 --- a/cmd/flamectl/resources/job/job.go +++ b/cmd/flamectl/resources/job/job.go @@ -62,7 +62,7 @@ func createJobSpec(data []byte, jobFile string) (bool, openapi.JobSpec) { } //validate data spec - dataSpec := openapi.DataSpec{} + var dataSpec []openapi.RoleDatasetGroups dataSpecPath := fmt.Sprintf("%s/%s", path.Dir(jobFile), createJobRequest.DataSpecPath) err = util.ReadFileToStruct(dataSpecPath, &dataSpec) diff --git a/docs/01-introduction.md b/docs/01-introduction.md index 68ccf5cb7..9cdaf97a9 100644 --- a/docs/01-introduction.md +++ b/docs/01-introduction.md @@ -72,16 +72,4 @@ and makes worker creation requests. 9. Step 9: The flamelet monitors the execution of the task and updates the state once the task execution is over. 10. Step 10: In the meantime, the controller also monitors a job's status and take action when necessary (e.g., deallocating workers). -The above workflow can have some variations depending deployment mode. -There are two types of deployment modes: **orchestration** and **non-ochestration**. -In orchestration mode, all the workers are under the management of flame system through the help of cluster orchestrators. -On the other hand, in non-orchestration mode, the workers of consuming data (e.g., training worker) are not under management of the flame system. -The non-ochestration mode is useful in one of the following situations: -* when the flame system doesn't have permission to utilize resources of geo-distributed clusters -* when the geo-distributed clusters are not under the management of one organization -* when participants of a FL job want to have a control over when to join or leave the job - -In non-ochestration mode, the fleddge system is only responsible for managing (i.e., (de)allocation) non-data consuming workers (e.g., model aggregating workers). -The system supports a hybrid mode where some are managed workers and others are non-managed workers. - Note that the flame system is in active development and not all the functionalities are supported yet. diff --git a/docs/03-a-ubuntu.md b/docs/03-a-ubuntu.md index ebd052917..e32abca8a 100644 --- a/docs/03-a-ubuntu.md +++ b/docs/03-a-ubuntu.md @@ -148,7 +148,7 @@ Error: INSTALLATION FAILED: failed post-install: timed out waiting for the condi This issue may be because container images are large or the Internet connection is slow. The issue has been reported in minikube [github](https://github.com/kubernetes/minikube/issues/14789). The latest minikube still doesn't contain the patched component (cri-dockerd 0.2.6). -A workaround is to pull images manually (e.g. `minikube ssh docker pull ciscoresearch/flame:latest`). +A workaround is to pull images manually (e.g. `minikube ssh docker pull ciscoresearch/flame:v0.2.2`). The command `kubectl get pods -n flame` gives a list of pods and their status. The pods with `ErrImagePull` or `ImagePullBackOff` status are ones that might be affected by the issue. Identifying the required image can be done by running a `kubectl describe` command diff --git a/docs/04-examples.md b/docs/04-examples.md index e6b5ad497..68f54fedc 100644 --- a/docs/04-examples.md +++ b/docs/04-examples.md @@ -72,11 +72,11 @@ flamectl create dataset dataset.json ``` The last command returns the dataset's ID if successful. If you want to start a two-trainer example, you need to create one more dataset because flame automatically assigns a trainer to a new dataset. -As the dataset ID is a unique key based on both URL in `dataset.json` and user ID in `${Home}/.flame/config.yaml`, you can modify either URL or user id. Or you can simply duplicate the same dataset's ID in `job.json`. +As the dataset ID is a unique key based on both URL in `dataset.json` and user ID in `${HOME}/.flame/config.yaml`, you can modify either URL or user id. Or you can simply duplicate the same dataset's ID in `dataSpec.json`. ### Step 5: modify a job specification -With your choice of text editor, modify `job.json` to specify correct dataset's ID and save the change. +With your choice of text editor, modify `dataSpec.json` to specify correct dataset's ID and save the change. ### Step 6: create a job ```bash diff --git a/docs/05-flame-basics.md b/docs/05-flame-basics.md index ee61a5e53..0a3683cc2 100644 --- a/docs/05-flame-basics.md +++ b/docs/05-flame-basics.md @@ -36,7 +36,7 @@ For role, it has two attributes: *isDataConsumer* and *replica*. **isDataconsumer**: this is a boolean attribute to denote that a role is supposed to consume data. If the attribute is set, it indicates workers created from this role are training workers. -It has an important implication. In the orchestration mode, the number of specified datasets corresponds to the number of workers from the role with isDataConsumer attribute set. +It has an important implication, indicating the number of specified datasets corresponds to the number of workers from the role with isDataConsumer attribute set. **replica**: This is applied to the roles with no isDataConsumer attribute set. This feature is for high availability. It is yet to be implemented and will be supported in the future. diff --git a/docs/index.html b/docs/index.html index 336b4417f..79c8f2630 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2219,7 +2219,7 @@

Response samples

Content type
application/json
[
  • {
    }
]

Create a new design template.

path Parameters
user
required
string

user name

Request Body schema: application/json

Collection of node information

-
name
required
string
description
string
id
required
string
userId
string

Responses

name
string
description
string
id
required
string
userId
string

Responses

Request samples

Content type
application/json
{
  • "name": "diabete predict",
  • "description": "Helps in quick diagnosis and prediction of diabetes among patients.",
  • "id": "diabete-predict"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get design template information

path Parameters
user
required
string

user id

designId
required
string

design id

@@ -2227,7 +2227,7 @@

Response samples

Content type
application/json
{
  • "name": "diabete predict",
  • "description": "Helps in quick diagnosis and prediction of diabetes among patients.",
  • "id": "diabete-predict",
  • "schemas": [
    ]
}

Delete design template

path Parameters
user
required
string

user id

designId
required
string

design id

-

Responses

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "schemas": [
    ]
}

Update a design schema

path Parameters
user
required
string

user id

designId
required
string

design id

-
Request Body schema: application/json
version
required
string
name
required
string
description
string
required
Array of objects (Role)
required
Array of objects (Channel)
Array of objects (Connector)

Responses

Request Body schema: application/json
version
string
name
required
string
description
string
required
Array of objects (Role)
required
Array of objects (Channel)
Array of objects (Connector)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get a design schema owned by user

path Parameters
user
required
string

user id

designId
required
string

design id

@@ -2247,144 +2247,148 @@

Response samples

Content type
application/json
[
  • {
    }
]

Update a schema for a given design

path Parameters
user
required
string

user id

designId
required
string

design id

version
required
string

version string

-
Request Body schema: application/json
version
required
string
name
required
string
description
string
required
Array of objects (Role)
required
Array of objects (Channel)
Array of objects (Connector)

Responses

Request Body schema: application/json
version
string
name
required
string
description
string
required
Array of objects (Role)
required
Array of objects (Channel)
Array of objects (Connector)

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete a schema for a given design

path Parameters
user
required
string

user id

designId
required
string

design id

version
required
string

version string

-
Request Body schema: application/json
version
required
string
name
required
string
description
string
required
Array of objects (Role)
required
Array of objects (Channel)
Array of objects (Connector)

Responses

Responses

Request samples

Content type
application/json
[
  • {
    }
]

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

designCodes

Upload a new design code

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

designCodes

Upload a new design code

path Parameters
user
required
string

user id

designId
required
string

design id

Request Body schema: multipart/form-data
fileName
required
string
fileVer
required
string
fileData
required
string <binary> <= 10485760 characters

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get a zipped design code file owned by user

path Parameters
user
required
string

user name

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get a zipped design code file owned by user

path Parameters
user
required
string

user name

designId
required
string

design id

version
required
string

version string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Update a design code

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Update a design code

path Parameters
user
required
string

user id

designId
required
string

design id

version
required
string

version string

Request Body schema: multipart/form-data
fileName
required
string
fileVer
required
string
fileData
required
string <binary> <= 10485760 characters

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete code of a specified version from a given design

path Parameters
user
required
string

user name

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete code of a specified version from a given design

path Parameters
user
required
string

user name

designId
required
string

design id

version
required
string

version string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

datasets

Get the meta info on all the datasets

query Parameters
limit
integer <int32>

How many items to return at one time (max 100)

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

datasets

Get the meta info on all the datasets

query Parameters
limit
integer <int32>

How many items to return at one time (max 100)

Responses

Response samples

Content type
application/json
[]

Get the meta info on all the datasets owned by user

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
[]

Get the meta info on all the datasets owned by user

path Parameters
user
required
string

user id

query Parameters
limit
integer <int32>

How many items to return at one time (max 100)

Responses

Response samples

Content type
application/json
[]

Create meta info for a new dataset.

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
[]

Create meta info for a new dataset.

path Parameters
user
required
string

user id

Request Body schema: application/json

dataset information

id
string
userId
string
name
string
description
string
url
required
string
dataFormat
required
string
realm
required
string
computeId
string
isPublic
boolean

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get dataset meta information

path Parameters
user
required
string

user id

+

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get dataset meta information

path Parameters
user
required
string

user id

datasetId
required
string

dataset id

Responses

Response samples

Content type
application/json
{}

Update meta info for a given dataset

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{}

Update meta info for a given dataset

path Parameters
user
required
string

user id

datasetId
required
string

dataset id

Request Body schema: application/json
id
string
userId
string
name
string
description
string
url
required
string
dataFormat
required
string
realm
required
string
computeId
string
isPublic
boolean

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

jobs

Create a new job specification

path Parameters
user
required
string

user id

-
Request Body schema: application/json
id
string
userId
string
designId
required
string
schemaVersion
required
string
codeVersion
required
string
object (DataSpec)
object (Optimizer)
object (Selector)
priority
any (JobPriority)
Enum: "low" "medium" "high"
backend
any (CommBackend)
Enum: "mqtt" "p2p"
maxRunTime
integer <int32>
Default: 600
object (BaseModel)
hyperparameters
object
dependencies
Array of strings

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

jobs

Create a new job specification

path Parameters
user
required
string

user id

+
Request Body schema: application/json
id
string
userId
string
designId
required
string
schemaVersion
required
string
codeVersion
required
string
priority
any (JobPriority)
Enum: "low" "medium" "high"
backend
any (CommBackend)
Enum: "mqtt" "p2p"
maxRunTime
integer <int32>
Default: 600
object (DataSpec)

Dataset specification

+
object (ModelSpec)

Model specification

+

Responses

Request samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "selector": {
    },
  • "prority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "baseModel": {
    },
  • "hyperparameters": [
    ],
  • "dependencies": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get status info on all the jobs owned by user

path Parameters
user
required
string

user id

+

Request samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "priority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "dataSpec": {
    },
  • "modelSpec": {
    }
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get status info on all the jobs owned by user

path Parameters
user
required
string

user id

query Parameters
limit
integer <int32>

How many items to return at one time (max 100)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a job specification

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
[
  • {
    }
]

Get a job specification

path Parameters
user
required
string

user id

jobId
required
string

job id

Responses

Response samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "selector": {
    },
  • "prority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "baseModel": {
    },
  • "hyperparameters": [
    ],
  • "dependencies": [
    ]
}

Update a job specification

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "priority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "dataSpec": {
    },
  • "modelSpec": {
    }
}

Update a job specification

path Parameters
user
required
string

user id

jobId
required
string

job id

-
Request Body schema: application/json
id
string
userId
string
designId
required
string
schemaVersion
required
string
codeVersion
required
string
object (DataSpec)
object (Optimizer)
object (Selector)
priority
any (JobPriority)
Enum: "low" "medium" "high"
backend
any (CommBackend)
Enum: "mqtt" "p2p"
maxRunTime
integer <int32>
Default: 600
object (BaseModel)
hyperparameters
object
dependencies
Array of strings

Responses

Request Body schema: application/json
id
string
userId
string
designId
required
string
schemaVersion
required
string
codeVersion
required
string
priority
any (JobPriority)
Enum: "low" "medium" "high"
backend
any (CommBackend)
Enum: "mqtt" "p2p"
maxRunTime
integer <int32>
Default: 600
object (DataSpec)

Dataset specification

+
object (ModelSpec)

Model specification

+

Responses

Request samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "selector": {
    },
  • "prority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "baseModel": {
    },
  • "hyperparameters": [
    ],
  • "dependencies": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete job specification

path Parameters
user
required
string

user id

+

Request samples

Content type
application/json
{
  • "userId": "john",
  • "designId": "60d0d66716af12b787d9ef0a",
  • "schemaVersion": "1",
  • "codeVersion": "1",
  • "priority": "low",
  • "backend": "mqtt",
  • "maxRunTime": 600,
  • "dataSpec": {
    },
  • "modelSpec": {
    }
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete job specification

path Parameters
user
required
string

user id

jobId
required
string

job id

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get job status of a given jobId

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get job status of a given jobId

path Parameters
user
required
string

user id

jobId
required
string

job id

Responses

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "ready",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "endedAt": "2019-08-24T14:15:22Z"
}

Update the status of a job

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "id": "string",
  • "state": "ready",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "endedAt": "2019-08-24T14:15:22Z"
}

Update the status of a job

path Parameters
user
required
string

user id

jobId
required
string

job id

Request Body schema: application/json
id
required
string
state
required
any (JobState)
Enum: "ready" "starting" "applying" "deploying" "stopping" "running" "failed" "terminated" "completed"
createdAt
string <date-time>
startedAt
string <date-time>
updatedAt
string <date-time>
endedAt
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "id": "string",
  • "state": "ready",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "endedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get the info of a task in a job

path Parameters
user
required
string

user id

+

Request samples

Content type
application/json
{
  • "id": "string",
  • "state": "ready",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "startedAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "endedAt": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get the info of a task in a job

path Parameters
user
required
string

user id

jobId
required
string

job id

taskId
required
string

task id

Responses

Response samples

Content type
application/json
{
  • "jobId": "string",
  • "taskId": "string",
  • "role": "string",
  • "type": "user",
  • "key": "string",
  • "state": "ready",
  • "computeId": "string",
  • "log": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get the info of tasks in a job

path Parameters
user
required
string

user id

+

Response samples

Content type
application/json
{
  • "jobId": "string",
  • "taskId": "string",
  • "role": "string",
  • "type": "user",
  • "key": "string",
  • "state": "ready",
  • "computeId": "string",
  • "log": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Get the info of tasks in a job

path Parameters
user
required
string

user id

jobId
required
string

job id

query Parameters
limit
integer <int32>

How many items to return at one time (max 100)

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a job task for a given job and task

path Parameters
jobId
required
string

job id

+

Response samples

Content type
application/json
[
  • {
    }
]

Get a job task for a given job and task

path Parameters
jobId
required
string

job id

taskId
required
string

flamelet task Id

query Parameters
key
required
string

A key for task authentication; once the key is recognized by the flame system for the first time, it can't be changed.

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Update the status of a task

path Parameters
jobId
required
string

job id

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Update the status of a task

path Parameters
jobId
required
string

job id

taskId
required
string

task id

Request Body schema: application/json
state
any (JobState)
Enum: "ready" "starting" "applying" "deploying" "stopping" "running" "failed" "terminated" "completed"
log
string
timestamp
string <date-time>

Responses

Request samples

Content type
application/json
{
  • "state": "ready",
  • "log": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

computes

Register a new compute cluster

Request Body schema: application/json
adminId
string
region
string
apiKey
string
computeId
string

Responses

Request samples

Content type
application/json
{
  • "state": "ready",
  • "log": "string",
  • "timestamp": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

computes

Register a new compute cluster

Request Body schema: application/json
adminId
string
region
string
apiKey
string
computeId
string

Responses

Request samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get status of a given compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Request samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get status of a given compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "computeId": "string",
  • "registeredAt": "2019-08-24T14:15:22Z",
  • "state": "up",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update a compute cluster's specification

path Parameters
computeId
required
string

compute id of compute cluster

+

Response samples

Content type
application/json
{
  • "computeId": "string",
  • "registeredAt": "2019-08-24T14:15:22Z",
  • "state": "up",
  • "updatedAt": "2019-08-24T14:15:22Z"
}

Update a compute cluster's specification

path Parameters
computeId
required
string

compute id of compute cluster

header Parameters
X-API-KEY
required
string
Request Body schema: application/json
adminId
string
region
string
apiKey
string
computeId
string

Responses

Request samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete compute cluster specification

path Parameters
computeId
required
string

compute id of compute cluster

+

Request samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Delete compute cluster specification

path Parameters
computeId
required
string

compute id of compute cluster

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get configuration for a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get configuration for a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Get all deployments within a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Response samples

Content type
application/json
{
  • "adminId": "admin-1",
  • "region": "us-east",
  • "apiKey": "apikey-1",
  • "computeId": "compute-1"
}

Get all deployments within a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get the deployment config for a job for a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Response samples

Content type
application/json
[
  • {
    }
]

Get the deployment config for a job for a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

jobId
required
string

job id

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "jobId": "string",
  • "imageLoc": "string",
  • "agentKVs": {
    }
}

Add or update the deployment status for a job on a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Response samples

Content type
application/json
{
  • "jobId": "string",
  • "imageLoc": "string",
  • "agentKVs": {
    }
}

Add or update the deployment status for a job on a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

jobId
required
string

job id

header Parameters
X-API-KEY
required
string
Request Body schema: application/json

Status for agents in a job deployment

property name*
additional property
any (AgentState)
Enum: "agentDeploySuccess" "agentDeployFailed" "agentRevokeSuccess" "agentRevokeFailed"

Responses

Request samples

Content type
application/json
{
  • "property1": "agentDeploySuccess",
  • "property2": "agentDeploySuccess"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get the deployment status for a job on a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

+

Request samples

Content type
application/json
{
  • "property1": "agentDeploySuccess",
  • "property2": "agentDeploySuccess"
}

Response samples

Content type
application/json
{
  • "code": 0,
  • "message": "string"
}

Get the deployment status for a job on a compute cluster

path Parameters
computeId
required
string

compute id of compute cluster

jobId
required
string

job id

header Parameters
X-API-KEY
required
string

Responses

Response samples

Content type
application/json
{
  • "property1": "agentDeploySuccess",
  • "property2": "agentDeploySuccess"
}
+

Response samples

Content type
application/json
{
  • "property1": "agentDeploySuccess",
  • "property2": "agentDeploySuccess"
}