|
| 1 | +# Copyright 2025 Alibaba Group Holding Ltd. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +# Example Kubernetes Runtime Configuration for OpenSandbox Server |
| 16 | +# |
| 17 | +# This configuration file demonstrates how to configure the OpenSandbox server |
| 18 | +# to use Kubernetes as the sandbox runtime. |
| 19 | +# |
| 20 | +# Usage: |
| 21 | +# 1. Copy this file to ~/.sandbox.toml (or set SANDBOX_CONFIG_PATH environment variable) |
| 22 | +# 2. Update the configuration values according to your environment |
| 23 | +# 3. Start the server: uvicorn src.main:app --host 0.0.0.0 --port 8080 |
| 24 | + |
| 25 | +[server] |
| 26 | +host = "0.0.0.0" |
| 27 | +port = 8080 |
| 28 | +log_level = "INFO" |
| 29 | +# api_key = "your-secret-api-key" # Optional: Uncomment to enable API key authentication |
| 30 | + |
| 31 | +[runtime] |
| 32 | +type = "kubernetes" |
| 33 | +execd_image = "sandbox-registry.cn-zhangjiakou.cr.aliyuncs.com/opensandbox/execd:latest" |
| 34 | + |
| 35 | +[kubernetes] |
| 36 | +# Path to kubeconfig file. Leave as null to use in-cluster configuration |
| 37 | +# Replace with your path |
| 38 | +kubeconfig_path = "~/.kube/config" |
| 39 | + |
| 40 | +# Namespace for sandbox workloads |
| 41 | +namespace = "opensandbox" |
| 42 | + |
| 43 | +# Workload provider type: available providers are registered in the provider factory |
| 44 | +# If not specified, uses the first registered provider (typically "batchsandbox") |
| 45 | +workload_provider = "batchsandbox" |
| 46 | + |
| 47 | +# Path to the BatchSandbox template file |
| 48 | +# Replace with your path |
| 49 | +batchsandbox_template_file = "~/batchsandbox-template.yaml" |
0 commit comments