From c56844327111e911ee9e7080d33478beb9d014c0 Mon Sep 17 00:00:00 2001 From: axel7083 <42176370+axel7083@users.noreply.github.com> Date: Thu, 6 Jun 2024 12:05:30 +0200 Subject: [PATCH] fix: revert to podman desktop api 1.10.3 Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com> --- packages/backend/package.json | 2 +- .../backend/src/workers/provider/InferenceProvider.ts | 8 +++++--- packages/backend/src/workers/provider/LlamaCppPython.ts | 6 +++--- yarn.lock | 8 ++++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/packages/backend/package.json b/packages/backend/package.json index c69b928e6..4b2f5a3d5 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -65,7 +65,7 @@ "xml-js": "^1.6.11" }, "devDependencies": { - "@podman-desktop/api": "0.0.202406050828-61eefc7", + "@podman-desktop/api": "1.10.3", "@types/js-yaml": "^4.0.9", "@types/node": "^20", "@types/postman-collection": "^3.5.10", diff --git a/packages/backend/src/workers/provider/InferenceProvider.ts b/packages/backend/src/workers/provider/InferenceProvider.ts index 4cbfbde84..59a66b917 100644 --- a/packages/backend/src/workers/provider/InferenceProvider.ts +++ b/packages/backend/src/workers/provider/InferenceProvider.ts @@ -28,19 +28,21 @@ import type { IWorker } from '../IWorker'; import type { TaskRegistry } from '../../registries/TaskRegistry'; import { getImageInfo, getProviderContainerConnection } from '../../utils/inferenceUtils'; -export abstract class InferenceProvider implements IWorker, Disposable { +export type BetterContainerCreateResult = ContainerCreateResult & { engineId: string }; + +export abstract class InferenceProvider implements IWorker, Disposable { protected constructor(private taskRegistry: TaskRegistry) {} abstract name: string; abstract enabled(): boolean; - abstract perform(config: InferenceServerConfig): Promise; + abstract perform(config: InferenceServerConfig): Promise; abstract dispose(): void; protected async createContainer( engineId: string, containerCreateOptions: ContainerCreateOptions, labels: { [id: string]: string }, - ): Promise { + ): Promise { const containerTask = this.taskRegistry.createTask(`Creating container.`, 'loading', labels); try { diff --git a/packages/backend/src/workers/provider/LlamaCppPython.ts b/packages/backend/src/workers/provider/LlamaCppPython.ts index 32e486000..a754278bb 100644 --- a/packages/backend/src/workers/provider/LlamaCppPython.ts +++ b/packages/backend/src/workers/provider/LlamaCppPython.ts @@ -15,9 +15,9 @@ * * SPDX-License-Identifier: Apache-2.0 ***********************************************************************/ -import type { ContainerCreateOptions, ContainerCreateResult, ImageInfo } from '@podman-desktop/api'; +import type { ContainerCreateOptions, ImageInfo } from '@podman-desktop/api'; import type { InferenceServerConfig } from '@shared/src/models/InferenceServerConfig'; -import { InferenceProvider } from './InferenceProvider'; +import { type BetterContainerCreateResult, InferenceProvider } from './InferenceProvider'; import { getModelPropertiesForEnvironment } from '../../utils/modelsUtils'; import { DISABLE_SELINUX_LABEL_SECURITY_OPTION } from '../../utils/utils'; import { LABEL_INFERENCE_SERVER } from '../../utils/inferenceUtils'; @@ -96,7 +96,7 @@ export class LlamaCppPython extends InferenceProvider { }; } - async perform(config: InferenceServerConfig): Promise { + async perform(config: InferenceServerConfig): Promise { if (!this.enabled()) throw new Error('not enabled'); // pull the image diff --git a/yarn.lock b/yarn.lock index 12dfdf2cf..931b01d80 100644 --- a/yarn.lock +++ b/yarn.lock @@ -391,10 +391,10 @@ dependencies: playwright "1.42.1" -"@podman-desktop/api@0.0.202406050828-61eefc7": - version "0.0.202406050828-61eefc7" - resolved "https://registry.yarnpkg.com/@podman-desktop/api/-/api-0.0.202406050828-61eefc7.tgz#a50ab32f53200e1b88bc1d2b15cf7aba586bac5d" - integrity sha512-a54i9sFXIaBO18w/Nv+c+4Fre6D4n8sygyDLR67H5125zeZpMsY05GJDvqDnXpoQZzp/4pvA9RoXZoGWU8vJrw== +"@podman-desktop/api@1.10.3": + version "1.10.3" + resolved "https://registry.yarnpkg.com/@podman-desktop/api/-/api-1.10.3.tgz#c4c17e96aa3f70acd47162cc2d02cd0f3290fd52" + integrity sha512-jc5mYPsNz59e+o+1fQR67TPUWQoIuEssMtSwOgqdV/k0lSk05p5ErotrgeKT7WVXb7XxYOx0E4MtTTY5Kf7cyw== "@podman-desktop/tests-playwright@^1.10.3": version "1.10.3"