Testing#
Unit tests#
Run all unit tests:
Run with race detection:
Run all checks (format, lint, test):
Docker provider#
The docker provider spawns SSH-enabled containers for end-to-end bootstrap testing without cloud infrastructure.
package main
import (
"context"
"log"
"github.com/NavarchProject/navarch/pkg/provider"
"github.com/NavarchProject/navarch/pkg/provider/docker"
)
func main() {
ctx := context.Background()
p, err := docker.New(docker.Config{
SSHPublicKeyPath: "~/.ssh/id_rsa.pub",
})
if err != nil {
log.Fatal(err)
}
defer p.TerminateAll()
if err := p.EnsureImage(ctx); err != nil {
log.Fatal(err)
}
node, err := p.Provision(ctx, provider.ProvisionRequest{
Labels: map[string]string{"pool": "test"},
})
if err != nil {
log.Fatal(err)
}
// node.IPAddress is "127.0.0.1"
// node.SSHPort is the dynamically assigned host port
log.Printf("Provisioned %s on port %d", node.ID, node.SSHPort)
}
The provider:
- Uses the
linuxserver/openssh-serverimage - Maps container port 22 to a random host port
- Sets
SSHPorton the returned node for bootstrap
Simulator#
The simulator runs a virtual GPU fleet for scenario testing without cloud resources.
Interactive mode starts a control plane you can query with the CLI:
See Scenarios for the scenario file format and Stress Testing for chaos testing.
Hardware testing#
To test on real GPU machines, see Testing on Hardware.