[ARVADOS-WORKBENCH2] updated: 1.2.0-186-g7896910
Git user
git at public.curoverse.com
Wed Aug 29 06:34:24 EDT 2018
Summary of changes:
src/models/container-request.ts | 19 ++++----
src/models/container.ts | 38 +++++++++++++++
src/models/mount-types.ts | 56 ++++++++++++++++++++++
src/models/resource.ts | 12 +++--
src/models/runtime-constraints.ts | 10 ++++
src/models/scheduling-parameters.ts | 9 ++++
.../container-service.ts} | 26 +++++-----
src/services/services.ts | 3 ++
8 files changed, 148 insertions(+), 25 deletions(-)
create mode 100644 src/models/container.ts
create mode 100644 src/models/mount-types.ts
create mode 100644 src/models/runtime-constraints.ts
create mode 100644 src/models/scheduling-parameters.ts
copy src/services/{keep-service/keep-service.ts => container-service/container-service.ts} (59%)
via 78969103183f03a23557aa0b4d1739a0ff12dcb2 (commit)
via 6a5c0fe0cd12635698d2b5a6df27b4291e5b0ecb (commit)
from a6af19c842e41469fb832dff58d5a23747394a1c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 78969103183f03a23557aa0b4d1739a0ff12dcb2
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Wed Aug 29 12:34:10 2018 +0200
Update container-request and container models
Feature #14099
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/models/container-request.ts b/src/models/container-request.ts
index d1bcc36..78891c7 100644
--- a/src/models/container-request.ts
+++ b/src/models/container-request.ts
@@ -3,6 +3,9 @@
// SPDX-License-Identifier: AGPL-3.0
import { Resource, ResourceKind } from "./resource";
+import { MountType } from "~/models/mount-types";
+import { RuntimeConstraints } from './runtime-constraints';
+import { SchedulingParameters } from './scheduling-parameters';
export enum ContainerRequestState {
UNCOMMITTED = "Uncommitted",
@@ -16,12 +19,12 @@ export interface ContainerRequestResource extends Resource {
description: string;
properties: any;
state: ContainerRequestState;
- requestingContainerUuid: string;
- containerUuid: string;
+ requestingContainerUuid: string | null;
+ containerUuid: string | null;
containerCountMax: number;
- mounts: any;
- runtimeConstraints: any;
- schedulingParameters: any;
+ mounts: MountType[];
+ runtimeConstraints: RuntimeConstraints;
+ schedulingParameters: SchedulingParameters;
containerImage: string;
environment: any;
cwd: string;
@@ -29,10 +32,10 @@ export interface ContainerRequestResource extends Resource {
outputPath: string;
outputName: string;
outputTtl: number;
- priority: number;
+ priority: number | null;
expiresAt: string;
useExisting: boolean;
- logUuid: string;
- outputUuid: string;
+ logUuid: string | null;
+ outputUuid: string | null;
filters: string;
}
diff --git a/src/models/container.ts b/src/models/container.ts
index 6f847b1..99cb309 100644
--- a/src/models/container.ts
+++ b/src/models/container.ts
@@ -3,6 +3,9 @@
// SPDX-License-Identifier: AGPL-3.0
import { Resource, ResourceKind } from "./resource";
+import { MountType } from '~/models/mount-types';
+import { RuntimeConstraints } from "~/models/runtime-constraints";
+import { SchedulingParameters } from './scheduling-parameters';
export enum ContainerState {
QUEUED = 'Queued',
@@ -15,21 +18,21 @@ export enum ContainerState {
export interface ContainerResource extends Resource {
kind: ResourceKind.CONTAINER;
state: string;
- startedAt: string;
- finishedAt: string;
- log: string;
+ startedAt: string | null;
+ finishedAt: string | null;
+ log: string | null;
environment: {};
cwd: string;
command: string[];
outputPath: string;
- mounts: {};
- runtimeConstraints: {};
- schedulingParameters: {};
- output: string;
+ mounts: MountType[];
+ runtimeConstraints: RuntimeConstraints;
+ schedulingParameters: SchedulingParameters;
+ output: string | null;
containerImage: string;
progress: number;
priority: number;
- exitCode: number;
- authUuid: string;
- lockedByUuid: string;
+ exitCode: number | null;
+ authUuid: string | null;
+ lockedByUuid: string | null;
}
diff --git a/src/models/mount-types.ts b/src/models/mount-types.ts
new file mode 100644
index 0000000..ec48c85
--- /dev/null
+++ b/src/models/mount-types.ts
@@ -0,0 +1,56 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export enum MountKind {
+ COLLECTION = 'collection',
+ GIT_TREE = 'git_tree',
+ TEMPORARY_DIRECTORY = 'tmp',
+ KEEP = 'keep',
+ MOUNTED_FILE = 'file',
+ JSON = 'JSON'
+}
+
+export type MountType =
+ CollectionMount |
+ GitTreeMount |
+ TemporaryDirectoryMount |
+ KeepMount |
+ JSONMount;
+
+export interface CollectionMount {
+ kind: MountKind.COLLECTION;
+ uuid?: string;
+ portableDataHash?: string;
+ path?: string;
+ writable?: boolean;
+}
+
+export interface GitTreeMount {
+ kind: MountKind.GIT_TREE;
+ uuid: string;
+ commit: string;
+ path?: string;
+}
+
+export enum TemporaryDirectoryDeviceType {
+ RAM = 'ram',
+ SSD = 'ssd',
+ DISK = 'disk',
+ NETWORK = 'network',
+}
+
+export interface TemporaryDirectoryMount {
+ kind: MountKind.TEMPORARY_DIRECTORY;
+ capacity: number;
+ deviceType: TemporaryDirectoryDeviceType;
+}
+
+export interface KeepMount {
+ kind: MountKind.KEEP;
+}
+
+export interface JSONMount {
+ kind: MountKind.JSON;
+ content: string;
+}
diff --git a/src/models/runtime-constraints.ts b/src/models/runtime-constraints.ts
new file mode 100644
index 0000000..ba90537
--- /dev/null
+++ b/src/models/runtime-constraints.ts
@@ -0,0 +1,10 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export interface RuntimeConstraints {
+ ram: number;
+ vcpus: number;
+ keepCacheRam: number;
+ API: boolean;
+}
diff --git a/src/models/scheduling-parameters.ts b/src/models/scheduling-parameters.ts
new file mode 100644
index 0000000..62f7224
--- /dev/null
+++ b/src/models/scheduling-parameters.ts
@@ -0,0 +1,9 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+export interface SchedulingParameters {
+ partitions: string[];
+ preemptible: boolean;
+ maxRunTime: number;
+}
commit 6a5c0fe0cd12635698d2b5a6df27b4291e5b0ecb
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date: Wed Aug 29 10:49:59 2018 +0200
Create container service
Feature #14099
Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
diff --git a/src/models/container.ts b/src/models/container.ts
new file mode 100644
index 0000000..6f847b1
--- /dev/null
+++ b/src/models/container.ts
@@ -0,0 +1,35 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { Resource, ResourceKind } from "./resource";
+
+export enum ContainerState {
+ QUEUED = 'Queued',
+ LOCKED = 'Locked',
+ RUNNING = 'Running',
+ COMPLETE = 'Complete',
+ CANCELLED = 'Cancelled',
+}
+
+export interface ContainerResource extends Resource {
+ kind: ResourceKind.CONTAINER;
+ state: string;
+ startedAt: string;
+ finishedAt: string;
+ log: string;
+ environment: {};
+ cwd: string;
+ command: string[];
+ outputPath: string;
+ mounts: {};
+ runtimeConstraints: {};
+ schedulingParameters: {};
+ output: string;
+ containerImage: string;
+ progress: number;
+ priority: number;
+ exitCode: number;
+ authUuid: string;
+ lockedByUuid: string;
+}
diff --git a/src/models/resource.ts b/src/models/resource.ts
index ec4fe5f..3290bdf 100644
--- a/src/models/resource.ts
+++ b/src/models/resource.ts
@@ -16,19 +16,21 @@ export interface Resource {
export enum ResourceKind {
COLLECTION = "arvados#collection",
+ CONTAINER = "arvados#container",
CONTAINER_REQUEST = "arvados#containerRequest",
GROUP = "arvados#group",
PROCESS = "arvados#containerRequest",
PROJECT = "arvados#group",
- WORKFLOW = "arvados#workflow",
USER = "arvados#user",
+ WORKFLOW = "arvados#workflow",
}
export enum ResourceObjectType {
- USER = 'tpzed',
- GROUP = 'j7d0g',
COLLECTION = '4zz18',
- CONTAINER_REQUEST = 'xvhdp'
+ CONTAINER = 'dz642',
+ CONTAINER_REQUEST = 'xvhdp',
+ GROUP = 'j7d0g',
+ USER = 'tpzed',
}
export const RESOURCE_UUID_PATTERN = '.{5}-.{5}-.{15}';
@@ -55,6 +57,8 @@ export const extractUuidKind = (uuid: string = '') => {
return ResourceKind.COLLECTION;
case ResourceObjectType.CONTAINER_REQUEST:
return ResourceKind.CONTAINER_REQUEST;
+ case ResourceObjectType.CONTAINER:
+ return ResourceKind.CONTAINER;
default:
return undefined;
}
diff --git a/src/services/container-service/container-service.ts b/src/services/container-service/container-service.ts
new file mode 100644
index 0000000..698c7f5
--- /dev/null
+++ b/src/services/container-service/container-service.ts
@@ -0,0 +1,13 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import { CommonResourceService } from "~/common/api/common-resource-service";
+import { AxiosInstance } from "axios";
+import { ContainerResource } from '../../models/container';
+
+export class ContainerService extends CommonResourceService<ContainerResource> {
+ constructor(serverApi: AxiosInstance) {
+ super(serverApi, "containers");
+ }
+}
diff --git a/src/services/services.ts b/src/services/services.ts
index d73d14b..32e7bd1 100644
--- a/src/services/services.ts
+++ b/src/services/services.ts
@@ -18,6 +18,7 @@ import { UserService } from './user-service/user-service';
import { AncestorService } from "~/services/ancestors-service/ancestors-service";
import { ResourceKind } from "~/models/resource";
import { ContainerRequestService } from './container-request-service/container-request-service';
+import { ContainerService } from './container-service/container-service';
export type ServiceRepository = ReturnType<typeof createServices>;
@@ -34,6 +35,7 @@ export const createServices = (config: Config) => {
const projectService = new ProjectService(apiClient);
const userService = new UserService(apiClient);
const containerRequestService = new ContainerRequestService(apiClient);
+ const containerService = new ContainerService(apiClient);
const ancestorsService = new AncestorService(groupsService, userService);
const authService = new AuthService(apiClient, config.rootUrl);
@@ -49,6 +51,7 @@ export const createServices = (config: Config) => {
collectionFilesService,
collectionService,
containerRequestService,
+ containerService,
favoriteService,
groupsService,
keepService,
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list