ms-enclave 0.0.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ms_enclave/__init__.py +3 -0
- ms_enclave/cli/__init__.py +1 -0
- ms_enclave/cli/base.py +20 -0
- ms_enclave/cli/cli.py +27 -0
- ms_enclave/cli/start_server.py +84 -0
- ms_enclave/sandbox/__init__.py +27 -0
- ms_enclave/sandbox/boxes/__init__.py +16 -0
- ms_enclave/sandbox/boxes/base.py +274 -0
- ms_enclave/sandbox/boxes/docker_notebook.py +224 -0
- ms_enclave/sandbox/boxes/docker_sandbox.py +317 -0
- ms_enclave/sandbox/manager/__init__.py +11 -0
- ms_enclave/sandbox/manager/base.py +155 -0
- ms_enclave/sandbox/manager/http_manager.py +405 -0
- ms_enclave/sandbox/manager/local_manager.py +295 -0
- ms_enclave/sandbox/model/__init__.py +21 -0
- ms_enclave/sandbox/model/base.py +75 -0
- ms_enclave/sandbox/model/config.py +97 -0
- ms_enclave/sandbox/model/requests.py +57 -0
- ms_enclave/sandbox/model/responses.py +57 -0
- ms_enclave/sandbox/server/__init__.py +0 -0
- ms_enclave/sandbox/server/server.py +195 -0
- ms_enclave/sandbox/tools/__init__.py +4 -0
- ms_enclave/sandbox/tools/base.py +119 -0
- ms_enclave/sandbox/tools/sandbox_tool.py +46 -0
- ms_enclave/sandbox/tools/sandbox_tools/__init__.py +4 -0
- ms_enclave/sandbox/tools/sandbox_tools/file_operation.py +331 -0
- ms_enclave/sandbox/tools/sandbox_tools/notebook_executor.py +167 -0
- ms_enclave/sandbox/tools/sandbox_tools/python_executor.py +87 -0
- ms_enclave/sandbox/tools/sandbox_tools/shell_executor.py +72 -0
- ms_enclave/sandbox/tools/tool_info.py +141 -0
- ms_enclave/utils/__init__.py +1 -0
- ms_enclave/utils/json_schema.py +208 -0
- ms_enclave/utils/logger.py +170 -0
- ms_enclave/version.py +2 -0
- ms_enclave-0.0.3.dist-info/METADATA +370 -0
- ms_enclave-0.0.3.dist-info/RECORD +40 -0
- ms_enclave-0.0.3.dist-info/WHEEL +5 -0
- ms_enclave-0.0.3.dist-info/entry_points.txt +2 -0
- ms_enclave-0.0.3.dist-info/licenses/LICENSE +201 -0
- ms_enclave-0.0.3.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ms-enclave
|
|
3
|
+
Version: 0.0.3
|
|
4
|
+
Summary: Modularized and Stable Sandbox runtime environment.
|
|
5
|
+
Author: ModelScope team
|
|
6
|
+
Author-email: contact@modelscope.cn
|
|
7
|
+
License: Apache License 2.0
|
|
8
|
+
Project-URL: Homepage, https://github.com/modelscope/ms-enclave
|
|
9
|
+
Keywords: python,llm,sandbox
|
|
10
|
+
Requires-Python: >=3.10
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: fastapi>=0.104.0
|
|
14
|
+
Requires-Dist: uvicorn[standard]>=0.24.0
|
|
15
|
+
Requires-Dist: openai
|
|
16
|
+
Requires-Dist: pydantic>=2.11.7
|
|
17
|
+
Requires-Dist: requests>=2.32.4
|
|
18
|
+
Requires-Dist: shortuuid>=1.0.13
|
|
19
|
+
Requires-Dist: aiohttp>=3.8.1
|
|
20
|
+
Requires-Dist: docstring-parser
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: pytest>=8.3.5; extra == "dev"
|
|
23
|
+
Requires-Dist: pytest-asyncio>=0.23.0; extra == "dev"
|
|
24
|
+
Requires-Dist: pre-commit>=4.2.0; extra == "dev"
|
|
25
|
+
Requires-Dist: jupyter-book>=1.0.4.post1; extra == "dev"
|
|
26
|
+
Requires-Dist: pytest-cov>=6.2.1; extra == "dev"
|
|
27
|
+
Provides-Extra: docker
|
|
28
|
+
Requires-Dist: docker>=7.1.0; extra == "docker"
|
|
29
|
+
Requires-Dist: websocket-client; extra == "docker"
|
|
30
|
+
Dynamic: license-file
|
|
31
|
+
|
|
32
|
+
<p align="center">
|
|
33
|
+
<br>
|
|
34
|
+
<img src="doc/asset/image/logo.png"/>
|
|
35
|
+
<br>
|
|
36
|
+
<p>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="README_zh.md">δΈζ</a>   ο½   English  
|
|
40
|
+
</p>
|
|
41
|
+
|
|
42
|
+
<p align="center">
|
|
43
|
+
<img src="https://img.shields.io/badge/python-%E2%89%A53.10-5be.svg">
|
|
44
|
+
<a href="https://badge.fury.io/py/ms-enclave"><img src="https://badge.fury.io/py/ms-enclave.svg" alt="PyPI version" height="18"></a>
|
|
45
|
+
<a href="https://pypi.org/project/ms-enclave"><img alt="PyPI - Downloads" src="https://static.pepy.tech/badge/ms-enclave"></a>
|
|
46
|
+
<a href="https://github.com/modelscope/ms-enclave/pulls"><img src="https://img.shields.io/badge/PR-welcome-55EB99.svg"></a>
|
|
47
|
+
<p>
|
|
48
|
+
|
|
49
|
+
## Overview
|
|
50
|
+
|
|
51
|
+
ms-enclave is a modular and stable agent sandbox runtime environment that provides a secure isolated execution environment for applications. It achieves strong isolation through Docker containers, with accompanying local/HTTP managers and an extensible tool system, enabling you to safely and efficiently execute code in a controlled environment.
|
|
52
|
+
|
|
53
|
+
- π Secure Isolation: Full isolation and resource limitation based on Docker
|
|
54
|
+
- π§© Modular: Extensible sandbox and tools (registration factory)
|
|
55
|
+
- β‘ Stable Performance: Simple implementation, fast startup, lifecycle management
|
|
56
|
+
- π Remote Management: Built-in FastAPI service, supports HTTP management
|
|
57
|
+
- π§ Tool System: Standardized tools enabled by sandbox type (OpenAI-style schema)
|
|
58
|
+
|
|
59
|
+
## System Requirements
|
|
60
|
+
|
|
61
|
+
- Python >= 3.10
|
|
62
|
+
- Operating System: Linux, macOS, or Windows with Docker support
|
|
63
|
+
- Docker daemon running locally (Notebook sandbox requires port 8888 open)
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
### Install from PyPI
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install ms-enclave
|
|
71
|
+
# If Docker support is needed, install extra dependencies
|
|
72
|
+
pip install 'ms-enclave[docker]'
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Install from Source
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
git clone https://github.com/modelscope/ms-enclave.git
|
|
79
|
+
cd ms-enclave
|
|
80
|
+
pip install -e .
|
|
81
|
+
# If Docker support is needed, install extra dependencies
|
|
82
|
+
pip install -e '.[docker]'
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Quick Start: Minimal Example (SandboxFactory)
|
|
86
|
+
|
|
87
|
+
> Tools need to be explicitly enabled in the tools_config setting, otherwise they won't be registered.
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
import asyncio
|
|
91
|
+
from ms_enclave.sandbox.boxes import SandboxFactory
|
|
92
|
+
from ms_enclave.sandbox.model import DockerSandboxConfig, SandboxType
|
|
93
|
+
|
|
94
|
+
async def main():
|
|
95
|
+
config = DockerSandboxConfig(
|
|
96
|
+
image='python:3.11-slim',
|
|
97
|
+
memory_limit='512m',
|
|
98
|
+
tools_config={
|
|
99
|
+
'python_executor': {},
|
|
100
|
+
'file_operation': {},
|
|
101
|
+
'shell_executor': {}
|
|
102
|
+
}
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
async with SandboxFactory.create_sandbox(SandboxType.DOCKER, config) as sandbox:
|
|
106
|
+
# 1) Write a file
|
|
107
|
+
await sandbox.execute_tool('file_operation', {
|
|
108
|
+
'operation': 'write', 'file_path': '/sandbox/hello.txt', 'content': 'hi from enclave'
|
|
109
|
+
})
|
|
110
|
+
# 2) Execute Python code
|
|
111
|
+
result = await sandbox.execute_tool('python_executor', {
|
|
112
|
+
'code': "print('Hello from sandbox!')\nprint(open('/sandbox/hello.txt').read())"
|
|
113
|
+
})
|
|
114
|
+
print(result.output)
|
|
115
|
+
|
|
116
|
+
asyncio.run(main())
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Typical Usage Scenarios and Examples
|
|
122
|
+
|
|
123
|
+
- Directly using SandboxFactory: Create/destroy sandboxes in a single processβlightweight; suitable for scripts or one-off tasks
|
|
124
|
+
- Using LocalSandboxManager: Manage the lifecycle/cleanup of multiple sandboxes locally; suitable for service-oriented or multi-task parallel scenarios
|
|
125
|
+
- Using HttpSandboxManager: Unified sandbox management through remote HTTP services; suitable for cross-machine/distributed or more isolated deployments
|
|
126
|
+
|
|
127
|
+
### 1) Direct Sandbox Creation: SandboxFactory (Lightweight, Temporary)
|
|
128
|
+
|
|
129
|
+
Usage Scenarios:
|
|
130
|
+
|
|
131
|
+
- Temporarily execute code in scripts or microservices
|
|
132
|
+
- Fine-grained control over sandbox lifecycle (cleanup upon context exit)
|
|
133
|
+
|
|
134
|
+
Example (Docker Sandbox + Python Execution):
|
|
135
|
+
|
|
136
|
+
```python
|
|
137
|
+
import asyncio
|
|
138
|
+
from ms_enclave.sandbox.boxes import SandboxFactory
|
|
139
|
+
from ms_enclave.sandbox.model import DockerSandboxConfig, SandboxType
|
|
140
|
+
|
|
141
|
+
async def main():
|
|
142
|
+
cfg = DockerSandboxConfig(
|
|
143
|
+
tools_config={'python_executor': {}}
|
|
144
|
+
)
|
|
145
|
+
async with SandboxFactory.create_sandbox(SandboxType.DOCKER, cfg) as sb:
|
|
146
|
+
r = await sb.execute_tool('python_executor', {
|
|
147
|
+
'code': 'import platform; print(platform.python_version())'
|
|
148
|
+
})
|
|
149
|
+
print(r.output)
|
|
150
|
+
|
|
151
|
+
asyncio.run(main())
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 2) Local Unified Management: LocalSandboxManager (Multi-Sandbox, Lifecycle Management)
|
|
155
|
+
|
|
156
|
+
Usage Scenarios:
|
|
157
|
+
|
|
158
|
+
- Create/manage multiple sandboxes within the same process (creation, query, stop, periodic cleanup)
|
|
159
|
+
- Unified view for monitoring stats and health
|
|
160
|
+
|
|
161
|
+
Example:
|
|
162
|
+
|
|
163
|
+
```python
|
|
164
|
+
import asyncio
|
|
165
|
+
from ms_enclave.sandbox.manager import LocalSandboxManager
|
|
166
|
+
from ms_enclave.sandbox.model import DockerSandboxConfig, SandboxType
|
|
167
|
+
|
|
168
|
+
async def main():
|
|
169
|
+
async with LocalSandboxManager() as manager:
|
|
170
|
+
cfg = DockerSandboxConfig(tools_config={'shell_executor': {}})
|
|
171
|
+
sandbox_id = await manager.create_sandbox(SandboxType.DOCKER, cfg)
|
|
172
|
+
|
|
173
|
+
# Execute command
|
|
174
|
+
res = await manager.execute_tool(sandbox_id, 'shell_executor', {'command': 'echo hello'})
|
|
175
|
+
print(res.output.strip()) # hello
|
|
176
|
+
|
|
177
|
+
# View list
|
|
178
|
+
infos = await manager.list_sandboxes()
|
|
179
|
+
print([i.id for i in infos])
|
|
180
|
+
|
|
181
|
+
# Stop and delete
|
|
182
|
+
await manager.stop_sandbox(sandbox_id)
|
|
183
|
+
await manager.delete_sandbox(sandbox_id)
|
|
184
|
+
|
|
185
|
+
asyncio.run(main())
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### 3) Remote Unified Management: HttpSandboxManager (Cross-Machine/Isolated Deployment)
|
|
189
|
+
|
|
190
|
+
Usage Scenarios:
|
|
191
|
+
|
|
192
|
+
- Run sandbox services on dedicated hosts/containers, invoke remotely via HTTP
|
|
193
|
+
- Share a secure controlled sandbox cluster among multiple applications
|
|
194
|
+
|
|
195
|
+
Start the service (choose one):
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Option A: Command line
|
|
199
|
+
ms-enclave server --host 0.0.0.0 --port 8000
|
|
200
|
+
|
|
201
|
+
# Option B: Python script
|
|
202
|
+
python -c "from ms_enclave.sandbox import create_server; create_server().run(host='0.0.0.0', port=8000)"
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Client Example:
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
import asyncio
|
|
209
|
+
from ms_enclave.sandbox.manager import HttpSandboxManager
|
|
210
|
+
from ms_enclave.sandbox.model import DockerSandboxConfig, SandboxType
|
|
211
|
+
|
|
212
|
+
async def main():
|
|
213
|
+
async with HttpSandboxManager(base_url='http://127.0.0.1:8000') as m:
|
|
214
|
+
cfg = DockerSandboxConfig(tools_config={'python_executor': {}})
|
|
215
|
+
sid = await m.create_sandbox(SandboxType.DOCKER, cfg)
|
|
216
|
+
r = await m.execute_tool(sid, 'python_executor', {'code': 'print("Hello remote")'})
|
|
217
|
+
print(r.output)
|
|
218
|
+
await m.delete_sandbox(sid)
|
|
219
|
+
|
|
220
|
+
asyncio.run(main())
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Sandbox Types and Tool Support
|
|
226
|
+
|
|
227
|
+
Currently Supported Sandbox Types:
|
|
228
|
+
|
|
229
|
+
- DOCKER (General-purpose container execution)
|
|
230
|
+
- Supported tools:
|
|
231
|
+
- python_executor (execute Python code)
|
|
232
|
+
- shell_executor (execute Shell commands)
|
|
233
|
+
- file_operation (read/write/delete/list files)
|
|
234
|
+
- Features: Configurable memory/CPU limits, volume mounts, network toggling, privileged mode, port mapping
|
|
235
|
+
|
|
236
|
+
- DOCKER_NOTEBOOK (Jupyter Kernel Gateway environment)
|
|
237
|
+
- Supported tools:
|
|
238
|
+
- notebook_executor (execute code via Jupyter Kernel, supports context saving)
|
|
239
|
+
- Note: This type only loads notebook_executor; other DOCKER-specific tools won't be enabled in this sandbox.
|
|
240
|
+
- Dependencies: Requires port 8888 exposed and network enabled
|
|
241
|
+
|
|
242
|
+
Tool Loading Rules:
|
|
243
|
+
|
|
244
|
+
- Tools are initialized and made available only when explicitly declared in `tools_config`.
|
|
245
|
+
- Tools validate `required_sandbox_type`; unmatched types will be ignored automatically.
|
|
246
|
+
|
|
247
|
+
Example:
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
DockerSandboxConfig(tools_config={'python_executor': {}, 'shell_executor': {}, 'file_operation': {}})
|
|
251
|
+
DockerNotebookConfig(tools_config={'notebook_executor': {}})
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Common Configuration Options
|
|
257
|
+
|
|
258
|
+
- `image`: Docker image name (e.g., `python:3.11-slim` or `jupyter-kernel-gateway`)
|
|
259
|
+
- `memory_limit`: Memory limit (e.g., `512m` / `1g`)
|
|
260
|
+
- `cpu_limit`: CPU limit (float > 0)
|
|
261
|
+
- `volumes`: Volume mounts, e.g., `{host_path: {"bind": "/container/path", "mode": "rw"}}`
|
|
262
|
+
- `ports`: Port mappings, e.g., `{ "8888/tcp": ("127.0.0.1", 8888) }`
|
|
263
|
+
- `network_enabled`: Enable network (Notebook sandbox requires True)
|
|
264
|
+
- `remove_on_exit`: Automatically remove container on exit (default True)
|
|
265
|
+
|
|
266
|
+
**Example of Installing Additional Dependencies in Sandbox**
|
|
267
|
+
|
|
268
|
+
```python
|
|
269
|
+
async with SandboxFactory.create_sandbox(SandboxType.DOCKER, config) as sandbox:
|
|
270
|
+
# 1) Write a file
|
|
271
|
+
requirements_file = '/sandbox/requirements.txt'
|
|
272
|
+
await sandbox.execute_tool('file_operation', {
|
|
273
|
+
'operation': 'write', 'file_path': f'{requirements_file}', 'content': 'numpy\npandas\nmodelscope\n'
|
|
274
|
+
})
|
|
275
|
+
# 2) Execute Python code
|
|
276
|
+
result = await sandbox.execute_tool('python_executor', {
|
|
277
|
+
'code': f"print('Hello from sandbox!')\nprint(open(f'{requirements_file}').read())"
|
|
278
|
+
})
|
|
279
|
+
print(result.output)
|
|
280
|
+
|
|
281
|
+
# 3) Execute CLI
|
|
282
|
+
result_cli = await sandbox.execute_command(f'pip install -r {requirements_file}')
|
|
283
|
+
print(result_cli.stdout, flush=True)
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**Example of Reading and Writing Host Files in Sandbox**
|
|
287
|
+
|
|
288
|
+
```python
|
|
289
|
+
async with LocalSandboxManager() as manager:
|
|
290
|
+
# Create sandbox
|
|
291
|
+
config = DockerSandboxConfig(
|
|
292
|
+
# image='python-sandbox',
|
|
293
|
+
image='python:3.11-slim',
|
|
294
|
+
tools_config={'python_executor': {}, 'file_operation': {}},
|
|
295
|
+
volumes={'~/Code/ms-enclave/output': {'bind': '/sandbox/data', 'mode': 'rw'}}
|
|
296
|
+
)
|
|
297
|
+
sandbox_id = await manager.create_sandbox(SandboxType.DOCKER, config)
|
|
298
|
+
|
|
299
|
+
# Write file
|
|
300
|
+
result = await manager.execute_tool(
|
|
301
|
+
sandbox_id, 'file_operation', {'operation': 'write', 'file_path': '/sandbox/data/hello.txt', 'content': 'Hello, Sandbox!'}
|
|
302
|
+
)
|
|
303
|
+
print(result.model_dump())
|
|
304
|
+
```
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Error Handling and Debugging
|
|
308
|
+
|
|
309
|
+
```python
|
|
310
|
+
result = await sandbox.execute_tool('python_executor', {'code': 'print(1/0)'})
|
|
311
|
+
if result.error:
|
|
312
|
+
print('Error:', result.error)
|
|
313
|
+
else:
|
|
314
|
+
print('Output:', result.output)
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## Development and Testing
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
# Clone the repository
|
|
323
|
+
git clone https://github.com/modelscope/ms-enclave.git
|
|
324
|
+
cd ms-enclave
|
|
325
|
+
|
|
326
|
+
# Setup virtual environment
|
|
327
|
+
python -m venv venv
|
|
328
|
+
source venv/bin/activate # Windows: venv\Scripts\activate
|
|
329
|
+
|
|
330
|
+
# Install dependencies
|
|
331
|
+
pip install -e ".[dev]"
|
|
332
|
+
|
|
333
|
+
# Run tests
|
|
334
|
+
pytest
|
|
335
|
+
|
|
336
|
+
# Run examples (provided in the repository)
|
|
337
|
+
python examples/sandbox_usage_examples.py
|
|
338
|
+
python examples/local_manager_example.py
|
|
339
|
+
python examples/server_manager_example.py
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
---
|
|
343
|
+
|
|
344
|
+
## Available Tools
|
|
345
|
+
|
|
346
|
+
- `python_executor`: Execute Python code (DOCKER)
|
|
347
|
+
- `shell_executor`: Execute Shell commands (DOCKER)
|
|
348
|
+
- `file_operation`: Read/Write/Delete/List files (DOCKER)
|
|
349
|
+
- `notebook_executor`: Execute via Jupyter Kernel (DOCKER_NOTEBOOK)
|
|
350
|
+
- You can also register custom tools via the Tool factory (`@register_tool`).
|
|
351
|
+
|
|
352
|
+
---
|
|
353
|
+
|
|
354
|
+
## Contribution
|
|
355
|
+
|
|
356
|
+
We welcome contributions! Please check [CONTRIBUTING.md](CONTRIBUTING.md) for details.
|
|
357
|
+
|
|
358
|
+
### Steps to Contribute
|
|
359
|
+
|
|
360
|
+
1. Fork the repository
|
|
361
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
362
|
+
3. Develop and add tests
|
|
363
|
+
4. Run local tests: `pytest`
|
|
364
|
+
5. Commit changes: `git commit -m 'Add amazing feature'`
|
|
365
|
+
6. Push the branch: `git push origin feature/amazing-feature`
|
|
366
|
+
7. Submit a Pull Request
|
|
367
|
+
|
|
368
|
+
## License
|
|
369
|
+
|
|
370
|
+
This project is licensed under the Apache 2.0 License. See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
ms_enclave/__init__.py,sha256=IKXP5d9APyqXs14IU1mBKSr8tGxAwxeCtCnAWTOGhAU,98
|
|
2
|
+
ms_enclave/version.py,sha256=MFs2jI6s75TYZ87xYQXHClwBuFIUIkInr5aqAHNO9Qk,63
|
|
3
|
+
ms_enclave/cli/__init__.py,sha256=I_ANdxdcIHpkIzIXc1yKOlWwzb4oY0FwTPq1kYtgzQw,50
|
|
4
|
+
ms_enclave/cli/base.py,sha256=m1DFlF16L0Lyrn0YNuFj8ByGjVJIoI0jKzAoodIXjRk,404
|
|
5
|
+
ms_enclave/cli/cli.py,sha256=AoSPw65_7OBMT8qgv5vPz1S3Fo91Y6yluaDGGHbUDj0,693
|
|
6
|
+
ms_enclave/cli/start_server.py,sha256=FPmZ97MhWgsyXkl0y32D4XjhAak5Ogrt0Am3izRdi74,2858
|
|
7
|
+
ms_enclave/sandbox/__init__.py,sha256=OPU_W5fZE98IQ8_pAaYkN66R8TZw435Co8uw9oAyZo4,783
|
|
8
|
+
ms_enclave/sandbox/boxes/__init__.py,sha256=it3KgV8cAU4a1TQbiRz-kg7GgI5xA0nqhEAwEgUnpnQ,356
|
|
9
|
+
ms_enclave/sandbox/boxes/base.py,sha256=Cn36hvojbfPsAeZWE3kUqEogOEBgJjv5LxZHMpVHtMs,8415
|
|
10
|
+
ms_enclave/sandbox/boxes/docker_notebook.py,sha256=WbqLQhcWKeaF4JSNdVkCULdkX74X4kw-piwcWcvIG3A,8312
|
|
11
|
+
ms_enclave/sandbox/boxes/docker_sandbox.py,sha256=ouFPtJyoSeZrQKD61Qyhq13QSuZl1Ut2gD1KgBbKPUs,11755
|
|
12
|
+
ms_enclave/sandbox/manager/__init__.py,sha256=juYJsmpRoCThcILPemx6VGU-brpNF4cbu1FPV-d-tNc,255
|
|
13
|
+
ms_enclave/sandbox/manager/base.py,sha256=nXznN8Yysgkgk8i-yfL29gAh2gBi3sdxPlQciTXnN9g,3848
|
|
14
|
+
ms_enclave/sandbox/manager/http_manager.py,sha256=heVehKDi_VMJ5g9BllzmK5o68c2WIagsl8e231SKWtc,15731
|
|
15
|
+
ms_enclave/sandbox/manager/local_manager.py,sha256=lv7vF9sNOThOPnCz9RzNTcD0pZHoNTVldVanfF7c5Io,9402
|
|
16
|
+
ms_enclave/sandbox/model/__init__.py,sha256=3Sbj5Id77MWOZ1IXHGbu2q5U_p5KMLKvwZEr1QwjUqg,550
|
|
17
|
+
ms_enclave/sandbox/model/base.py,sha256=pyxfbsOBrsxrXe9ceWu10UcJ1V8MMgWaHKmpTF2RtA8,2115
|
|
18
|
+
ms_enclave/sandbox/model/config.py,sha256=afiSu5QcaZsd36lSoWMDmzz6o6kxTGebHzAqgLQOG_w,4616
|
|
19
|
+
ms_enclave/sandbox/model/requests.py,sha256=JDcANsACotKscWrLs0H_-J8BKEhALUNgmJnoy6_JZuA,2336
|
|
20
|
+
ms_enclave/sandbox/model/responses.py,sha256=AZ_BspRHzlqIP7xjI9XnoeQasIzJqMV8Qmdw23-KAwA,2502
|
|
21
|
+
ms_enclave/sandbox/server/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
|
+
ms_enclave/sandbox/server/server.py,sha256=SrSxl_C-4IudD5fXbi_cJ9EUv6A0EqxGmW9Opw4lsQE,7029
|
|
23
|
+
ms_enclave/sandbox/tools/__init__.py,sha256=McNOuC9E9Xsckp7vOAxv9TP5q6XEIUAsLbnme3kSvJI,167
|
|
24
|
+
ms_enclave/sandbox/tools/base.py,sha256=7rPX5NFJg8CC8T2QqoQFH5M4sOXbFXsENx0517_kn3k,3363
|
|
25
|
+
ms_enclave/sandbox/tools/sandbox_tool.py,sha256=iATkvNax7aae53ZnmMwmQDuDb5qcXEUI-aPXD5eVfzo,1370
|
|
26
|
+
ms_enclave/sandbox/tools/tool_info.py,sha256=A3RZLETWG9834J7r2KZfG6_JdV4UWnrFKSrEBfeCLHE,5223
|
|
27
|
+
ms_enclave/sandbox/tools/sandbox_tools/__init__.py,sha256=Mtm2jQTrztLbRVDBiitogIB3GdIrwF3Hwk5KlruyntQ,176
|
|
28
|
+
ms_enclave/sandbox/tools/sandbox_tools/file_operation.py,sha256=3yqkMdx_yrHUM4oyhd5WQm_tSV3o1-JwmBeVoIwaLfE,13348
|
|
29
|
+
ms_enclave/sandbox/tools/sandbox_tools/notebook_executor.py,sha256=kZf9QA0yk-aFOJjtAbzYdKfNwjcoBSrscT9mWsv906w,6029
|
|
30
|
+
ms_enclave/sandbox/tools/sandbox_tools/python_executor.py,sha256=SlhenlO09B_eVfcnrqSZAVYC_JCMws0eXj-caR2BTmw,3259
|
|
31
|
+
ms_enclave/sandbox/tools/sandbox_tools/shell_executor.py,sha256=V5IwRvjGzRD6HSymn-HxaFUwKmX6tZYieKCG_bs7_1U,2641
|
|
32
|
+
ms_enclave/utils/__init__.py,sha256=KYWYfti4m8TcWzjOfmollEfEArTgTasq2Zuaz9AkzZI,31
|
|
33
|
+
ms_enclave/utils/json_schema.py,sha256=hBhdMilb9_7JZaFZBb_THPrq8N4m_rJPD43mfwnTx14,7431
|
|
34
|
+
ms_enclave/utils/logger.py,sha256=Hg_iVhgUX39LlWiQsvCyDx9NwQt3wQUukbOSCiLYEQU,5974
|
|
35
|
+
ms_enclave-0.0.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
36
|
+
ms_enclave-0.0.3.dist-info/METADATA,sha256=UMhFn9YDm36Dgyuze1X5LrboLApia1ki0SkrV7bPH7s,12192
|
|
37
|
+
ms_enclave-0.0.3.dist-info/WHEEL,sha256=SmOxYU7pzNKBqASvQJ7DjX3XGUF92lrGhMb3R6_iiqI,91
|
|
38
|
+
ms_enclave-0.0.3.dist-info/entry_points.txt,sha256=Av3oIAE91Jj-742sTPA90ktrrq8lDowFC2RfXLwM8JM,58
|
|
39
|
+
ms_enclave-0.0.3.dist-info/top_level.txt,sha256=V_Q9rBOF-RGwACDP9ppukoyjaOtpjdht7dhe7StS86A,11
|
|
40
|
+
ms_enclave-0.0.3.dist-info/RECORD,,
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ms_enclave
|