Skip to content

Commit 1668420

Browse files
committed
fix annotation location bug
1 parent b1233ac commit 1668420

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

CellxGene/Load_Balancer/utils/gcloud-services.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,18 @@ let gCloudRunDeploy = (name, file_location) => {
2121
// convert URL to URI used by gsutils
2222
const gcs_file_location = getGSURI(file_location);
2323
const bucket_name = getBucketName(file_location);
24+
// Get the location where to store the annotation file
25+
const annotation_file = getAnnotationLocation(file_location);
2426
if (!gcs_file_location) return -1;
2527

2628
// gcloud run deploy cellxgene-mounted-testing --port 8080 --source . --execution-environment
2729
// gen2 --allow-unauthenticated --service-account cellxgene
2830
// --update-env-vars BUCKET=jst-2021-bucket-2022-dev,GCS_FILE_LOCATION=results/64ba7ef41cdf2e0829d355e3/query_cxg.h5ad,DISABLE_CUSTOM_COLORS=1
2931

3032
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}
3336

3437
console.log(`Executing command: \n${gcloudCommand}\n`);
3538

@@ -213,6 +216,19 @@ function getBucketName(publicURL) {
213216
return bucketName;
214217
}
215218

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+
216232

217233
module.exports = {
218234
gCloudRunDeploy,

0 commit comments

Comments
 (0)