Skip to content

Commit d3f4a88

Browse files
For custom-model inferences, pass model’s orga id (#8926)
The worker uses the organization id to find the path of the custom aiModel. If it was trained in another orga, that orga’s id must be used. ### Steps to test: (I tested locally) - check out corresponding vx pr scalableminds/voxelytics#4283 - create multi-orga setup (via features.isWkOrgInstance=true) - the second orga must also have pricing plan custom, its user must be superuser - share the sample model with the new orga - in that orga, run it on a dataset - workflow should start running in the worker. ### Issues: - fixes https://scm.slack.com/archives/C5AKLAV0B/p1757942045889209 ------ - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [x] Removed dev-only changes like prints and application.conf edits - [x] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) --------- Co-authored-by: bulldozer-boy[bot] <53086266+bulldozer-boy[bot]@users.noreply.github.com>
1 parent feb7001 commit d3f4a88

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/controllers/AiModelController.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class AiModelController @Inject()(
235235
_ <- Fox.fromBool(request.identity._organization == organization._id) ?~> "job.runInference.notAllowed.organization" ~> FORBIDDEN
236236
dataset <- datasetDAO.findOneByDirectoryNameAndOrganization(request.body.datasetDirectoryName, organization._id)
237237
dataStore <- dataStoreDAO.findOneByName(dataset._dataStore) ?~> "dataStore.notFound"
238-
_ <- aiModelDAO.findOne(request.body.aiModelId) ?~> "aiModel.notFound"
238+
aiModel <- aiModelDAO.findOne(request.body.aiModelId) ?~> "aiModel.notFound"
239239
_ <- datasetService.assertValidDatasetName(request.body.newDatasetName)
240240
jobCommand = JobCommand.infer_instances
241241
boundingBox <- BoundingBox.fromLiteral(request.body.boundingBox).toFox
@@ -246,6 +246,7 @@ class AiModelController @Inject()(
246246
"layer_name" -> request.body.colorLayerName,
247247
"bbox" -> boundingBox.toLiteral,
248248
"model_id" -> request.body.aiModelId,
249+
"model_organization_id" -> aiModel._organization,
249250
"dataset_directory_name" -> request.body.datasetDirectoryName,
250251
"new_dataset_name" -> request.body.newDatasetName,
251252
"custom_workflow_provided_by_user" -> request.body.workflowYaml,
@@ -278,7 +279,7 @@ class AiModelController @Inject()(
278279
_ <- Fox.fromBool(request.identity._organization == organization._id) ?~> "job.runInference.notAllowed.organization" ~> FORBIDDEN
279280
dataset <- datasetDAO.findOneByDirectoryNameAndOrganization(request.body.datasetDirectoryName, organization._id)
280281
dataStore <- dataStoreDAO.findOneByName(dataset._dataStore) ?~> "dataStore.notFound"
281-
_ <- aiModelDAO.findOne(request.body.aiModelId) ?~> "aiModel.notFound"
282+
aiModel <- aiModelDAO.findOne(request.body.aiModelId) ?~> "aiModel.notFound"
282283
_ <- datasetService.assertValidDatasetName(request.body.newDatasetName)
283284
jobCommand = JobCommand.infer_neurons
284285
boundingBox <- BoundingBox.fromLiteral(request.body.boundingBox).toFox
@@ -289,6 +290,7 @@ class AiModelController @Inject()(
289290
"layer_name" -> request.body.colorLayerName,
290291
"bbox" -> boundingBox.toLiteral,
291292
"model_id" -> request.body.aiModelId,
293+
"model_organization_id" -> aiModel._organization,
292294
"dataset_directory_name" -> request.body.datasetDirectoryName,
293295
"new_dataset_name" -> request.body.newDatasetName,
294296
"custom_workflow_provided_by_user" -> request.body.workflowYaml,

unreleased_changes/8926.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Fixed
2+
- Fixed running custom-model worker inferences with models shared from other wk organizations. [#4283](https://github.com/scalableminds/voxelytics/pull/4283)

0 commit comments

Comments
 (0)