mirror of
https://github.com/agent-substrate/substrate.git
synced 2026-11-12 10:35:06 +08:00
+7








af3c65088e
This is the initial release of the Agent Substrate. Agent substrate is a system built on top of Kubernetes which manages agent-like workloads to achieve higher scale and efficiency than Kubernetes alone can offer, with lower latency. It builds on top of Kubernetes features like Pods and Pod autoscaling, but takes the Kubernetes control-plane out of the critical path to achieve lower latency. It can run on any Kubernetes cluster and does not inhibit “regular” use of Kubernetes in any way. Kubernetes provides the infrastructure provisioning and management for all types of workloads, while Agent Substrate provides agent-specific scheduling and control. At its core, Agent Substrate maps a larger set of “actors” (applications such as agents) onto a smaller set of ready “workers” (Kubernetes Pods), relying on the fact that agent-like applications tend to be idle most of the time to achieve heavy multiplexing. It provides functionality to manage an actor’s lifecycle (e.g. create/destroy, suspend/resume), to assign actors to workers in real time, and to route incoming traffic to them. Agent Substrate is intended to be a low-opinion system. The workloads it manages don't have to be literal AI agents, but those are the best example of the kind of applications it is designed for. It is not an SDK for building agents, but rather a system for running them at scale. Agent Substrate is currently in VERY early development. It is not ready for production use, and the APIs are almost guaranteed to change. We are not making any guarantees about backward compatibility at this stage, and everything in this project may be changed. Co-authored-by: Alex Bulankou <alexbu@google.com> Co-authored-by: Benjamin Elder <bentheelder@google.com> Co-authored-by: Bowei Du <bowei@google.com> Co-authored-by: Dmitry Berkovich <dberkov@google.com> Co-authored-by: Fabricio Voznika <fvoznika@google.com> Co-authored-by: Francisco Cabrera <fclieutier@google.com> Co-authored-by: Haven Xia <haoyuxia@google.com> Co-authored-by: Julian Gutierrez Oschmann <juliangut@google.com> Co-authored-by: Kevin Steuer <ksteuer@google.com> Co-authored-by: Max Smythe <smythe@google.com> Co-authored-by: Maya Wang <mymaya@google.com> Co-authored-by: Michael Taufen <mtaufen@google.com> Co-authored-by: Shruti Nair <shrutinair@google.com> Co-authored-by: Taahir Ahmed <taahm@google.com> Co-authored-by: Tim Hockin <thockin@google.com> Co-authored-by: Zoe Zhao <zoezhao@google.com>
110 lines
3.0 KiB
Bash
Executable File
110 lines
3.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2026 Google LLC
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
set -e
|
|
set -u
|
|
set -o pipefail
|
|
|
|
ROOT=$(git rev-parse --show-toplevel)
|
|
cd "${ROOT}"
|
|
|
|
if [[ -r .ate-dev-env.sh ]] && [[ -z "${NO_DEV_ENV:-}" ]]; then
|
|
source .ate-dev-env.sh
|
|
fi
|
|
|
|
show_help() {
|
|
cat <<EOF
|
|
Usage: $0 [target-path] [go-test-flags] [-args [e2e-flags]]
|
|
|
|
Runs End-to-End tests.
|
|
|
|
The optional "target-path" must be the first argument and must start with
|
|
"./internal/e2e" or "internal/e2e". It defaults to "./internal/e2e/suites/...".
|
|
|
|
Arguments before "-args" (excluding the target-path) are passed directly to "go test".
|
|
Arguments after "-args" are passed to the test binary.
|
|
|
|
Example:
|
|
$0 -run TestExample # Run only TestExample suite
|
|
$0 -args -kube-context my-context # Pass kube-context to E2E framework
|
|
$0 -run TestExample -args -no-color # Combine both
|
|
|
|
Common E2E Flags (passed after -args):
|
|
-e2e Enable E2E tests (implied by this script)
|
|
-no-color Disable colored output
|
|
-kube-config Path to kubeconfig file
|
|
-kube-context Kubernetes context to use
|
|
|
|
Common Go Test Flags (passed before -args):
|
|
-run <regexp> Run only tests matching regexp
|
|
-v Verbose output
|
|
-count n Run tests n times
|
|
|
|
See "go help testflag" for more Go test flags.
|
|
EOF
|
|
}
|
|
|
|
target_path="./internal/e2e/suites/..."
|
|
|
|
if [[ "$#" -gt 0 ]]; then
|
|
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
|
|
show_help
|
|
exit 0
|
|
fi
|
|
|
|
if [[ "$1" == "./internal/e2e"* || "$1" == "internal/e2e"* ]]; then
|
|
target_path="$1"
|
|
shift
|
|
elif [[ "$1" == -* ]]; then
|
|
# It's a flag, keep default target_path, don't shift
|
|
:
|
|
else
|
|
echo "Error: Invalid target path '$1'." >&2
|
|
echo "The first argument must be a valid E2E path starting with './internal/e2e' or a flag starting with '-'." >&2
|
|
echo "Use '$0 -h' for help." >&2
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
go_test_args=()
|
|
e2e_args=()
|
|
found_args_sep=false
|
|
|
|
for arg in "$@"; do
|
|
if [[ "$arg" == "-h" || "$arg" == "--help" ]]; then
|
|
show_help
|
|
exit 0
|
|
fi
|
|
if [[ "$arg" == "-args" ]]; then
|
|
found_args_sep=true
|
|
continue
|
|
fi
|
|
|
|
if [[ "$found_args_sep" == "true" ]]; then
|
|
e2e_args+=("$arg")
|
|
else
|
|
go_test_args+=("$arg")
|
|
fi
|
|
done
|
|
|
|
extra_e2e_args=()
|
|
if [[ -n "${KUBECTL_CONTEXT:-}" ]]; then
|
|
extra_e2e_args+=("-kube-context" "${KUBECTL_CONTEXT}")
|
|
fi
|
|
|
|
exec go test -v "$target_path" "${go_test_args[@]}" -args -e2e "${extra_e2e_args[@]}" "${e2e_args[@]}"
|
|
|