Skip to content

Commit

Permalink
Docker runtimes may be undefined (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristianrgreco authored Jul 9, 2024
1 parent 794ebc4 commit 04a1aad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 1 addition & 11 deletions packages/modules/ollama/src/ollama-container.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
AbstractStartedContainer,
GenericContainer,
getContainerRuntimeClient,
StartedTestContainer,
Wait,
} from "testcontainers";
import { AbstractStartedContainer, GenericContainer, getContainerRuntimeClient, Wait } from "testcontainers";

export const OLLAMA_PORT = 11434;

Expand Down Expand Up @@ -34,10 +28,6 @@ export class OllamaContainer extends GenericContainer {
}

export class StartedOllamaContainer extends AbstractStartedContainer {
constructor(startedTestContainer: StartedTestContainer) {
super(startedTestContainer);
}

public getPort(): number {
return this.startedTestContainer.getMappedPort(OLLAMA_PORT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async function initStrategy(strategy: ContainerRuntimeClientStrategy): Promise<C
architecture: dockerodeInfo.Architecture,
cpus: dockerodeInfo.NCPU,
memory: dockerodeInfo.MemTotal,
runtimes: Object.keys(dockerodeInfo.Runtimes),
runtimes: dockerodeInfo.Runtimes ? Object.keys(dockerodeInfo.Runtimes) : [],
};

const composeInfo: ComposeInfo = composeClient.info;
Expand Down

0 comments on commit 04a1aad

Please sign in to comment.