diff --git a/docker-compose.yml b/docker-compose.yml index 5d60cfbb..3e855cce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,6 +15,7 @@ services: volumes: - k3s-containerd:/var/lib/rancher/k3s/agent/containerd - ./infra/bee-code-interpreter/k8s:/var/lib/rancher/k3s/server/manifests + - ${CODE_INTEPRETER_TMPDIR:-./examples/tmp/code_interpreter}:/storage ports: - "50051:30051" healthcheck: diff --git a/examples/agents/bee.ts b/examples/agents/bee.ts index 50737d34..07a197b0 100644 --- a/examples/agents/bee.ts +++ b/examples/agents/bee.ts @@ -23,6 +23,10 @@ const llm = new OllamaChatLLM({ const codeInterpreterUrl = process.env.CODE_INTERPRETER_URL; const __dirname = dirname(fileURLToPath(import.meta.url)); +const codeInterpreterTmpdir = + process.env.CODE_INTEPRETER_TMPDIR ?? "./examples/tmp/code_interpreter"; +const localTmpdir = process.env.LOCAL_TMPDIR ?? "./examples/tmp/local"; + const agent = new BeeAgent({ llm, memory: new TokenMemory({ llm }), @@ -38,8 +42,8 @@ const agent = new BeeAgent({ new PythonTool({ codeInterpreter: { url: codeInterpreterUrl }, storage: new LocalPythonStorage({ - interpreterWorkingDir: `${__dirname}/../tmp/code_interpreter`, - localWorkingDir: `${__dirname}/../tmp/local`, + interpreterWorkingDir: `${__dirname}/../../${codeInterpreterTmpdir}`, + localWorkingDir: `${__dirname}/../../${localTmpdir}`, }), }), ] diff --git a/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml b/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml index 28a6d26f..2be8566a 100644 --- a/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml +++ b/infra/bee-code-interpreter/k8s/bee-code-interpreter.yaml @@ -35,12 +35,22 @@ spec: serviceAccountName: code-interpreter-sa containers: - name: code-interpreter - image: docker.io/iambeeagent/bee-code-interpreter:0.0.7 + image: docker.io/iambeeagent/bee-code-interpreter:0.0.11 ports: - containerPort: 50051 env: - name: APP_EXECUTOR_IMAGE - value: docker.io/iambeeagent/bee-code-executor:0.0.7 + value: docker.io/iambeeagent/bee-code-executor:0.0.11 + - name: APP_FILE_STORAGE_PATH + value: /storage + volumeMounts: + - name: storage-volume + mountPath: /storage + volumes: + - name: storage-volume + hostPath: + path: /storage + type: Directory --- apiVersion: v1 kind: Service