Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions applications/idp-arc/frontend/src/core/ports/IWorkspaceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' },
Expand All @@ -125,6 +125,7 @@ export class WorkspaceApiClient implements IWorkspaceApi {
...(inputDir ? { input_dir: inputDir } : {}),
output_dir: outputDir,
results,
...(image ? { image } : {}),
}),
})
if (!res.ok) {
Expand Down
Loading