import { processResourceActionSet } from '~/views-components/context-menu/action-sets/process-resource-action-set';
import { progressIndicatorActions } from '~/store/progress-indicator/progress-indicator-actions';
import { trashedCollectionActionSet } from '~/views-components/context-menu/action-sets/trashed-collection-action-set';
+import { ContainerRequestState } from '~/models/container-request';
+import { MountKind } from './models/mount-types';
const getBuildNumber = () => "BN-" + (process.env.REACT_APP_BUILD_NUMBER || "dev");
const getGitCommit = () => "GIT-" + (process.env.REACT_APP_GIT_COMMIT || "latest").substr(0, 7);
initWebSocket(config, services.authService, store);
await store.dispatch(loadWorkbench());
addRouteChangeHandlers(history, store);
+ // createSampleProcess(services);
}
};
};
+const createSampleProcess = ({ containerRequestService }: ServiceRepository) => {
+ containerRequestService.create({
+ ownerUuid: 'c97qk-j7d0g-s3ngc1z0748hsmf',
+ name: 'Simple process 7',
+ state: ContainerRequestState.COMMITTED,
+ mounts: {
+ '/var/spool/cwl': {
+ kind: MountKind.COLLECTION,
+ writable: true,
+ },
+ 'stdout': {
+ kind: MountKind.MOUNTED_FILE,
+ path: '/var/spool/cwl/cwl.output.json'
+ },
+ '/var/lib/cwl/workflow.json': {
+ kind: MountKind.JSON,
+ content: {
+ "cwlVersion": "v1.0",
+ "$graph": [
+ {
+ "class": "CommandLineTool",
+ "requirements": [
+ {
+ "listing": [
+ {
+ "entryname": "input_collector.log",
+ "entry": "$(inputs.single_file.basename)\n"
+ }
+ ],
+ "class": "InitialWorkDirRequirement"
+ }
+ ],
+ "inputs": [
+ {
+ "type": "File",
+ "id": "#input_collector.cwl/single_file"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "File",
+ "outputBinding": {
+ "glob": "*"
+ },
+ "id": "#input_collector.cwl/output"
+ }
+ ],
+ "baseCommand": [
+ "echo"
+ ],
+ "id": "#input_collector.cwl"
+ },
+ {
+ "class": "Workflow",
+ "doc": "This is the description of the workflow",
+ "inputs": [
+ {
+ "type": "File",
+ "label": "Single File",
+ "doc": "This should allow for single File selection only.",
+ "id": "#main/single_file"
+ }
+ ],
+ "outputs": [
+ {
+ "type": "File",
+ "outputSource": "#main/input_collector/output",
+ "id": "#main/log_file"
+ }
+ ],
+ "steps": [
+ {
+ "run": "#input_collector.cwl",
+ "in": [
+ {
+ "source": "#main/single_file",
+ "id": "#main/input_collector/single_file"
+ }
+ ],
+ "out": [
+ "#main/input_collector/output"
+ ],
+ "id": "#main/input_collector"
+ }
+ ],
+ "id": "#main"
+ }
+ ]
+ },
+ },
+ '/var/lib/cwl/cwl.input.json': {
+ kind: MountKind.JSON,
+ content: {
+ "single_file": {
+ "class": "File",
+ "location": "keep:233454526794c0a2d56a305baeff3d30+145/1.txt",
+ "basename": "fileA"
+ }
+ },
+ }
+ },
+ runtimeConstraints: {
+ API: true,
+ vcpus: 1,
+ ram: 1073741824,
+ },
+ containerImage: 'arvados/jobs:1.1.4.20180618144723',
+ cwd: '/var/spool/cwl',
+ command: [
+ 'arvados-cwl-runner',
+ '--local',
+ '--api=containers',
+ "--project-uuid=c97qk-j7d0g-s3ngc1z0748hsmf",
+ '/var/lib/cwl/workflow.json#main',
+ '/var/lib/cwl/cwl.input.json'
+ ],
+ outputPath: '/var/spool/cwl',
+ priority: 1,
+ });
+};
+
requestingContainerUuid: string | null;
containerUuid: string | null;
containerCountMax: number;
- mounts: MountType[];
+ mounts: {[path: string]: MountType};
runtimeConstraints: RuntimeConstraints;
schedulingParameters: SchedulingParameters;
containerImage: string;
TEMPORARY_DIRECTORY = 'tmp',
KEEP = 'keep',
MOUNTED_FILE = 'file',
- JSON = 'JSON'
+ JSON = 'json'
}
export type MountType =
GitTreeMount |
TemporaryDirectoryMount |
KeepMount |
- JSONMount;
+ JSONMount |
+ FileMount;
export interface CollectionMount {
kind: MountKind.COLLECTION;
export interface JSONMount {
kind: MountKind.JSON;
- content: string;
+ content: any;
+}
+
+export interface FileMount {
+ kind: MountKind.MOUNTED_FILE;
+ path: string;
}
GROUP = 'j7d0g',
LOG = '57u5n',
USER = 'tpzed',
+ WORKFLOW = '7fd4e',
}
export const RESOURCE_UUID_PATTERN = '.{5}-.{5}-.{15}';
return ResourceKind.CONTAINER;
case ResourceObjectType.LOG:
return ResourceKind.LOG;
+ case ResourceObjectType.WORKFLOW:
+ return ResourceKind.WORKFLOW;
default:
return undefined;
}
export interface RuntimeConstraints {
ram: number;
vcpus: number;
- keepCacheRam: number;
+ keepCacheRam?: number;
API: boolean;
}
this.actions = actions;
}
- create(data?: Partial<T> | any) {
+ create(data?: Partial<T>) {
return CommonResourceService.defaultResponse(
this.serverApi
.post<T>(this.resourceType, data && CommonResourceService.mapKeys(_.snakeCase)(data)),
//
// SPDX-License-Identifier: AGPL-3.0
+import { snakeCase } from 'lodash';
import { CommonResourceService } from "~/services/common-service/common-resource-service";
import { AxiosInstance } from "axios";
import { ContainerRequestResource } from '~/models/container-request';
constructor(serverApi: AxiosInstance, actions: ApiActions) {
super(serverApi, "container_requests", actions);
}
+
+ create(data?: Partial<ContainerRequestResource>) {
+ if (data) {
+ const { mounts } = data;
+ if (mounts) {
+ const mappedData = {
+ ...CommonResourceService.mapKeys(snakeCase)(data),
+ mounts,
+ };
+ return CommonResourceService
+ .defaultResponse(
+ this.serverApi.post<ContainerRequestResource>(this.resourceType, mappedData),
+ this.actions);
+ }
+ }
+ return CommonResourceService
+ .defaultResponse(
+ this.serverApi
+ .post<ContainerRequestResource>(this.resourceType, data && CommonResourceService.mapKeys(snakeCase)(data)),
+ this.actions);
+ }
}
import { ContainerService } from './container-service/container-service';
import { LogService } from './log-service/log-service';
import { ApiActions } from "~/services/api/api-actions";
+import { WorkflowService } from "~/services/workflow-service/workflow-service";
export type ServiceRepository = ReturnType<typeof createServices>;
const logService = new LogService(apiClient, actions);
const projectService = new ProjectService(apiClient, actions);
const userService = new UserService(apiClient, actions);
+ const workflowService = new WorkflowService(apiClient, actions);
const ancestorsService = new AncestorService(groupsService, userService);
const authService = new AuthService(apiClient, config.rootUrl, actions);
tagService,
userService,
webdavClient,
+ workflowService,
};
};
--- /dev/null
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { AxiosInstance } from "axios";
+import { CommonResourceService } from "~/services/common-service/common-resource-service";
+import { WorkflowResource } from '~/models/workflow';
+import { ApiActions } from '~/services/api/api-actions';
+
+export class WorkflowService extends CommonResourceService<WorkflowResource> {
+ constructor(serverApi: AxiosInstance, actions: ApiActions) {
+ super(serverApi, "workflows", actions);
+ }
+}