Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/local_installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ A local cluster can also pull images that you build yourself, from a registry on
```bash
docker run -d -p 127.0.0.1:5001:5000 --name kind-registry registry:2
make images AX_IMAGE_REPO=localhost:5001 CONTAINER_CLI=docker # prints the AX_SERVER_IMAGE export to run
export AX_TASK_IMAGE="localhost:5001/ax-task-runner@$(cat bin/ax-task-runner.digest)" # for spec.profile.image in Step 4
export AX_TASK_IMAGE="localhost:5001/ax-runner@$(cat bin/ax-runner.digest)" # for spec.profile.image in Step 4
ax local start --server-image "$AX_SERVER_IMAGE"
```

Expand Down
8 changes: 5 additions & 3 deletions hack/test-local-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ REGISTRY_IMAGE="${REGISTRY_IMAGE:-registry:3@sha256:82f6ff4a7f982960c8aa51617fea
export CONTAINER_CLI="${CONTAINER_CLI:-docker}"
export KUBECONFIG="${TMP_DIR}/kubeconfig-${CLUSTER}"
export AX_HOME="${TMP_DIR}/ax-home-${CLUSTER}"
unset AX_SERVER AX_SERVER_IMAGE AX_TASK_RUNNER_IMAGE AX_RUNNER_VOLUME_IMAGE AX_RUNNER_VOLUME_BUILD_IMAGE
unset AX_SERVER AX_SERVER_IMAGE AX_RUNNER_IMAGE AX_RUNNER_VOLUME_IMAGE AX_RUNNER_VOLUME_BUILD_IMAGE

AX="${TMP_DIR}/bin/ax"
TASK="local-smoke"
Expand All @@ -57,7 +57,9 @@ log() {

cleanup() {
local status=$?
if ((status != 0)); then
# Without a current context there is no cluster to describe: the failure
# was before `ax local start` created one.
if ((status != 0)) && kubectl config current-context > /dev/null 2>&1; then
log "Failed. State of the cluster:"
kubectl get pods -A -o wide >&2 || true
kubectl -n ax-system logs deployment/ax-server --tail=100 >&2 || true
Expand Down Expand Up @@ -108,7 +110,7 @@ log "Building ax and the AX images into localhost:${REGISTRY_PORT}..."
{ tail -n 40 "${TMP_DIR}/local-install-images.log" >&2; exit 1; }
)
server_image="localhost:${REGISTRY_PORT}/ax-server@$(cat "${REPO_ROOT}/bin/ax-server.digest")"
task_image="localhost:${REGISTRY_PORT}/ax-task-runner@$(cat "${REPO_ROOT}/bin/ax-task-runner.digest")"
task_image="localhost:${REGISTRY_PORT}/ax-runner@$(cat "${REPO_ROOT}/bin/ax-runner.digest")"

log "Running ax local start with ${server_image}..."
"${AX}" local start --name "${CLUSTER}" --server-image "${server_image}"
Expand Down
4 changes: 2 additions & 2 deletions internal/install/cluster/kind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ func TestKindProviderUpWarnsWithoutEgress(t *testing.T) {
func TestLoopbackRegistries(t *testing.T) {
got := loopbackRegistries([]string{
"localhost:5001/ax-server@sha256:1111111111111111111111111111111111111111111111111111111111111111",
"localhost:5001/ax-task-runner:latest",
"localhost:5001/ax-runner:latest",
"127.0.0.1:5002/ax-runner-volume",
"[::1]:5003/ax-server",
"localhost/ax-server",
Expand Down Expand Up @@ -398,7 +398,7 @@ func TestKindProviderUpServesLoopbackRegistry(t *testing.T) {
if _, err := p.Up(context.Background(), UpOptions{
Images: []string{
"localhost:5001/ax-server@sha256:1111111111111111111111111111111111111111111111111111111111111111",
"ghcr.io/google/ax/ax-task-runner:v1.0.0",
"ghcr.io/google/ax/ax-runner:v1.0.0",
},
LocalRegistry: "my-registry:5050",
}); err != nil {
Expand Down
Loading