diff --git a/AGENTS.md b/AGENTS.md index 659e047..c858aa7 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -7,7 +7,7 @@ It takes the Kubernetes control-plane out of the critical path to achieve lower Agent Substrate relies on the fact that agent-like applications tend to be idle most of the time to achieve heavy multiplexing. For development, it's recommended to read the `README.md` and `CONTRIBUTING.md` in the root folder. -See `hack/install-ate.sh` and `cmd/setup` for provisioning and deploying clusters and GCP resources. +See `hack/install-ate.sh` and `tools/setup-gcp` for provisioning and deploying clusters and GCP resources. ## Build and Test Commands @@ -35,7 +35,7 @@ Agent Substrate uses a `Makefile` for its build and test tasks. 1. Write tests for all new code. We will not merge code that lacks tests. 2. Ensure changes do not break existing tests. 3. Run `make verify` locally before requesting a code review to catch common issues like missed copyright headers or formatting drift. -4. For end-to-end tests involving the actual infrastructure, ensure you have a running cluster (setup via `hack/ate-dev-env.sh.example` and `go run ./cmd/setup --all`). +4. For end-to-end tests involving the actual infrastructure, ensure you have a running cluster (setup via `hack/ate-dev-env.sh.example` and `go run ./tools/setup-gcp --all`). ## Security Considerations diff --git a/Makefile b/Makefile index 47a6c45..68ce2ff 100644 --- a/Makefile +++ b/Makefile @@ -34,10 +34,10 @@ build: build-images build-atectl .PHONY: build-images build-images: - $(KO) build ./cmd/servers/ateapi - $(KO) build ./cmd/servers/atelet - $(KO) build ./cmd/servers/podcertcontroller - $(KO) build ./cmd/servers/atenet + $(KO) build ./cmd/ateapi + $(KO) build ./cmd/atelet + $(KO) build ./cmd/podcertcontroller + $(KO) build ./cmd/atenet .PHONY: build-atectl build-atectl: @@ -45,7 +45,7 @@ build-atectl: .PHONY: build-atenet build-atenet: - $(GO) build -o $(BINDIR)/atenet ./cmd/servers/atenet + $(GO) build -o $(BINDIR)/atenet ./cmd/atenet .PHONY: build-demos build-demos: diff --git a/README.md b/README.md index 2e7b0f5..1433d32 100644 --- a/README.md +++ b/README.md @@ -132,7 +132,7 @@ curl -X POST -H "Host: my-counter-1.actors.resources.substrate.ate.dev" -i http: 3. Provision the required GCP resources (GKE cluster, Redis, GCS, and IAM bindings): ```bash - go run ./cmd/setup --all + go run ./tools/setup-gcp --all ``` 4. Deploy the Agent Substrate system to your cluster (remember to navigate back to root directory of this repo before running the following commands): @@ -147,10 +147,10 @@ curl -X POST -H "Host: my-counter-1.actors.resources.substrate.ate.dev" -i http: #### Custom Setup and Deployment -You can run individual setup steps to create GCP resources as needed. See `go run ./cmd/setup --help` for available options. For example: +You can run individual setup steps to create GCP resources as needed. See `go run ./tools/setup-gcp --help` for available options. For example: ```bash -go run ./cmd/setup --create-cluster -go run ./cmd/setup --create-gvisor-node-pool +go run ./tools/setup-gcp --create-cluster +go run ./tools/setup-gcp --create-gvisor-node-pool ``` Similarly, you can deploy or cleanup specific Agent Substrate components using the installation script. See `./hack/install-ate.sh --help` for all options. @@ -198,13 +198,13 @@ We provide several sample applications demonstrating Agent Substrate's capabilit ### Commands -* `cmd/servers/ateapi`: The core control plane API server exposing gRPC endpoints to manage actor and worker lifecycles. -* `cmd/servers/atelet`: A node-level DaemonSet that supervises physical worker pods, coordinates snapshotting, and manages state transfers. -* `cmd/servers/atecontroller`: A Kubernetes controller that reconciles WorkerPool and ActorTemplate custom resources. -* `cmd/servers/atenet`: A combined networking controller providing DNS, Envoy routing, and proxy sidecars. -* `cmd/servers/ateom-gvisor`: An interior-pod helper running inside sandboxed worker pods to execute `runsc` checkpoint and restore commands. -* `cmd/servers/podcertcontroller`: A "polyfill" that provides Pod Certificate signers that +* `cmd/ateapi`: The core control plane API server exposing gRPC endpoints to manage actor and worker lifecycles. +* `cmd/atelet`: A node-level DaemonSet that supervises physical worker pods, coordinates snapshotting, and manages state transfers. +* `cmd/atecontroller`: A Kubernetes controller that reconciles WorkerPool and ActorTemplate custom resources. +* `cmd/atenet`: A combined networking controller providing DNS, Envoy routing, and proxy sidecars. +* `cmd/ateom-gvisor`: An interior-pod helper running inside sandboxed worker pods to execute `runsc` checkpoint and restore commands. +* `cmd/podcertcontroller`: A "polyfill" that provides Pod Certificate signers that will eventually ship in upstream Kubernetes (with different names). * `cmd/kubectl-ate`: A CLI tool for managing Agent Substrate resources. See its [README](cmd/kubectl-ate/README.md). -* `cmd/setup`: A provisioning utility to set up the necessary GCP infrastructure resources (GKE, GCS, IAM). +* `tools/setup-gcp`: A provisioning utility to set up the necessary GCP infrastructure resources (GKE, GCS, IAM). * `demos/`: Sample applications demonstrating Agent Substrate capabilities. diff --git a/api/v1alpha1/gen.go b/api/v1alpha1/gen.go deleted file mode 100644 index 935a143..0000000 --- a/api/v1alpha1/gen.go +++ /dev/null @@ -1,20 +0,0 @@ -// 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. - -package v1alpha1 - -//go:generate bash ../../hack/run-tool.sh controller-gen crd:headerFile=../../hack/boilerplate/yaml.txt object:headerFile=../../hack/boilerplate/go.txt paths="./" output:crd:dir="../../manifests/ate-install/generated/" -//go:generate bash ../../hack/run-tool.sh client-gen --go-header-file=../../hack/boilerplate/go.txt --clientset-name versioned --input-base github.com/agent-substrate/substrate --input api/v1alpha1 --output-pkg github.com/agent-substrate/substrate/pkg/client/clientset --output-dir ../../pkg/client/clientset -//go:generate bash ../../hack/run-tool.sh lister-gen --go-header-file=../../hack/boilerplate/go.txt --output-pkg github.com/agent-substrate/substrate/pkg/client/listers --output-dir ../../pkg/client/listers github.com/agent-substrate/substrate/api/v1alpha1 -//go:generate bash ../../hack/run-tool.sh informer-gen --go-header-file=../../hack/boilerplate/go.txt --versioned-clientset-package github.com/agent-substrate/substrate/pkg/client/clientset/versioned --listers-package github.com/agent-substrate/substrate/pkg/client/listers --output-pkg github.com/agent-substrate/substrate/pkg/client/informers --output-dir ../../pkg/client/informers github.com/agent-substrate/substrate/api/v1alpha1 diff --git a/benchmarking/locust/common/ateapi_pb2.py b/benchmarking/locust/common/ateapi_pb2.py index 03cb010..4c05ee8 100644 --- a/benchmarking/locust/common/ateapi_pb2.py +++ b/benchmarking/locust/common/ateapi_pb2.py @@ -38,14 +38,14 @@ -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x61teapi.proto\x12\x06\x61teapi\"\x87\x03\n\x05\x41\x63tor\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12 \n\x18\x61\x63tor_template_namespace\x18\x03 \x01(\t\x12\x1b\n\x13\x61\x63tor_template_name\x18\x04 \x01(\t\x12$\n\x06status\x18\x05 \x01(\x0e\x32\x14.ateapi.Actor.Status\x12\x1b\n\x13\x61teom_pod_namespace\x18\x06 \x01(\t\x12\x16\n\x0e\x61teom_pod_name\x18\x07 \x01(\t\x12\x14\n\x0c\x61teom_pod_ip\x18\x08 \x01(\t\x12\x15\n\rlast_snapshot\x18\t \x01(\t\x12\x1c\n\x14in_progress_snapshot\x18\n \x01(\t\"v\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x13\n\x0fSTATUS_RESUMING\x10\x01\x12\x12\n\x0eSTATUS_RUNNING\x10\x02\x12\x15\n\x11STATUS_SUSPENDING\x10\x03\x12\x14\n\x10STATUS_SUSPENDED\x10\x04\"#\n\x0fGetActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"0\n\x10GetActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"e\n\x12\x43reateActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12 \n\x18\x61\x63tor_template_namespace\x18\x02 \x01(\t\x12\x1b\n\x13\x61\x63tor_template_name\x18\x03 \x01(\t\"3\n\x13\x43reateActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"\'\n\x13SuspendActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"4\n\x14SuspendActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"4\n\x12ResumeActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12\x0c\n\x04\x62oot\x18\x02 \x01(\x08\"3\n\x13ResumeActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"&\n\x12\x44\x65leteActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"\x15\n\x13\x44\x65leteActorResponse\"\x14\n\x12ListWorkersRequest\"6\n\x13ListWorkersResponse\x12\x1f\n\x07workers\x18\x01 \x03(\x0b\x32\x0e.ateapi.Worker\"\x13\n\x11ListActorsRequest\"3\n\x12ListActorsResponse\x12\x1d\n\x06\x61\x63tors\x18\x01 \x03(\x0b\x32\r.ateapi.Actor\"\xab\x01\n\x06Worker\x12\x18\n\x10worker_namespace\x18\x01 \x01(\t\x12\x13\n\x0bworker_pool\x18\x02 \x01(\t\x12\x12\n\nworker_pod\x18\x03 \x01(\t\x12\x17\n\x0f\x61\x63tor_namespace\x18\x04 \x01(\t\x12\x16\n\x0e\x61\x63tor_template\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tor_id\x18\x06 \x01(\t\x12\n\n\x02ip\x18\x07 \x01(\t\x12\x0f\n\x07version\x18\x08 \x01(\x03\"\x13\n\x11\x44\x65\x62ugClearRequest\"\x14\n\x12\x44\x65\x62ugClearResponse\"W\n\x0eMintJWTRequest\x12\x10\n\x08\x61udience\x18\x01 \x03(\t\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\"&\n\x0fMintJWTResponse\x12\x13\n\x0bsession_jwt\x18\x01 \x01(\t\"k\n\x0fMintCertRequest\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x12\n\nsession_id\x18\x03 \x01(\t\x12#\n\x1b\x63\x65rtificate_signing_request\x18\x04 \x01(\x0c\"0\n\x10MintCertResponse\x12\x1c\n\x14session_certificates\x18\x01 \x03(\x0c\x32\xcd\x04\n\x07\x43ontrol\x12?\n\x08GetActor\x12\x17.ateapi.GetActorRequest\x1a\x18.ateapi.GetActorResponse\"\x00\x12H\n\x0b\x43reateActor\x12\x1a.ateapi.CreateActorRequest\x1a\x1b.ateapi.CreateActorResponse\"\x00\x12K\n\x0cSuspendActor\x12\x1b.ateapi.SuspendActorRequest\x1a\x1c.ateapi.SuspendActorResponse\"\x00\x12H\n\x0bResumeActor\x12\x1a.ateapi.ResumeActorRequest\x1a\x1b.ateapi.ResumeActorResponse\"\x00\x12H\n\x0b\x44\x65leteActor\x12\x1a.ateapi.DeleteActorRequest\x1a\x1b.ateapi.DeleteActorResponse\"\x00\x12H\n\x0bListWorkers\x12\x1a.ateapi.ListWorkersRequest\x1a\x1b.ateapi.ListWorkersResponse\"\x00\x12\x45\n\nListActors\x12\x19.ateapi.ListActorsRequest\x1a\x1a.ateapi.ListActorsResponse\"\x00\x12\x45\n\nDebugClear\x12\x19.ateapi.DebugClearRequest\x1a\x1a.ateapi.DebugClearResponse\"\x00\x32\x8c\x01\n\x0fSessionIdentity\x12:\n\x07MintJWT\x12\x16.ateapi.MintJWTRequest\x1a\x17.ateapi.MintJWTResponse\x12=\n\x08MintCert\x12\x17.ateapi.MintCertRequest\x1a\x18.ateapi.MintCertResponseB/Z-github.com/agent-substrate/substrate/proto/ateapipbb\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x61teapi.proto\x12\x06\x61teapi\"\x87\x03\n\x05\x41\x63tor\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\x03\x12 \n\x18\x61\x63tor_template_namespace\x18\x03 \x01(\t\x12\x1b\n\x13\x61\x63tor_template_name\x18\x04 \x01(\t\x12$\n\x06status\x18\x05 \x01(\x0e\x32\x14.ateapi.Actor.Status\x12\x1b\n\x13\x61teom_pod_namespace\x18\x06 \x01(\t\x12\x16\n\x0e\x61teom_pod_name\x18\x07 \x01(\t\x12\x14\n\x0c\x61teom_pod_ip\x18\x08 \x01(\t\x12\x15\n\rlast_snapshot\x18\t \x01(\t\x12\x1c\n\x14in_progress_snapshot\x18\n \x01(\t\"v\n\x06Status\x12\x16\n\x12STATUS_UNSPECIFIED\x10\x00\x12\x13\n\x0fSTATUS_RESUMING\x10\x01\x12\x12\n\x0eSTATUS_RUNNING\x10\x02\x12\x15\n\x11STATUS_SUSPENDING\x10\x03\x12\x14\n\x10STATUS_SUSPENDED\x10\x04\"#\n\x0fGetActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"0\n\x10GetActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"e\n\x12\x43reateActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12 \n\x18\x61\x63tor_template_namespace\x18\x02 \x01(\t\x12\x1b\n\x13\x61\x63tor_template_name\x18\x03 \x01(\t\"3\n\x13\x43reateActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"\'\n\x13SuspendActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"4\n\x14SuspendActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"4\n\x12ResumeActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\x12\x0c\n\x04\x62oot\x18\x02 \x01(\x08\"3\n\x13ResumeActorResponse\x12\x1c\n\x05\x61\x63tor\x18\x01 \x01(\x0b\x32\r.ateapi.Actor\"&\n\x12\x44\x65leteActorRequest\x12\x10\n\x08\x61\x63tor_id\x18\x01 \x01(\t\"\x15\n\x13\x44\x65leteActorResponse\"\x14\n\x12ListWorkersRequest\"6\n\x13ListWorkersResponse\x12\x1f\n\x07workers\x18\x01 \x03(\x0b\x32\x0e.ateapi.Worker\"\x13\n\x11ListActorsRequest\"3\n\x12ListActorsResponse\x12\x1d\n\x06\x61\x63tors\x18\x01 \x03(\x0b\x32\r.ateapi.Actor\"\xab\x01\n\x06Worker\x12\x18\n\x10worker_namespace\x18\x01 \x01(\t\x12\x13\n\x0bworker_pool\x18\x02 \x01(\t\x12\x12\n\nworker_pod\x18\x03 \x01(\t\x12\x17\n\x0f\x61\x63tor_namespace\x18\x04 \x01(\t\x12\x16\n\x0e\x61\x63tor_template\x18\x05 \x01(\t\x12\x10\n\x08\x61\x63tor_id\x18\x06 \x01(\t\x12\n\n\x02ip\x18\x07 \x01(\t\x12\x0f\n\x07version\x18\x08 \x01(\x03\"\x13\n\x11\x44\x65\x62ugClearRequest\"\x14\n\x12\x44\x65\x62ugClearResponse\"W\n\x0eMintJWTRequest\x12\x10\n\x08\x61udience\x18\x01 \x03(\t\x12\x0e\n\x06\x61pp_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x12\n\nsession_id\x18\x04 \x01(\t\"&\n\x0fMintJWTResponse\x12\x13\n\x0bsession_jwt\x18\x01 \x01(\t\"k\n\x0fMintCertRequest\x12\x0e\n\x06\x61pp_id\x18\x01 \x01(\t\x12\x0f\n\x07user_id\x18\x02 \x01(\t\x12\x12\n\nsession_id\x18\x03 \x01(\t\x12#\n\x1b\x63\x65rtificate_signing_request\x18\x04 \x01(\x0c\"0\n\x10MintCertResponse\x12\x1c\n\x14session_certificates\x18\x01 \x03(\x0c\x32\xcd\x04\n\x07\x43ontrol\x12?\n\x08GetActor\x12\x17.ateapi.GetActorRequest\x1a\x18.ateapi.GetActorResponse\"\x00\x12H\n\x0b\x43reateActor\x12\x1a.ateapi.CreateActorRequest\x1a\x1b.ateapi.CreateActorResponse\"\x00\x12K\n\x0cSuspendActor\x12\x1b.ateapi.SuspendActorRequest\x1a\x1c.ateapi.SuspendActorResponse\"\x00\x12H\n\x0bResumeActor\x12\x1a.ateapi.ResumeActorRequest\x1a\x1b.ateapi.ResumeActorResponse\"\x00\x12H\n\x0b\x44\x65leteActor\x12\x1a.ateapi.DeleteActorRequest\x1a\x1b.ateapi.DeleteActorResponse\"\x00\x12H\n\x0bListWorkers\x12\x1a.ateapi.ListWorkersRequest\x1a\x1b.ateapi.ListWorkersResponse\"\x00\x12\x45\n\nListActors\x12\x19.ateapi.ListActorsRequest\x1a\x1a.ateapi.ListActorsResponse\"\x00\x12\x45\n\nDebugClear\x12\x19.ateapi.DebugClearRequest\x1a\x1a.ateapi.DebugClearResponse\"\x00\x32\x8c\x01\n\x0fSessionIdentity\x12:\n\x07MintJWT\x12\x16.ateapi.MintJWTRequest\x1a\x17.ateapi.MintJWTResponse\x12=\n\x08MintCert\x12\x17.ateapi.MintCertRequest\x1a\x18.ateapi.MintCertResponseB9Z7github.com/agent-substrate/substrate/pkg/proto/ateapipbb\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ateapi_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: _globals['DESCRIPTOR']._loaded_options = None - _globals['DESCRIPTOR']._serialized_options = b'Z-github.com/agent-substrate/substrate/proto/ateapipb' + _globals['DESCRIPTOR']._serialized_options = b'Z7github.com/agent-substrate/substrate/pkg/proto/ateapipb' _globals['_ACTOR']._serialized_start=25 _globals['_ACTOR']._serialized_end=416 _globals['_ACTOR_STATUS']._serialized_start=298 diff --git a/benchmarking/locust/generate_protos.sh b/benchmarking/locust/generate_protos.sh index fc8724e..b55d5a7 100755 --- a/benchmarking/locust/generate_protos.sh +++ b/benchmarking/locust/generate_protos.sh @@ -25,7 +25,7 @@ if [[ -f .ate-dev-env.sh ]]; then source .ate-dev-env.sh fi -PROTO_PATH="proto/ateapipb" +PROTO_PATH="pkg/proto/ateapipb" PROTO_FILE="$PROTO_PATH/ateapi.proto" # Create and activate virtual environment if it doesn't exist diff --git a/benchmarking/workloads/manifests/full_workloads.yaml.tmpl b/benchmarking/workloads/manifests/full_workloads.yaml.tmpl index dccba1b..f955c36 100644 --- a/benchmarking/workloads/manifests/full_workloads.yaml.tmpl +++ b/benchmarking/workloads/manifests/full_workloads.yaml.tmpl @@ -35,7 +35,7 @@ metadata: namespace: benchmark-workloads spec: replicas: 5 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- diff --git a/benchmarking/workloads/manifests/workloads.yaml.tmpl b/benchmarking/workloads/manifests/workloads.yaml.tmpl index 1a8d33a..cc1be8c 100644 --- a/benchmarking/workloads/manifests/workloads.yaml.tmpl +++ b/benchmarking/workloads/manifests/workloads.yaml.tmpl @@ -26,7 +26,7 @@ metadata: namespace: benchmark-workloads spec: replicas: 1 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- diff --git a/cmd/servers/ateapi/controlapi/create_actor.go b/cmd/ateapi/internal/controlapi/create_actor.go similarity index 95% rename from cmd/servers/ateapi/controlapi/create_actor.go rename to cmd/ateapi/internal/controlapi/create_actor.go index 1962843..e0bae44 100644 --- a/cmd/servers/ateapi/controlapi/create_actor.go +++ b/cmd/ateapi/internal/controlapi/create_actor.go @@ -19,9 +19,9 @@ import ( "errors" "fmt" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" "github.com/agent-substrate/substrate/internal/resources" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" k8serrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/cmd/servers/ateapi/controlapi/debug_clear.go b/cmd/ateapi/internal/controlapi/debug_clear.go similarity index 94% rename from cmd/servers/ateapi/controlapi/debug_clear.go rename to cmd/ateapi/internal/controlapi/debug_clear.go index 803b4c6..cbaa34a 100644 --- a/cmd/servers/ateapi/controlapi/debug_clear.go +++ b/cmd/ateapi/internal/controlapi/debug_clear.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) func (s *Service) DebugClear(ctx context.Context, req *ateapipb.DebugClearRequest) (*ateapipb.DebugClearResponse, error) { diff --git a/cmd/servers/ateapi/controlapi/delete_actor.go b/cmd/ateapi/internal/controlapi/delete_actor.go similarity index 94% rename from cmd/servers/ateapi/controlapi/delete_actor.go rename to cmd/ateapi/internal/controlapi/delete_actor.go index ec4400f..1c9eea8 100644 --- a/cmd/servers/ateapi/controlapi/delete_actor.go +++ b/cmd/ateapi/internal/controlapi/delete_actor.go @@ -19,9 +19,9 @@ import ( "errors" "fmt" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" "github.com/agent-substrate/substrate/internal/resources" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/cmd/servers/ateapi/controlapi/dialer.go b/cmd/ateapi/internal/controlapi/dialer.go similarity index 100% rename from cmd/servers/ateapi/controlapi/dialer.go rename to cmd/ateapi/internal/controlapi/dialer.go diff --git a/cmd/servers/ateapi/controlapi/functional_test.go b/cmd/ateapi/internal/controlapi/functional_test.go similarity index 99% rename from cmd/servers/ateapi/controlapi/functional_test.go rename to cmd/ateapi/internal/controlapi/functional_test.go index eb7f023..5947d33 100644 --- a/cmd/servers/ateapi/controlapi/functional_test.go +++ b/cmd/ateapi/internal/controlapi/functional_test.go @@ -26,14 +26,14 @@ import ( "testing" "time" - atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store/ateredis" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store/ateredis" "github.com/agent-substrate/substrate/internal/ateinterceptors" + "github.com/agent-substrate/substrate/internal/proto/ateletpb" + atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" "github.com/agent-substrate/substrate/pkg/client/clientset/versioned" "github.com/agent-substrate/substrate/pkg/client/informers/externalversions" listersv1alpha1 "github.com/agent-substrate/substrate/pkg/client/listers/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" - "github.com/agent-substrate/substrate/proto/ateletpb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/alicebob/miniredis/v2" "github.com/google/go-cmp/cmp" "github.com/redis/go-redis/v9" diff --git a/cmd/servers/ateapi/controlapi/get_actor.go b/cmd/ateapi/internal/controlapi/get_actor.go similarity index 91% rename from cmd/servers/ateapi/controlapi/get_actor.go rename to cmd/ateapi/internal/controlapi/get_actor.go index 292cd69..7d8de7a 100644 --- a/cmd/servers/ateapi/controlapi/get_actor.go +++ b/cmd/ateapi/internal/controlapi/get_actor.go @@ -19,8 +19,8 @@ import ( "errors" "fmt" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/cmd/servers/ateapi/controlapi/informer.go b/cmd/ateapi/internal/controlapi/informer.go similarity index 100% rename from cmd/servers/ateapi/controlapi/informer.go rename to cmd/ateapi/internal/controlapi/informer.go diff --git a/cmd/servers/ateapi/controlapi/list_actors.go b/cmd/ateapi/internal/controlapi/list_actors.go similarity index 95% rename from cmd/servers/ateapi/controlapi/list_actors.go rename to cmd/ateapi/internal/controlapi/list_actors.go index 8a9f269..3cc1128 100644 --- a/cmd/servers/ateapi/controlapi/list_actors.go +++ b/cmd/ateapi/internal/controlapi/list_actors.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) func (s *Service) ListActors(ctx context.Context, req *ateapipb.ListActorsRequest) (*ateapipb.ListActorsResponse, error) { diff --git a/cmd/servers/ateapi/controlapi/list_workers.go b/cmd/ateapi/internal/controlapi/list_workers.go similarity index 95% rename from cmd/servers/ateapi/controlapi/list_workers.go rename to cmd/ateapi/internal/controlapi/list_workers.go index b427338..94406bf 100644 --- a/cmd/servers/ateapi/controlapi/list_workers.go +++ b/cmd/ateapi/internal/controlapi/list_workers.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) func (s *Service) ListWorkers(ctx context.Context, req *ateapipb.ListWorkersRequest) (*ateapipb.ListWorkersResponse, error) { diff --git a/cmd/servers/ateapi/controlapi/resume_actor.go b/cmd/ateapi/internal/controlapi/resume_actor.go similarity index 92% rename from cmd/servers/ateapi/controlapi/resume_actor.go rename to cmd/ateapi/internal/controlapi/resume_actor.go index 3410b51..9bd09b9 100644 --- a/cmd/servers/ateapi/controlapi/resume_actor.go +++ b/cmd/ateapi/internal/controlapi/resume_actor.go @@ -18,8 +18,8 @@ import ( "context" "errors" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/cmd/servers/ateapi/controlapi/service.go b/cmd/ateapi/internal/controlapi/service.go similarity index 91% rename from cmd/servers/ateapi/controlapi/service.go rename to cmd/ateapi/internal/controlapi/service.go index 439e9e5..a334588 100644 --- a/cmd/servers/ateapi/controlapi/service.go +++ b/cmd/ateapi/internal/controlapi/service.go @@ -15,10 +15,10 @@ package controlapi import ( - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" listersv1alpha1 "github.com/agent-substrate/substrate/pkg/client/listers/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) // Service implements ateapipb.Control diff --git a/cmd/servers/ateapi/controlapi/suspend_actor.go b/cmd/ateapi/internal/controlapi/suspend_actor.go similarity index 92% rename from cmd/servers/ateapi/controlapi/suspend_actor.go rename to cmd/ateapi/internal/controlapi/suspend_actor.go index 8588603..b768602 100644 --- a/cmd/servers/ateapi/controlapi/suspend_actor.go +++ b/cmd/ateapi/internal/controlapi/suspend_actor.go @@ -18,8 +18,8 @@ import ( "context" "errors" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" ) diff --git a/cmd/servers/ateapi/controlapi/syncer.go b/cmd/ateapi/internal/controlapi/syncer.go similarity index 97% rename from cmd/servers/ateapi/controlapi/syncer.go rename to cmd/ateapi/internal/controlapi/syncer.go index 1635cc0..522fddd 100644 --- a/cmd/servers/ateapi/controlapi/syncer.go +++ b/cmd/ateapi/internal/controlapi/syncer.go @@ -19,8 +19,8 @@ import ( "errors" "log/slog" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" corev1 "k8s.io/api/core/v1" "k8s.io/client-go/tools/cache" ) diff --git a/cmd/servers/ateapi/controlapi/syncer_test.go b/cmd/ateapi/internal/controlapi/syncer_test.go similarity index 96% rename from cmd/servers/ateapi/controlapi/syncer_test.go rename to cmd/ateapi/internal/controlapi/syncer_test.go index 190d82b..d514779 100644 --- a/cmd/servers/ateapi/controlapi/syncer_test.go +++ b/cmd/ateapi/internal/controlapi/syncer_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store/storetest" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store/storetest" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/wait" diff --git a/cmd/servers/ateapi/controlapi/workflow.go b/cmd/ateapi/internal/controlapi/workflow.go similarity index 98% rename from cmd/servers/ateapi/controlapi/workflow.go rename to cmd/ateapi/internal/controlapi/workflow.go index 76aba66..13243e2 100644 --- a/cmd/servers/ateapi/controlapi/workflow.go +++ b/cmd/ateapi/internal/controlapi/workflow.go @@ -20,9 +20,9 @@ import ( "fmt" "time" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" listersv1alpha1 "github.com/agent-substrate/substrate/pkg/client/listers/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/google/uuid" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/codes" diff --git a/cmd/servers/ateapi/controlapi/workflow_resume.go b/cmd/ateapi/internal/controlapi/workflow_resume.go similarity index 97% rename from cmd/servers/ateapi/controlapi/workflow_resume.go rename to cmd/ateapi/internal/controlapi/workflow_resume.go index 744422a..1401461 100644 --- a/cmd/servers/ateapi/controlapi/workflow_resume.go +++ b/cmd/ateapi/internal/controlapi/workflow_resume.go @@ -22,11 +22,11 @@ import ( "math/rand" "time" - atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/internal/proto/ateletpb" + atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" listersv1alpha1 "github.com/agent-substrate/substrate/pkg/client/listers/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" - "github.com/agent-substrate/substrate/proto/ateletpb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "k8s.io/apimachinery/pkg/util/wait" diff --git a/cmd/servers/ateapi/controlapi/workflow_suspend.go b/cmd/ateapi/internal/controlapi/workflow_suspend.go similarity index 97% rename from cmd/servers/ateapi/controlapi/workflow_suspend.go rename to cmd/ateapi/internal/controlapi/workflow_suspend.go index 458f0f5..9c55652 100644 --- a/cmd/servers/ateapi/controlapi/workflow_suspend.go +++ b/cmd/ateapi/internal/controlapi/workflow_suspend.go @@ -23,11 +23,11 @@ import ( "strings" "time" - atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/internal/proto/ateletpb" + atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" listersv1alpha1 "github.com/agent-substrate/substrate/pkg/client/listers/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" - "github.com/agent-substrate/substrate/proto/ateletpb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "k8s.io/apimachinery/pkg/util/wait" ) diff --git a/cmd/servers/ateapi/sessionidentity/sessionidentity.go b/cmd/ateapi/internal/sessionidentity/sessionidentity.go similarity index 99% rename from cmd/servers/ateapi/sessionidentity/sessionidentity.go rename to cmd/ateapi/internal/sessionidentity/sessionidentity.go index 55f3654..b82d013 100644 --- a/cmd/servers/ateapi/sessionidentity/sessionidentity.go +++ b/cmd/ateapi/internal/sessionidentity/sessionidentity.go @@ -31,7 +31,7 @@ import ( "github.com/agent-substrate/substrate/internal/localca" "github.com/agent-substrate/substrate/internal/localjwtauthority" "github.com/agent-substrate/substrate/internal/sessionidjwt" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc/codes" "google.golang.org/grpc/credentials" "google.golang.org/grpc/metadata" diff --git a/cmd/servers/ateapi/store/ateredis/ateredis.go b/cmd/ateapi/internal/store/ateredis/ateredis.go similarity index 99% rename from cmd/servers/ateapi/store/ateredis/ateredis.go rename to cmd/ateapi/internal/store/ateredis/ateredis.go index ebde322..7b4b109 100644 --- a/cmd/servers/ateapi/store/ateredis/ateredis.go +++ b/cmd/ateapi/internal/store/ateredis/ateredis.go @@ -47,8 +47,8 @@ import ( "sync" "time" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/redis/go-redis/v9" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" diff --git a/cmd/servers/ateapi/store/ateredis/ateredis_test.go b/cmd/ateapi/internal/store/ateredis/ateredis_test.go similarity index 99% rename from cmd/servers/ateapi/store/ateredis/ateredis_test.go rename to cmd/ateapi/internal/store/ateredis/ateredis_test.go index acc0fda..a5b5e86 100644 --- a/cmd/servers/ateapi/store/ateredis/ateredis_test.go +++ b/cmd/ateapi/internal/store/ateredis/ateredis_test.go @@ -26,8 +26,8 @@ import ( "google.golang.org/protobuf/proto" "google.golang.org/protobuf/testing/protocmp" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) func setupTest(t *testing.T) (*miniredis.Miniredis, *Persistence, context.Context) { diff --git a/cmd/servers/ateapi/store/store.go b/cmd/ateapi/internal/store/store.go similarity index 98% rename from cmd/servers/ateapi/store/store.go rename to cmd/ateapi/internal/store/store.go index ab76aa8..52553c0 100644 --- a/cmd/servers/ateapi/store/store.go +++ b/cmd/ateapi/internal/store/store.go @@ -20,7 +20,7 @@ import ( "errors" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) var ( diff --git a/cmd/servers/ateapi/store/storetest/storetest.go b/cmd/ateapi/internal/store/storetest/storetest.go similarity index 89% rename from cmd/servers/ateapi/store/storetest/storetest.go rename to cmd/ateapi/internal/store/storetest/storetest.go index 03cefa5..36a4145 100644 --- a/cmd/servers/ateapi/store/storetest/storetest.go +++ b/cmd/ateapi/internal/store/storetest/storetest.go @@ -17,8 +17,8 @@ package storetest import ( "testing" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store/ateredis" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store/ateredis" "github.com/alicebob/miniredis/v2" "github.com/redis/go-redis/v9" ) diff --git a/cmd/servers/ateapi/ateapi.go b/cmd/ateapi/main.go similarity index 97% rename from cmd/servers/ateapi/ateapi.go rename to cmd/ateapi/main.go index da30a66..3cb7178 100644 --- a/cmd/servers/ateapi/ateapi.go +++ b/cmd/ateapi/main.go @@ -26,15 +26,15 @@ import ( "os" "time" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/controlapi" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/sessionidentity" - "github.com/agent-substrate/substrate/cmd/servers/ateapi/store/ateredis" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/controlapi" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/sessionidentity" + "github.com/agent-substrate/substrate/cmd/ateapi/internal/store/ateredis" "github.com/agent-substrate/substrate/internal/ateinterceptors" "github.com/agent-substrate/substrate/internal/contextlogging" "github.com/agent-substrate/substrate/internal/credbundle" "github.com/agent-substrate/substrate/pkg/client/clientset/versioned" "github.com/agent-substrate/substrate/pkg/client/informers/externalversions" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/redis/go-redis/v9" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" diff --git a/cmd/servers/atecontroller/main.go b/cmd/atecontroller/main.go similarity index 96% rename from cmd/servers/atecontroller/main.go rename to cmd/atecontroller/main.go index 2407125..61a5910 100644 --- a/cmd/servers/atecontroller/main.go +++ b/cmd/atecontroller/main.go @@ -18,9 +18,9 @@ import ( "flag" "os" - clientv1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" "github.com/agent-substrate/substrate/internal/controllers" - "github.com/agent-substrate/substrate/proto/ateapipb" + clientv1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/credentials" "k8s.io/apimachinery/pkg/runtime" diff --git a/cmd/servers/atelet/atelet.go b/cmd/atelet/main.go similarity index 99% rename from cmd/servers/atelet/atelet.go rename to cmd/atelet/main.go index 98bbed1..bd6611d 100644 --- a/cmd/servers/atelet/atelet.go +++ b/cmd/atelet/main.go @@ -37,8 +37,8 @@ import ( "github.com/agent-substrate/substrate/internal/ateompath" "github.com/agent-substrate/substrate/internal/contextlogging" "github.com/agent-substrate/substrate/internal/memorypullcache" - "github.com/agent-substrate/substrate/proto/ateletpb" - "github.com/agent-substrate/substrate/proto/ateompb" + "github.com/agent-substrate/substrate/internal/proto/ateletpb" + "github.com/agent-substrate/substrate/internal/proto/ateompb" "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/google/go-containerregistry/pkg/authn" diff --git a/cmd/servers/atelet/oci.go b/cmd/atelet/oci.go similarity index 100% rename from cmd/servers/atelet/oci.go rename to cmd/atelet/oci.go diff --git a/cmd/servers/atenet/atenet-diagram.png b/cmd/atenet/atenet-diagram.png similarity index 100% rename from cmd/servers/atenet/atenet-diagram.png rename to cmd/atenet/atenet-diagram.png diff --git a/cmd/servers/atenet/app/dns/cmd.go b/cmd/atenet/internal/app/dns/cmd.go similarity index 100% rename from cmd/servers/atenet/app/dns/cmd.go rename to cmd/atenet/internal/app/dns/cmd.go diff --git a/cmd/servers/atenet/app/root.go b/cmd/atenet/internal/app/root.go similarity index 88% rename from cmd/servers/atenet/app/root.go rename to cmd/atenet/internal/app/root.go index 7cae015..71b9837 100644 --- a/cmd/servers/atenet/app/root.go +++ b/cmd/atenet/internal/app/root.go @@ -18,8 +18,8 @@ import ( "fmt" "os" - "github.com/agent-substrate/substrate/cmd/servers/atenet/app/dns" - "github.com/agent-substrate/substrate/cmd/servers/atenet/app/router" + "github.com/agent-substrate/substrate/cmd/atenet/internal/app/dns" + "github.com/agent-substrate/substrate/cmd/atenet/internal/app/router" "github.com/spf13/cobra" ) diff --git a/cmd/servers/atenet/app/router/atstore.go b/cmd/atenet/internal/app/router/atstore.go similarity index 96% rename from cmd/servers/atenet/app/router/atstore.go rename to cmd/atenet/internal/app/router/atstore.go index 7684ee7..1d073bd 100644 --- a/cmd/servers/atenet/app/router/atstore.go +++ b/cmd/atenet/internal/app/router/atstore.go @@ -18,7 +18,7 @@ import ( "context" "fmt" - v1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" + v1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/cmd/servers/atenet/app/router/atstore_file.go b/cmd/atenet/internal/app/router/atstore_file.go similarity index 98% rename from cmd/servers/atenet/app/router/atstore_file.go rename to cmd/atenet/internal/app/router/atstore_file.go index cd3190e..6c95cb4 100644 --- a/cmd/servers/atenet/app/router/atstore_file.go +++ b/cmd/atenet/internal/app/router/atstore_file.go @@ -24,7 +24,7 @@ import ( "os" "strings" - v1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" + v1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" "k8s.io/apimachinery/pkg/util/yaml" sigsyaml "sigs.k8s.io/yaml" ) diff --git a/cmd/servers/atenet/app/router/atstore_test.go b/cmd/atenet/internal/app/router/atstore_test.go similarity index 100% rename from cmd/servers/atenet/app/router/atstore_test.go rename to cmd/atenet/internal/app/router/atstore_test.go diff --git a/cmd/servers/atenet/app/router/controller.go b/cmd/atenet/internal/app/router/controller.go similarity index 100% rename from cmd/servers/atenet/app/router/controller.go rename to cmd/atenet/internal/app/router/controller.go diff --git a/cmd/servers/atenet/app/router/dashboard.html b/cmd/atenet/internal/app/router/dashboard.html similarity index 100% rename from cmd/servers/atenet/app/router/dashboard.html rename to cmd/atenet/internal/app/router/dashboard.html diff --git a/cmd/servers/atenet/app/router/envoyrunner.go b/cmd/atenet/internal/app/router/envoyrunner.go similarity index 100% rename from cmd/servers/atenet/app/router/envoyrunner.go rename to cmd/atenet/internal/app/router/envoyrunner.go diff --git a/cmd/servers/atenet/app/router/extproc.go b/cmd/atenet/internal/app/router/extproc.go similarity index 98% rename from cmd/servers/atenet/app/router/extproc.go rename to cmd/atenet/internal/app/router/extproc.go index ddfd21b..2e00f3c 100644 --- a/cmd/servers/atenet/app/router/extproc.go +++ b/cmd/atenet/internal/app/router/extproc.go @@ -27,7 +27,7 @@ import ( envoy_type "github.com/envoyproxy/go-control-plane/envoy/type/v3" "google.golang.org/grpc" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) // ExtProcServer implements the Envoy external processing gRPC server diff --git a/cmd/servers/atenet/app/router/extproc_in.go b/cmd/atenet/internal/app/router/extproc_in.go similarity index 100% rename from cmd/servers/atenet/app/router/extproc_in.go rename to cmd/atenet/internal/app/router/extproc_in.go diff --git a/cmd/servers/atenet/app/router/extproc_in_test.go b/cmd/atenet/internal/app/router/extproc_in_test.go similarity index 100% rename from cmd/servers/atenet/app/router/extproc_in_test.go rename to cmd/atenet/internal/app/router/extproc_in_test.go diff --git a/cmd/servers/atenet/app/router/extproc_out.go b/cmd/atenet/internal/app/router/extproc_out.go similarity index 100% rename from cmd/servers/atenet/app/router/extproc_out.go rename to cmd/atenet/internal/app/router/extproc_out.go diff --git a/cmd/servers/atenet/app/router/extproc_test.go b/cmd/atenet/internal/app/router/extproc_test.go similarity index 98% rename from cmd/servers/atenet/app/router/extproc_test.go rename to cmd/atenet/internal/app/router/extproc_test.go index 17327d3..07c475c 100644 --- a/cmd/servers/atenet/app/router/extproc_test.go +++ b/cmd/atenet/internal/app/router/extproc_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" corev3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3" extprocv3 "github.com/envoyproxy/go-control-plane/envoy/service/ext_proc/v3" "google.golang.org/grpc" diff --git a/cmd/servers/atenet/app/router/health.go b/cmd/atenet/internal/app/router/health.go similarity index 98% rename from cmd/servers/atenet/app/router/health.go rename to cmd/atenet/internal/app/router/health.go index 9f2358f..5d8d944 100644 --- a/cmd/servers/atenet/app/router/health.go +++ b/cmd/atenet/internal/app/router/health.go @@ -24,7 +24,7 @@ import ( "sync" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "k8s.io/client-go/kubernetes" ) diff --git a/cmd/servers/atenet/app/router/readme.md b/cmd/atenet/internal/app/router/readme.md similarity index 100% rename from cmd/servers/atenet/app/router/readme.md rename to cmd/atenet/internal/app/router/readme.md diff --git a/cmd/servers/atenet/app/router/resumer.go b/cmd/atenet/internal/app/router/resumer.go similarity index 97% rename from cmd/servers/atenet/app/router/resumer.go rename to cmd/atenet/internal/app/router/resumer.go index 0ad3586..74a75d0 100644 --- a/cmd/servers/atenet/app/router/resumer.go +++ b/cmd/atenet/internal/app/router/resumer.go @@ -18,7 +18,7 @@ import ( "context" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "golang.org/x/sync/singleflight" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/cmd/servers/atenet/app/router/resumer_test.go b/cmd/atenet/internal/app/router/resumer_test.go similarity index 98% rename from cmd/servers/atenet/app/router/resumer_test.go rename to cmd/atenet/internal/app/router/resumer_test.go index 6aab1ce..2b71f67 100644 --- a/cmd/servers/atenet/app/router/resumer_test.go +++ b/cmd/atenet/internal/app/router/resumer_test.go @@ -21,7 +21,7 @@ import ( "testing" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/cmd/servers/atenet/app/router/router.go b/cmd/atenet/internal/app/router/router.go similarity index 98% rename from cmd/servers/atenet/app/router/router.go rename to cmd/atenet/internal/app/router/router.go index 884c311..c2afdf0 100644 --- a/cmd/servers/atenet/app/router/router.go +++ b/cmd/atenet/internal/app/router/router.go @@ -46,8 +46,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/config" - v1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" + v1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) var ( diff --git a/cmd/servers/atenet/app/router/status.go b/cmd/atenet/internal/app/router/status.go similarity index 100% rename from cmd/servers/atenet/app/router/status.go rename to cmd/atenet/internal/app/router/status.go diff --git a/cmd/servers/atenet/app/router/status_test.go b/cmd/atenet/internal/app/router/status_test.go similarity index 100% rename from cmd/servers/atenet/app/router/status_test.go rename to cmd/atenet/internal/app/router/status_test.go diff --git a/cmd/servers/atenet/app/router/xds.go b/cmd/atenet/internal/app/router/xds.go similarity index 100% rename from cmd/servers/atenet/app/router/xds.go rename to cmd/atenet/internal/app/router/xds.go diff --git a/cmd/servers/atenet/app/router/xds_test.go b/cmd/atenet/internal/app/router/xds_test.go similarity index 100% rename from cmd/servers/atenet/app/router/xds_test.go rename to cmd/atenet/internal/app/router/xds_test.go diff --git a/cmd/servers/atenet/main.go b/cmd/atenet/main.go similarity index 90% rename from cmd/servers/atenet/main.go rename to cmd/atenet/main.go index 042cfa5..cdb7bb1 100644 --- a/cmd/servers/atenet/main.go +++ b/cmd/atenet/main.go @@ -14,7 +14,7 @@ package main -import "github.com/agent-substrate/substrate/cmd/servers/atenet/app" +import "github.com/agent-substrate/substrate/cmd/atenet/internal/app" func main() { app.Execute() diff --git a/cmd/servers/atenet/readme.md b/cmd/atenet/readme.md similarity index 100% rename from cmd/servers/atenet/readme.md rename to cmd/atenet/readme.md diff --git a/cmd/servers/ateom-gvisor/logger.go b/cmd/ateom-gvisor/logger.go similarity index 100% rename from cmd/servers/ateom-gvisor/logger.go rename to cmd/ateom-gvisor/logger.go diff --git a/cmd/servers/ateom-gvisor/logger_test.go b/cmd/ateom-gvisor/logger_test.go similarity index 100% rename from cmd/servers/ateom-gvisor/logger_test.go rename to cmd/ateom-gvisor/logger_test.go diff --git a/cmd/servers/ateom-gvisor/ateom-gvisor.go b/cmd/ateom-gvisor/main.go similarity index 99% rename from cmd/servers/ateom-gvisor/ateom-gvisor.go rename to cmd/ateom-gvisor/main.go index 7981c83..cbc1fe9 100644 --- a/cmd/servers/ateom-gvisor/ateom-gvisor.go +++ b/cmd/ateom-gvisor/main.go @@ -29,7 +29,7 @@ import ( "github.com/agent-substrate/substrate/internal/ateinterceptors" "github.com/agent-substrate/substrate/internal/ateompath" "github.com/agent-substrate/substrate/internal/contextlogging" - "github.com/agent-substrate/substrate/proto/ateompb" + "github.com/agent-substrate/substrate/internal/proto/ateompb" "github.com/hashicorp/go-reap" "github.com/vishvananda/netlink" "github.com/vishvananda/netns" diff --git a/cmd/servers/ateom-gvisor/runsc.go b/cmd/ateom-gvisor/runsc.go similarity index 100% rename from cmd/servers/ateom-gvisor/runsc.go rename to cmd/ateom-gvisor/runsc.go diff --git a/cmd/servers/ateom-gvisor/stopwatch.go b/cmd/ateom-gvisor/stopwatch.go similarity index 100% rename from cmd/servers/ateom-gvisor/stopwatch.go rename to cmd/ateom-gvisor/stopwatch.go diff --git a/cmd/kubectl-ate/cmd/admin.go b/cmd/kubectl-ate/internal/cmd/admin.go similarity index 100% rename from cmd/kubectl-ate/cmd/admin.go rename to cmd/kubectl-ate/internal/cmd/admin.go diff --git a/cmd/kubectl-ate/cmd/admin_debug_redis_flush.go b/cmd/kubectl-ate/internal/cmd/admin_debug_redis_flush.go similarity index 85% rename from cmd/kubectl-ate/cmd/admin_debug_redis_flush.go rename to cmd/kubectl-ate/internal/cmd/admin_debug_redis_flush.go index 7d82f1d..fb96cf8 100644 --- a/cmd/kubectl-ate/cmd/admin_debug_redis_flush.go +++ b/cmd/kubectl-ate/internal/cmd/admin_debug_redis_flush.go @@ -17,8 +17,8 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -27,7 +27,7 @@ var debugRedisFlushCmd = &cobra.Command{ Short: "DANGEROUS: Flush all data from Redis", RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/cmd/admin_make_ca_pool.go b/cmd/kubectl-ate/internal/cmd/admin_make_ca_pool.go similarity index 95% rename from cmd/kubectl-ate/cmd/admin_make_ca_pool.go rename to cmd/kubectl-ate/internal/cmd/admin_make_ca_pool.go index 448b734..65b88e1 100644 --- a/cmd/kubectl-ate/cmd/admin_make_ca_pool.go +++ b/cmd/kubectl-ate/internal/cmd/admin_make_ca_pool.go @@ -17,7 +17,7 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" + "github.com/agent-substrate/substrate/internal/ateclient" "github.com/agent-substrate/substrate/internal/localca" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" @@ -35,7 +35,7 @@ var makeCaPoolCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - kconfig, err := client.LoadConfig(kubeconfig, k8sContext) + kconfig, err := ateclient.LoadConfig(kubeconfig, k8sContext) if err != nil { return fmt.Errorf("while reading kubeconfig: %w", err) } diff --git a/cmd/kubectl-ate/cmd/admin_make_jwt_pool.go b/cmd/kubectl-ate/internal/cmd/admin_make_jwt_pool.go similarity index 95% rename from cmd/kubectl-ate/cmd/admin_make_jwt_pool.go rename to cmd/kubectl-ate/internal/cmd/admin_make_jwt_pool.go index 539ee72..e006b64 100644 --- a/cmd/kubectl-ate/cmd/admin_make_jwt_pool.go +++ b/cmd/kubectl-ate/internal/cmd/admin_make_jwt_pool.go @@ -17,7 +17,7 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" + "github.com/agent-substrate/substrate/internal/ateclient" "github.com/agent-substrate/substrate/internal/localjwtauthority" "github.com/spf13/cobra" corev1 "k8s.io/api/core/v1" @@ -33,7 +33,7 @@ var makeJwtPoolCmd = &cobra.Command{ RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - kconfig, err := client.LoadConfig(kubeconfig, k8sContext) + kconfig, err := ateclient.LoadConfig(kubeconfig, k8sContext) if err != nil { return fmt.Errorf("while reading kubeconfig: %w", err) } diff --git a/cmd/kubectl-ate/cmd/create.go b/cmd/kubectl-ate/internal/cmd/create.go similarity index 100% rename from cmd/kubectl-ate/cmd/create.go rename to cmd/kubectl-ate/internal/cmd/create.go diff --git a/cmd/kubectl-ate/cmd/create_actor.go b/cmd/kubectl-ate/internal/cmd/create_actor.go similarity index 86% rename from cmd/kubectl-ate/cmd/create_actor.go rename to cmd/kubectl-ate/internal/cmd/create_actor.go index adbb3d1..375e21b 100644 --- a/cmd/kubectl-ate/cmd/create_actor.go +++ b/cmd/kubectl-ate/internal/cmd/create_actor.go @@ -18,9 +18,9 @@ import ( "fmt" "strings" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/printer" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/printer" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -32,7 +32,7 @@ var createActorCmd = &cobra.Command{ Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/cmd/delete.go b/cmd/kubectl-ate/internal/cmd/delete.go similarity index 100% rename from cmd/kubectl-ate/cmd/delete.go rename to cmd/kubectl-ate/internal/cmd/delete.go diff --git a/cmd/kubectl-ate/cmd/delete_actor.go b/cmd/kubectl-ate/internal/cmd/delete_actor.go similarity index 85% rename from cmd/kubectl-ate/cmd/delete_actor.go rename to cmd/kubectl-ate/internal/cmd/delete_actor.go index c26eba0..8fc059a 100644 --- a/cmd/kubectl-ate/cmd/delete_actor.go +++ b/cmd/kubectl-ate/internal/cmd/delete_actor.go @@ -17,8 +17,8 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -28,7 +28,7 @@ var deleteActorCmd = &cobra.Command{ Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - c, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + c, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return err } diff --git a/cmd/kubectl-ate/cmd/get.go b/cmd/kubectl-ate/internal/cmd/get.go similarity index 100% rename from cmd/kubectl-ate/cmd/get.go rename to cmd/kubectl-ate/internal/cmd/get.go diff --git a/cmd/kubectl-ate/cmd/get_actors.go b/cmd/kubectl-ate/internal/cmd/get_actors.go similarity index 84% rename from cmd/kubectl-ate/cmd/get_actors.go rename to cmd/kubectl-ate/internal/cmd/get_actors.go index 623f55d..0888206 100644 --- a/cmd/kubectl-ate/cmd/get_actors.go +++ b/cmd/kubectl-ate/internal/cmd/get_actors.go @@ -17,9 +17,9 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/printer" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/printer" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -31,7 +31,7 @@ var getActorsCmd = &cobra.Command{ ctx := cmd.Context() // 1. Connect to API Server - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/cmd/get_workers.go b/cmd/kubectl-ate/internal/cmd/get_workers.go similarity index 81% rename from cmd/kubectl-ate/cmd/get_workers.go rename to cmd/kubectl-ate/internal/cmd/get_workers.go index 9065cf4..9c9b8aa 100644 --- a/cmd/kubectl-ate/cmd/get_workers.go +++ b/cmd/kubectl-ate/internal/cmd/get_workers.go @@ -17,9 +17,9 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/printer" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/printer" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -29,7 +29,7 @@ var getWorkersCmd = &cobra.Command{ Short: "List all workers", RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/cmd/logs.go b/cmd/kubectl-ate/internal/cmd/logs.go similarity index 100% rename from cmd/kubectl-ate/cmd/logs.go rename to cmd/kubectl-ate/internal/cmd/logs.go diff --git a/cmd/kubectl-ate/cmd/logs_actors.go b/cmd/kubectl-ate/internal/cmd/logs_actors.go similarity index 97% rename from cmd/kubectl-ate/cmd/logs_actors.go rename to cmd/kubectl-ate/internal/cmd/logs_actors.go index 2ad045b..d0f4aad 100644 --- a/cmd/kubectl-ate/cmd/logs_actors.go +++ b/cmd/kubectl-ate/internal/cmd/logs_actors.go @@ -27,8 +27,8 @@ import ( "sync" "time" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -281,12 +281,12 @@ func runLogsActor(cmd *cobra.Command, args []string) error { ctx := cmd.Context() actorID := args[0] - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } - k8sClient, err := client.NewK8sClientset(kubeconfig, k8sContext) + k8sClient, err := ateclient.NewK8sClientset(kubeconfig, k8sContext) if err != nil { apiClient.Close() return fmt.Errorf("failed to create kubernetes client: %w", err) diff --git a/cmd/kubectl-ate/cmd/logs_actors_test.go b/cmd/kubectl-ate/internal/cmd/logs_actors_test.go similarity index 99% rename from cmd/kubectl-ate/cmd/logs_actors_test.go rename to cmd/kubectl-ate/internal/cmd/logs_actors_test.go index 292742c..00bcba0 100644 --- a/cmd/kubectl-ate/cmd/logs_actors_test.go +++ b/cmd/kubectl-ate/internal/cmd/logs_actors_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" diff --git a/cmd/kubectl-ate/cmd/resume.go b/cmd/kubectl-ate/internal/cmd/resume.go similarity index 100% rename from cmd/kubectl-ate/cmd/resume.go rename to cmd/kubectl-ate/internal/cmd/resume.go diff --git a/cmd/kubectl-ate/cmd/resume_actor.go b/cmd/kubectl-ate/internal/cmd/resume_actor.go similarity index 83% rename from cmd/kubectl-ate/cmd/resume_actor.go rename to cmd/kubectl-ate/internal/cmd/resume_actor.go index aa38516..58b8935 100644 --- a/cmd/kubectl-ate/cmd/resume_actor.go +++ b/cmd/kubectl-ate/internal/cmd/resume_actor.go @@ -17,9 +17,9 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/printer" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/printer" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -31,7 +31,7 @@ var resumeActorCmd = &cobra.Command{ Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/cmd/root.go b/cmd/kubectl-ate/internal/cmd/root.go similarity index 100% rename from cmd/kubectl-ate/cmd/root.go rename to cmd/kubectl-ate/internal/cmd/root.go diff --git a/cmd/kubectl-ate/cmd/suspend.go b/cmd/kubectl-ate/internal/cmd/suspend.go similarity index 100% rename from cmd/kubectl-ate/cmd/suspend.go rename to cmd/kubectl-ate/internal/cmd/suspend.go diff --git a/cmd/kubectl-ate/cmd/suspend_actor.go b/cmd/kubectl-ate/internal/cmd/suspend_actor.go similarity index 81% rename from cmd/kubectl-ate/cmd/suspend_actor.go rename to cmd/kubectl-ate/internal/cmd/suspend_actor.go index ae7aa99..f117502 100644 --- a/cmd/kubectl-ate/cmd/suspend_actor.go +++ b/cmd/kubectl-ate/internal/cmd/suspend_actor.go @@ -17,9 +17,9 @@ package cmd import ( "fmt" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/printer" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/printer" + "github.com/agent-substrate/substrate/internal/ateclient" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/spf13/cobra" ) @@ -29,7 +29,7 @@ var suspendActorCmd = &cobra.Command{ Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { ctx := cmd.Context() - apiClient, err := client.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) + apiClient, err := ateclient.NewClient(ctx, kubeconfig, k8sContext, endpoint, traceEnabled) if err != nil { return fmt.Errorf("failed to connect to ate-api-server: %w", err) } diff --git a/cmd/kubectl-ate/pkg/printer/printer.go b/cmd/kubectl-ate/internal/printer/printer.go similarity index 98% rename from cmd/kubectl-ate/pkg/printer/printer.go rename to cmd/kubectl-ate/internal/printer/printer.go index ceeb875..1974eec 100644 --- a/cmd/kubectl-ate/pkg/printer/printer.go +++ b/cmd/kubectl-ate/internal/printer/printer.go @@ -23,7 +23,7 @@ import ( "slices" "text/tabwriter" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/protobuf/encoding/protojson" "google.golang.org/protobuf/proto" "sigs.k8s.io/yaml" diff --git a/cmd/kubectl-ate/pkg/printer/printer_test.go b/cmd/kubectl-ate/internal/printer/printer_test.go similarity index 99% rename from cmd/kubectl-ate/pkg/printer/printer_test.go rename to cmd/kubectl-ate/internal/printer/printer_test.go index 32a05b5..73305fa 100644 --- a/cmd/kubectl-ate/pkg/printer/printer_test.go +++ b/cmd/kubectl-ate/internal/printer/printer_test.go @@ -18,7 +18,7 @@ import ( "bytes" "testing" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/google/go-cmp/cmp" ) diff --git a/cmd/kubectl-ate/main.go b/cmd/kubectl-ate/main.go index 1c55eb9..0718d7e 100644 --- a/cmd/kubectl-ate/main.go +++ b/cmd/kubectl-ate/main.go @@ -15,7 +15,7 @@ package main import ( - "github.com/agent-substrate/substrate/cmd/kubectl-ate/cmd" + "github.com/agent-substrate/substrate/cmd/kubectl-ate/internal/cmd" ) func main() { diff --git a/cmd/servers/podcertcontroller/podcertcontroller.go b/cmd/podcertcontroller/main.go similarity index 100% rename from cmd/servers/podcertcontroller/podcertcontroller.go rename to cmd/podcertcontroller/main.go diff --git a/demos/agent-secret/agent-secret.yaml.tmpl b/demos/agent-secret/agent-secret.yaml.tmpl index d6a8021..cb915f0 100644 --- a/demos/agent-secret/agent-secret.yaml.tmpl +++ b/demos/agent-secret/agent-secret.yaml.tmpl @@ -24,7 +24,7 @@ metadata: namespace: ate-demo-secret-agent-v2 spec: replicas: 8 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- apiVersion: ate.dev/v1alpha1 kind: ActorTemplate diff --git a/demos/agent-secret/main.go b/demos/agent-secret/main.go index 44670b4..c961ae0 100644 --- a/demos/agent-secret/main.go +++ b/demos/agent-secret/main.go @@ -25,7 +25,7 @@ import ( "strings" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) diff --git a/demos/claude-code-multiplex/claude-code-multiplex.yaml.tmpl b/demos/claude-code-multiplex/claude-code-multiplex.yaml.tmpl index a9aa3ea..01669cc 100644 --- a/demos/claude-code-multiplex/claude-code-multiplex.yaml.tmpl +++ b/demos/claude-code-multiplex/claude-code-multiplex.yaml.tmpl @@ -38,7 +38,7 @@ metadata: namespace: claude-multiplex-demo spec: replicas: 2 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- diff --git a/demos/claude-code-multiplex/ui/server.go b/demos/claude-code-multiplex/ui/server.go index 7624f9c..1bc68c0 100644 --- a/demos/claude-code-multiplex/ui/server.go +++ b/demos/claude-code-multiplex/ui/server.go @@ -49,7 +49,7 @@ import ( "sync" "time" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/credentials" corev1 "k8s.io/api/core/v1" diff --git a/demos/counter/counter.yaml.tmpl b/demos/counter/counter.yaml.tmpl index 1d9f747..b131650 100644 --- a/demos/counter/counter.yaml.tmpl +++ b/demos/counter/counter.yaml.tmpl @@ -26,7 +26,7 @@ metadata: namespace: ate-demo-counter spec: replicas: 5 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- diff --git a/demos/sandbox/client/main.go b/demos/sandbox/client/main.go index ba69d0f..9bb81e6 100644 --- a/demos/sandbox/client/main.go +++ b/demos/sandbox/client/main.go @@ -29,7 +29,7 @@ import ( "strings" "syscall" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "google.golang.org/grpc" "google.golang.org/grpc/credentials" ) diff --git a/demos/sandbox/sandbox.yaml.tmpl b/demos/sandbox/sandbox.yaml.tmpl index 7d85aeb..acb380e 100644 --- a/demos/sandbox/sandbox.yaml.tmpl +++ b/demos/sandbox/sandbox.yaml.tmpl @@ -24,7 +24,7 @@ metadata: namespace: ate-demo-sandbox spec: replicas: 2 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor --- apiVersion: ate.dev/v1alpha1 kind: ActorTemplate diff --git a/docs/api-guide.md b/docs/api-guide.md index 0db20c1..7ab9f18 100644 --- a/docs/api-guide.md +++ b/docs/api-guide.md @@ -11,7 +11,7 @@ The `WorkerPool` defines the pool of physical "warm" compute capacity. It manage | Field | Type | Description | | :--- | :--- | :--- | | `replicas` | `int32` | **Required.** Number of physical standby pods to maintain in the cluster. | -| `ateomImage` | `string` | **Required.** The container image for the `ateom` herder process (e.g. `ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor`). | +| `ateomImage` | `string` | **Required.** The container image for the `ateom` herder process (e.g. `ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor`). | ### Example @@ -23,7 +23,7 @@ metadata: namespace: ate-demo spec: replicas: 10 - ateomImage: ko://github.com/agent-substrate/substrate/cmd/servers/ateom-gvisor + ateomImage: ko://github.com/agent-substrate/substrate/cmd/ateom-gvisor ``` --- diff --git a/docs/dev/best-practices/tracing.md b/docs/dev/best-practices/tracing.md index c9c031d..ae4945f 100644 --- a/docs/dev/best-practices/tracing.md +++ b/docs/dev/best-practices/tracing.md @@ -85,7 +85,7 @@ The YAML manifest for your server should include the `OTEL_EXPORTER_OTLP_ENDPOIN ```yaml containers: - name: ateapi - image: ko://github.com/agent-substrate/substrate/cmd/servers/ateapi + image: ko://github.com/agent-substrate/substrate/cmd/ateapi ports: - "443:443" env: diff --git a/hack/create-kind-cluster.sh b/hack/create-kind-cluster.sh index 0d451ee..dbe458d 100755 --- a/hack/create-kind-cluster.sh +++ b/hack/create-kind-cluster.sh @@ -48,7 +48,7 @@ kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 nodes: - role: control-plane -# cmd/servers/podcertcontroller depends on ClusterTrustBundle & PodCertificateRequest. +# cmd/podcertcontroller depends on ClusterTrustBundle & PodCertificateRequest. # They are not enabled by default as of Kubernetes v1.36 # https://github.com/kubernetes/kubernetes/blob/master/test/compatibility_lifecycle/reference/versioned_feature_list.yaml featureGates: diff --git a/cmd/kubectl-ate/pkg/client/builder.go b/internal/ateclient/builder.go similarity index 99% rename from cmd/kubectl-ate/pkg/client/builder.go rename to internal/ateclient/builder.go index d058bcb..f6de15f 100644 --- a/cmd/kubectl-ate/pkg/client/builder.go +++ b/internal/ateclient/builder.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package client +package ateclient import ( "context" @@ -23,7 +23,7 @@ import ( "os" "sync" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/propagation" diff --git a/internal/controllers/actortemplate_controller.go b/internal/controllers/actortemplate_controller.go index a288e20..3df86bc 100644 --- a/internal/controllers/actortemplate_controller.go +++ b/internal/controllers/actortemplate_controller.go @@ -19,8 +19,8 @@ import ( "fmt" "time" - atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" - "github.com/agent-substrate/substrate/proto/ateapipb" + atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" "github.com/google/uuid" k8errors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" diff --git a/internal/controllers/workerpool_controller.go b/internal/controllers/workerpool_controller.go index 2aed458..dc9c0aa 100644 --- a/internal/controllers/workerpool_controller.go +++ b/internal/controllers/workerpool_controller.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" - atev1alpha1 "github.com/agent-substrate/substrate/api/v1alpha1" + atev1alpha1 "github.com/agent-substrate/substrate/pkg/api/v1alpha1" "github.com/google/go-cmp/cmp" ) diff --git a/internal/e2e/clients.go b/internal/e2e/clients.go index a71586d..5eaea60 100644 --- a/internal/e2e/clients.go +++ b/internal/e2e/clients.go @@ -19,7 +19,7 @@ import ( "fmt" "time" - "github.com/agent-substrate/substrate/cmd/kubectl-ate/pkg/client" + "github.com/agent-substrate/substrate/internal/ateclient" "github.com/agent-substrate/substrate/pkg/client/clientset/versioned" apiextensionsclientset "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset" "k8s.io/client-go/kubernetes" @@ -29,7 +29,7 @@ type Clients struct { K8s *kubernetes.Clientset CRD *apiextensionsclientset.Clientset SubstrateK8s *versioned.Clientset - SubstrateAPI *client.Client + SubstrateAPI *ateclient.Client } var sharedClients *Clients @@ -45,7 +45,7 @@ func GetClients() *Clients { func NewClients(ctx context.Context) (*Clients, error) { // Kube API - config, err := client.LoadConfig(KubeConfig, KubeContext) + config, err := ateclient.LoadConfig(KubeConfig, KubeContext) if err != nil { return nil, fmt.Errorf("LoadConfig error %q %s: %w", KubeConfig, KubeContext, err) } @@ -69,7 +69,7 @@ func NewClients(ctx context.Context) (*Clients, error) { connectCtx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() - apiClient, err := client.NewClient(connectCtx, KubeConfig, KubeContext, "", false) + apiClient, err := ateclient.NewClient(connectCtx, KubeConfig, KubeContext, "", false) if err != nil { return nil, fmt.Errorf("NewClient: %w", err) } diff --git a/internal/e2e/preflight.go b/internal/e2e/preflight.go index 9d15dcd..5359379 100644 --- a/internal/e2e/preflight.go +++ b/internal/e2e/preflight.go @@ -21,7 +21,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" ) // PreflightChecks checks that the test environment is ready for the test suite. diff --git a/internal/e2e/suites/demo/demo_test.go b/internal/e2e/suites/demo/demo_test.go index eec216b..a14634a 100644 --- a/internal/e2e/suites/demo/demo_test.go +++ b/internal/e2e/suites/demo/demo_test.go @@ -19,9 +19,9 @@ import ( "testing" "time" - "github.com/agent-substrate/substrate/api/v1alpha1" "github.com/agent-substrate/substrate/internal/e2e" - "github.com/agent-substrate/substrate/proto/ateapipb" + "github.com/agent-substrate/substrate/pkg/api/v1alpha1" + "github.com/agent-substrate/substrate/pkg/proto/ateapipb" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/proto/ateletpb/atelet.pb.go b/internal/proto/ateletpb/atelet.pb.go similarity index 99% rename from proto/ateletpb/atelet.pb.go rename to internal/proto/ateletpb/atelet.pb.go index 597a339..404aa0d 100644 --- a/proto/ateletpb/atelet.pb.go +++ b/internal/proto/ateletpb/atelet.pb.go @@ -888,7 +888,7 @@ const file_atelet_proto_rawDesc = "" + "\x03Run\x12\x12.atelet.RunRequest\x1a\x13.atelet.RunResponse\"\x00\x12E\n" + "\n" + "Checkpoint\x12\x19.atelet.CheckpointRequest\x1a\x1a.atelet.CheckpointResponse\"\x00\x12<\n" + - "\aRestore\x12\x16.atelet.RestoreRequest\x1a\x17.atelet.RestoreResponse\"\x00B5Z3github.com/agent-substrate/substrate/proto/ateletpbb\x06proto3" + "\aRestore\x12\x16.atelet.RestoreRequest\x1a\x17.atelet.RestoreResponse\"\x00B>Z