From ab2fe7b8c0052d1c660fff59ab3392b7b742ec10 Mon Sep 17 00:00:00 2001 From: "D. Gopal Krishna" Date: Thu, 8 Oct 2026 19:22:55 +0530 Subject: [PATCH] IDP-41b: pass an optional notebook image to OSB's run endpoint --- applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts | 2 ++ .../idp-arc/frontend/src/core/use-cases/runProtocol.ts | 4 ++++ applications/idp-arc/frontend/src/infra/workspaceApiClient.ts | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts b/applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts index 6b4cd1c..e7a8bed 100644 --- a/applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts +++ b/applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts @@ -37,6 +37,8 @@ export interface StartRunInput { outputDir: string /** Where the executed notebooks and the log go on the volume. */ results: { notebooks: string; log: string } + /** The image the notebooks run in: an OSB application's name or an image reference. OSB's JupyterLab without it. */ + image?: string } /** diff --git a/applications/idp-arc/frontend/src/core/use-cases/runProtocol.ts b/applications/idp-arc/frontend/src/core/use-cases/runProtocol.ts index 083d610..2823026 100644 --- a/applications/idp-arc/frontend/src/core/use-cases/runProtocol.ts +++ b/applications/idp-arc/frontend/src/core/use-cases/runProtocol.ts @@ -25,6 +25,9 @@ export interface RunProtocolDefinition { pythonPath?: string[] install?: string[] inputFormats?: string[] + /** The image the notebooks run in (their environment): an OSB application's name (e.g. `netpyne`) + * or an image reference from a registry OSB allows. Without it, OSB's default (JupyterLab). */ + image?: string } export interface RunProtocolInput { @@ -250,6 +253,7 @@ export function createRunProtocolUseCase( inputDir: hasData ? layout.inputs : undefined, outputDir: layout.outputs, results: { notebooks: layout.notebooks, log: layout.log }, + ...(protocol.image ? { image: protocol.image } : {}), }) progress.outputsDir = layout.run // Followed through `GET /workspace/{id}`, as the imports are: while a workflow for the diff --git a/applications/idp-arc/frontend/src/infra/workspaceApiClient.ts b/applications/idp-arc/frontend/src/infra/workspaceApiClient.ts index a1664d9..29e1996 100644 --- a/applications/idp-arc/frontend/src/infra/workspaceApiClient.ts +++ b/applications/idp-arc/frontend/src/infra/workspaceApiClient.ts @@ -114,7 +114,7 @@ export class WorkspaceApiClient implements IWorkspaceApi { } async startRun(token: string, workspaceId: number, input: StartRunInput): Promise<{ workflow: string }> { - const { repo, setup, notebooks, inputDir, outputDir, results } = input + const { repo, setup, notebooks, inputDir, outputDir, results, image } = input const res = await fetch(`${this.baseApiUrl}/workspace/${workspaceId}/run`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, 'Content-Type': 'application/json' }, @@ -125,6 +125,7 @@ export class WorkspaceApiClient implements IWorkspaceApi { ...(inputDir ? { input_dir: inputDir } : {}), output_dir: outputDir, results, + ...(image ? { image } : {}), }), }) if (!res.ok) {