File tree 2 files changed +8
-13
lines changed
2 files changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ export class Ensembler {
27
27
toJSON ( ) {
28
28
switch ( this . type ) {
29
29
case "docker" :
30
+ if ( this . docker_config . resource_request ?. cpu_limit === "" ) {
31
+ delete this . docker_config . resource_request . cpu_limit ;
32
+ }
30
33
return { type : this . type , docker_config : this . docker_config } ;
31
34
case "standard" :
32
35
if ( this . standard_config . experiment_mappings ?. length === 0 ) {
@@ -35,11 +38,15 @@ export class Ensembler {
35
38
if ( this . standard_config . route_name_path === "" ) {
36
39
delete this . standard_config . route_name_path ;
37
40
}
41
+ delete this . standard_config . fallback_response_route_id ;
38
42
return { type : this . type , standard_config : this . standard_config } ;
39
43
case "pyfunc" :
44
+ if ( this . pyfunc_config . resource_request ?. cpu_limit === "" ) {
45
+ delete this . pyfunc_config . resource_request . cpu_limit ;
46
+ }
40
47
return { type : this . type , pyfunc_config : this . pyfunc_config } ;
41
48
default :
42
- return { ... this , nop_config : this . nop_config } ;
49
+ return undefined ;
43
50
}
44
51
}
45
52
}
Original file line number Diff line number Diff line change @@ -138,25 +138,13 @@ export class TuringRouter {
138
138
// Copy the final response route id to the top level, as the default route
139
139
obj . config . default_route_id =
140
140
obj . config [ "ensembler" ] . nop_config [ "final_response_route_id" ] ;
141
- delete obj . config [ "ensembler" ] ;
142
141
} else if ( obj . config . ensembler . type === "standard" ) {
143
142
// Copy the fallback response route id to the top level, as the default route
144
143
obj . config . default_route_id =
145
144
obj . config [ "ensembler" ] . standard_config [ "fallback_response_route_id" ] ;
146
- delete obj . config [ "ensembler" ] . standard_config [
147
- "fallback_response_route_id"
148
- ] ;
149
145
} else {
150
146
// Docker or Pyfunc ensembler, clear the default_route_id
151
147
delete obj . config [ "default_route_id" ] ;
152
- if ( obj . config . ensembler . type === "pyfunc" ) {
153
- // Delete the docker config
154
- delete obj . config [ "ensembler" ] . docker_config ;
155
- }
156
- // Docker/Pyfunc ensembler CPU limit
157
- if ( obj . config . ensembler . resource_request ?. cpu_limit === "" ) {
158
- delete obj . config . ensembler . resource_request . cpu_limit ;
159
- }
160
148
}
161
149
162
150
// Outcome Logging
You can’t perform that action at this time.
0 commit comments