File tree Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Expand file tree Collapse file tree 2 files changed +23
-11
lines changed Original file line number Diff line number Diff line change @@ -59,21 +59,27 @@ func New(
59
59
consts .MetadataDir ,
60
60
)
61
61
62
- ctx .ProjectID = hash .Bytes (projectBytes )
63
-
64
- ctx .ProjectKey = filepath .Join (consts .ProjectsDir , ctx .ProjectID + ".zip" )
65
- if err = config .AWS .UploadBytesToS3 (projectBytes , ctx .ProjectKey ); err != nil {
66
- return nil , err
67
- }
62
+ projectID := hash .Bytes (projectBytes )
68
63
69
64
ctx .StatusPrefix = statusPrefix (ctx .App .Name )
70
- apis , err := getAPIs (userconf , ctx .DeploymentVersion , ctx . ProjectID )
65
+ apis , err := getAPIs (userconf , ctx .DeploymentVersion , projectID )
71
66
72
67
if err != nil {
73
68
return nil , err
74
69
}
75
70
ctx .APIs = apis
76
71
72
+ for _ , api := range ctx .APIs {
73
+ if api .RequestHandler != nil {
74
+ ctx .ProjectID = projectID
75
+ ctx .ProjectKey = filepath .Join (consts .ProjectsDir , ctx .ProjectID + ".zip" )
76
+ if err = config .AWS .UploadBytesToS3 (projectBytes , ctx .ProjectKey ); err != nil {
77
+ return nil , err
78
+ }
79
+ break
80
+ }
81
+ }
82
+
77
83
err = ctx .Validate ()
78
84
if err != nil {
79
85
return nil , err
Original file line number Diff line number Diff line change @@ -269,12 +269,15 @@ func tfAPISpec(
269
269
To : path .Join (consts .EmptyDirMountPath , "model" ),
270
270
ItemName : "model" ,
271
271
},
272
- {
272
+ }
273
+
274
+ if api .RequestHandler != nil {
275
+ downloadArgs = append (downloadArgs , downloadContainerArg {
273
276
From : config .AWS .S3Path (ctx .ProjectKey ),
274
277
To : path .Join (consts .EmptyDirMountPath , "project" ),
275
278
Unzip : true ,
276
279
ItemName : "project code" ,
277
- },
280
+ })
278
281
}
279
282
280
283
downloadArgsBytes , _ := json .Marshal (downloadArgs )
@@ -441,12 +444,15 @@ func onnxAPISpec(
441
444
To : path .Join (consts .EmptyDirMountPath , "model" ),
442
445
ItemName : "model" ,
443
446
},
444
- {
447
+ }
448
+
449
+ if api .RequestHandler != nil {
450
+ downloadArgs = append (downloadArgs , downloadContainerArg {
445
451
From : config .AWS .S3Path (ctx .ProjectKey ),
446
452
To : path .Join (consts .EmptyDirMountPath , "project" ),
447
453
Unzip : true ,
448
454
ItemName : "project code" ,
449
- },
455
+ })
450
456
}
451
457
452
458
downloadArgsBytes , _ := json .Marshal (downloadArgs )
You can’t perform that action at this time.
0 commit comments