@@ -21,15 +21,18 @@ let gCloudRunDeploy = (name, file_location) => {
21
21
// convert URL to URI used by gsutils
22
22
const gcs_file_location = getGSURI ( file_location ) ;
23
23
const bucket_name = getBucketName ( file_location ) ;
24
+ // Get the location where to store the annotation file
25
+ const annotation_file = getAnnotationLocation ( file_location ) ;
24
26
if ( ! gcs_file_location ) return - 1 ;
25
27
26
28
// gcloud run deploy cellxgene-mounted-testing --port 8080 --source . --execution-environment
27
29
// gen2 --allow-unauthenticated --service-account cellxgene
28
30
// --update-env-vars BUCKET=jst-2021-bucket-2022-dev,GCS_FILE_LOCATION=results/64ba7ef41cdf2e0829d355e3/query_cxg.h5ad,DISABLE_CUSTOM_COLORS=1
29
31
30
32
let gcloudCommand = `gcloud run deploy ${ name } --image=${ process . env . CXG_IMAGE_LOCATION } --region=${ process . env . REGION } ` ;
31
- gcloudCommand += ` --memory=16Gi --cpu=4 --allow-unauthenticated --execution-environment gen2 --service-account cellxgene --port=${ process . env . CELLXGENE_PORT } --no-cpu-throttling --cpu-boost` ;
32
- gcloudCommand += ` --platform=${ process . env . PLATFORM } --update-env-vars GCS_FILE_LOCATION=${ gcs_file_location } ,BUCKET=${ bucket_name } ` ;
33
+ gcloudCommand += ` --memory=16Gi --cpu=4 --allow-unauthenticated --execution-environment gen2 --service-account cellxgene` ;
34
+ gcloudCommand += ` --port=${ process . env . CELLXGENE_PORT } --no-cpu-throttling --cpu-boost --platform=${ process . env . PLATFORM } ` ;
35
+ gcloudCommand += ` --update-env-vars GCS_FILE_LOCATION=${ gcs_file_location } ,BUCKET=${ bucket_name } ,ANNOTATION_FILE=${ annotation_file } ` ; // Removed: ,ANNOTATION_FILE=${annotation_file}
33
36
34
37
console . log ( `Executing command: \n${ gcloudCommand } \n` ) ;
35
38
@@ -213,6 +216,19 @@ function getBucketName(publicURL) {
213
216
return bucketName ;
214
217
}
215
218
219
+ /**
220
+ * Extracts the location where the annotations should be saved from the given public URL.
221
+ * @param {string } publicURL - The public URL to extract the location from.
222
+ * @returns {string } - The location where the annotations should be saved.
223
+ */
224
+ function getAnnotationLocation ( publicURL ) {
225
+ const annotation_file = 'annotation_file' ;
226
+ const sub_path = getGSURI ( publicURL ) . split ( '/' ) ;
227
+ sub_path . pop ( ) ;
228
+ return sub_path . join ( '/' ) + '/' + annotation_file ;
229
+ }
230
+
231
+
216
232
217
233
module . exports = {
218
234
gCloudRunDeploy,
0 commit comments