Skip to content

Commit

Permalink
fix: revert to podman desktop api 1.10.3
Browse files Browse the repository at this point in the history
Signed-off-by: axel7083 <[email protected]>
  • Loading branch information
axel7083 committed Jun 6, 2024
1 parent c0713d6 commit c568443
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 5 additions & 3 deletions packages/backend/src/workers/provider/InferenceProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<InferenceServerConfig, ContainerCreateResult>, Disposable {
export type BetterContainerCreateResult = ContainerCreateResult & { engineId: string };

export abstract class InferenceProvider implements IWorker<InferenceServerConfig, BetterContainerCreateResult>, Disposable {
protected constructor(private taskRegistry: TaskRegistry) {}

abstract name: string;
abstract enabled(): boolean;
abstract perform(config: InferenceServerConfig): Promise<ContainerCreateResult>;
abstract perform(config: InferenceServerConfig): Promise<BetterContainerCreateResult>;
abstract dispose(): void;

protected async createContainer(
engineId: string,
containerCreateOptions: ContainerCreateOptions,
labels: { [id: string]: string },
): Promise<ContainerCreateResult> {
): Promise<BetterContainerCreateResult> {
const containerTask = this.taskRegistry.createTask(`Creating container.`, 'loading', labels);

try {
Expand Down
6 changes: 3 additions & 3 deletions packages/backend/src/workers/provider/LlamaCppPython.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -96,7 +96,7 @@ export class LlamaCppPython extends InferenceProvider {
};
}

async perform(config: InferenceServerConfig): Promise<ContainerCreateResult> {
async perform(config: InferenceServerConfig): Promise<BetterContainerCreateResult> {
if (!this.enabled()) throw new Error('not enabled');

// pull the image
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c568443

Please sign in to comment.