Skip to content

Commit 7fcccd9

Browse files
authored
feat: enhance filesystem support with bind mount entries and update package structure (#1361)
1 parent 5c8e9e1 commit 7fcccd9

86 files changed

Lines changed: 5296 additions & 153 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

agentscope-dependencies-bom/pom.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@
112112
<kotlin.version>1.9.24</kotlin.version>
113113
<kotlin.coroutines.version>1.10.2</kotlin.coroutines.version>
114114
<jgit.version>7.6.0.202603022253-r</jgit.version>
115+
<fabric8.kubernetes-client.version>6.13.4</fabric8.kubernetes-client.version>
116+
<protobuf.java.version>4.29.3</protobuf.java.version>
115117

116118
<spotless.version>3.4.0</spotless.version>
117119
<maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
@@ -142,6 +144,21 @@
142144
<scope>import</scope>
143145
</dependency>
144146

147+
<!-- Fabric8 Kubernetes client -->
148+
<dependency>
149+
<groupId>io.fabric8</groupId>
150+
<artifactId>kubernetes-client-bom</artifactId>
151+
<version>${fabric8.kubernetes-client.version}</version>
152+
<type>pom</type>
153+
<scope>import</scope>
154+
</dependency>
155+
156+
<dependency>
157+
<groupId>com.google.protobuf</groupId>
158+
<artifactId>protobuf-java</artifactId>
159+
<version>${protobuf.java.version}</version>
160+
</dependency>
161+
145162
<!-- Reactor -->
146163
<dependency>
147164
<groupId>io.projectreactor</groupId>

agentscope-examples/harness-examples/harness-example-remote/src/main/java/io/agentscope/examples/harness/remote/DataAgentService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import io.agentscope.examples.harness.remote.data.SqliteTool;
2525
import io.agentscope.harness.agent.HarnessAgent;
2626
import io.agentscope.harness.agent.IsolationScope;
27-
import io.agentscope.harness.agent.filesystem.RemoteFilesystemSpec;
27+
import io.agentscope.harness.agent.filesystem.spec.RemoteFilesystemSpec;
2828
import io.agentscope.harness.agent.store.InMemoryStore;
2929
import jakarta.annotation.PostConstruct;
3030
import java.io.InputStream;

agentscope-examples/harness-examples/harness-example-remote/src/main/java/io/agentscope/examples/harness/remote/HarnessRemoteApplication.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.agentscope.examples.harness.remote;
1717

18+
import io.agentscope.harness.agent.filesystem.spec.RemoteFilesystemSpec;
1819
import org.springframework.boot.SpringApplication;
1920
import org.springframework.boot.autoconfigure.SpringBootApplication;
2021

@@ -23,7 +24,7 @@
2324
*
2425
* <p>Set {@code DASHSCOPE_API_KEY}. Default port {@code 8788} (see {@code application.properties}).
2526
*
26-
* <p>This module demonstrates {@link io.agentscope.harness.agent.filesystem.RemoteFilesystemSpec}
27+
* <p>This module demonstrates {@link RemoteFilesystemSpec}
2728
* ({@code docs/zh/harness/filesystem.md} <strong>模式一</strong>). Sandbox (<strong>模式二</strong>)
2829
* is {@code harness-example-sandbox}.
2930
*/

agentscope-examples/harness-examples/harness-example-remote/src/main/java/io/agentscope/examples/harness/remote/WorkspaceClasspathMaterializer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.agentscope.examples.harness.remote;
1717

18+
import io.agentscope.harness.agent.filesystem.spec.RemoteFilesystemSpec;
1819
import java.io.IOException;
1920
import java.io.InputStream;
2021
import java.io.UncheckedIOException;
@@ -26,7 +27,7 @@
2627

2728
/**
2829
* Copies {@code classpath:workspace/...} into a temp directory used as the local side of the
29-
* composite workspace for {@link io.agentscope.harness.agent.filesystem.RemoteFilesystemSpec}.
30+
* composite workspace for {@link RemoteFilesystemSpec}.
3031
*/
3132
public final class WorkspaceClasspathMaterializer {
3233

agentscope-examples/harness-examples/harness-example-sandbox/src/main/java/io/agentscope/examples/harness/sandbox/support/InMemorySandbox.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
*/
1616
package io.agentscope.examples.harness.sandbox.support;
1717

18+
import io.agentscope.core.agent.RuntimeContext;
1819
import io.agentscope.harness.agent.sandbox.ExecResult;
1920
import io.agentscope.harness.agent.sandbox.Sandbox;
2021
import io.agentscope.harness.agent.sandbox.SandboxState;
@@ -110,7 +111,8 @@ public SandboxState getState() {
110111
}
111112

112113
@Override
113-
public ExecResult exec(String command, Integer timeoutSeconds) throws Exception {
114+
public ExecResult exec(RuntimeContext runtimeContext, String command, Integer timeoutSeconds)
115+
throws Exception {
114116
int timeout = timeoutSeconds != null ? timeoutSeconds : defaultTimeoutSeconds;
115117
ProcessBuilder pb = new ProcessBuilder("sh", "-c", command);
116118
pb.directory(workspaceDir.toFile());

agentscope-examples/harness-examples/harness-example-sandbox/src/main/java/io/agentscope/examples/harness/sandbox/support/InMemorySandboxFilesystemSpec.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@
1515
*/
1616
package io.agentscope.examples.harness.sandbox.support;
1717

18+
import io.agentscope.harness.agent.filesystem.spec.SandboxFilesystemSpec;
1819
import io.agentscope.harness.agent.sandbox.SandboxClient;
1920
import io.agentscope.harness.agent.sandbox.SandboxClientOptions;
2021
import io.agentscope.harness.agent.sandbox.WorkspaceSpec;
21-
import io.agentscope.harness.agent.sandbox.filesystem.SandboxFilesystemSpec;
2222
import io.agentscope.harness.agent.sandbox.snapshot.SandboxSnapshotSpec;
2323

2424
/**

agentscope-examples/harness-examples/harness-sandbox-docker/src/main/java/io/agentscope/examples/harness/sandbox/DockerPythonSandboxExample.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
import io.agentscope.core.model.DashScopeChatModel;
2626
import io.agentscope.core.model.Model;
2727
import io.agentscope.harness.agent.HarnessAgent;
28+
import io.agentscope.harness.agent.filesystem.spec.DockerFilesystemSpec;
29+
import io.agentscope.harness.agent.filesystem.spec.SandboxFilesystemSpec;
2830
import io.agentscope.harness.agent.sandbox.SandboxDistributedOptions;
29-
import io.agentscope.harness.agent.sandbox.filesystem.DockerFilesystemSpec;
30-
import io.agentscope.harness.agent.sandbox.filesystem.SandboxFilesystemSpec;
3131
import java.nio.file.Files;
3232
import java.nio.file.Path;
3333
import java.nio.file.Paths;

agentscope-harness/pom.xml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,5 +61,21 @@
6161
<artifactId>aliyun-sdk-oss</artifactId>
6262
<version>3.18.5</version>
6363
</dependency>
64+
65+
<!-- Optional sandbox backends (io.agentscope.harness.agent.sandbox.impl.*) -->
66+
<dependency>
67+
<groupId>io.fabric8</groupId>
68+
<artifactId>kubernetes-client</artifactId>
69+
</dependency>
70+
<dependency>
71+
<groupId>com.google.protobuf</groupId>
72+
<artifactId>protobuf-java</artifactId>
73+
</dependency>
74+
75+
<dependency>
76+
<groupId>io.fabric8</groupId>
77+
<artifactId>kubernetes-server-mock</artifactId>
78+
<scope>test</scope>
79+
</dependency>
6480
</dependencies>
6581
</project>

0 commit comments

Comments
 (0)