Skip to content

Commit

Permalink
Add API-related part for incrementallearning job
Browse files Browse the repository at this point in the history
1.add crd and crd sample for incrementallearning job
2.add incrementallearningjob_types.go, and update register.go
3.update zz_generated.deepcopy.go and client dir
  • Loading branch information
TymonXie authored and llhuii committed Jan 26, 2021
1 parent 345ab1b commit 1845514
Show file tree
Hide file tree
Showing 18 changed files with 1,291 additions and 5 deletions.
67 changes: 67 additions & 0 deletions build/crd-samples/neptune/incrementallearningjob_v1alpha1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
apiVersion: neptune.io/v1alpha1
kind: IncrementalLearningJob
metadata:
name: helmet-detection-demo
spec:
initialModel:
name: "initial-model"
dataset:
name: "incremental-dataset"
trainProb: 0.8
trainSpec:
workerSpec:
scriptDir: "/code_il"
scriptBootFile: "train.py"
frameworkType: "tensorflow"
frameworkVersion: "1.15"
parameters:
- key: "batch_size"
value: "32"
- key: "learning_rate"
value: "0.001"
- key: "max_epochs"
value: "100"

trigger:
checkPeriodSeconds: 60
timer:
start: 02:00
end: 04:00
condition:
operator: ">"
threshold: 500
metric: num_of_samples
evalSpec:
workerSpec:
scriptDir: "/code_il"
scriptBootFile: "eval.py"
frameworkType: "tensorflow"
frameworkVersion: "1.15"
parameters:
- key: "input_shape"
value: "352,640"
- key: "class_names"
value: "helmet,helmet-on,person,helmet-off"

deploySpec:
model:
name: "inference-model"
trigger:
condition:
operator: ">"
threshold: 0.1
metric: precision_delta
nodeName: "edge0"
hardExampleMining:
name: "IBT"
workerSpec:
scriptDir: "/code_il"
scriptBootFile: "eval.py"
frameworkType: "tensorflow"
frameworkVersion: "1.15"
parameters:
- key: "nms_threshold"
value: "0.6"

nodeName: "cloud0"
outputDir: "/output"
285 changes: 285 additions & 0 deletions build/crds/neptune/incrementallearningjob_v1alpha1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,285 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: incrementallearningjobs.neptune.io
spec:
group: neptune.io
names:
kind: IncrementalLearningJob
plural: incrementallearningjobs
shortNames:
- il
scope: Namespaced
versions:
- name: v1alpha1
subresources:
# status enables the status subresource.
status: {}
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
required:
- dataset
- nodeName
- outputDir
- initialModel
- trainSpec
properties:
dataset:
type: object
required:
- name
- trainProb
properties:
name:
type: string
trainProb:
type: number
nodeName:
type: string
outputDir:
type: string
initialModel:
type: object
required:
- name
properties:
name:
type: string
trainSpec:
type: object
required:
- workerSpec
- trigger
properties:
workerSpec:
type: object
required:
- scriptDir
- scriptBootFile
- frameworkType
- frameworkVersion
properties:
scriptDir:
type: string
scriptBootFile:
type: string
frameworkType:
type: string
frameworkVersion:
type: string
parameters:
type: array
items:
type: object
required:
- key
- value
properties:
key:
type: string
value:
type: string
trigger:
type: object
properties:
checkPeriodSeconds:
type: integer
timer:
type: object
required:
- start
- end
properties:
start:
type: string
end:
type: string
condition:
type: object
required:
- operator
- threshold
- metric
properties:
operator:
type: string
enum: [">=",">","=","==","<=","<","ge","gt","eq","le","lt"]
threshold:
type: number
metric:
type: string
evalSpec:
type: object
required:
- workerSpec
properties:
workerSpec:
type: object
required:
- scriptDir
- scriptBootFile
- frameworkType
- frameworkVersion
properties:
scriptDir:
type: string
scriptBootFile:
type: string
frameworkType:
type: string
frameworkVersion:
type: string
parameters:
type: array
items:
type: object
required:
- key
- value
properties:
key:
type: string
value:
type: string
deploySpec:
type: object
required:
- model
- trigger
- nodeName
- workerSpec
- hardExampleMining
properties:
model:
type: object
required:
- name
properties:
name:
type: string
nodeName:
type: string
hardExampleMining:
type: object
required:
- name
properties:
name:
type: string
workerSpec:
type: object
required:
- scriptDir
- scriptBootFile
- frameworkType
- frameworkVersion
properties:
scriptDir:
type: string
scriptBootFile:
type: string
frameworkType:
type: string
frameworkVersion:
type: string
parameters:
type: array
items:
type: object
required:
- key
- value
properties:
key:
type: string
value:
type: string

trigger:
type: object
properties:
checkPeriodSeconds:
type: integer
timer:
type: object
required:
- start
- end
properties:
start:
type: string
end:
type: string
condition:
type: object
required:
- operator
- threshold
- metric
properties:
operator:
type: string
enum: [">=",">","=","==","<=","<","ge","gt","eq","le","lt"]
threshold:
type: number
metric:
type: string

status:
type: object
properties:
conditions:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
lastHeartbeatTime:
type: string
format: date-time
lastTransitionTime:
type: string
format: date-time
reason:
type: string
message:
type: string
data:
type: string
stage:
type: string
startTime:
type: string
format: date-time
completionTime:
type: string
format: date-time
active:
type: integer
succeeded:
type: integer
failed:
type: integer


additionalPrinterColumns:
- name: stage
type: string
description: The status of the incremental job
jsonPath: ".status.conditions[-1].stage"
- name: status
type: string
description: The status of the incremental job
jsonPath: ".status.conditions[-1].type"
- name: Age
type: date
jsonPath: .metadata.creationTimestamp
Loading

0 comments on commit 1845514

Please sign in to comment.