From 4f1d306fdf85d2eac3b90649d39b294fc0db881f Mon Sep 17 00:00:00 2001 From: Daniel Samson <12231216+daniel-samson@users.noreply.github.com> Date: Sun, 12 Apr 2026 13:44:44 +0100 Subject: [PATCH] Fix ImagePullBackOff: use multi-arch base image tag The tag `ubuntu-arm64` doesn't exist on Docker Hub. Switch to `latest` which includes arm64 in its multi-arch manifest. Co-Authored-By: Claude Opus 4.6 --- coder/cloudflare-worker/main.tf | 71 ++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/coder/cloudflare-worker/main.tf b/coder/cloudflare-worker/main.tf index 3241103..ab46765 100644 --- a/coder/cloudflare-worker/main.tf +++ b/coder/cloudflare-worker/main.tf @@ -442,6 +442,25 @@ resource "coder_agent" "main" { web_terminal = true } + metadata { + display_name = "Task Status" + key = "task_status" + script = <<-EOS + if [ -f ~/task-output.log ]; then + if grep -q "Task completed" ~/task-output.log 2>/dev/null; then + echo "✅ Complete" + else + echo "⏳ Running ($(wc -l < ~/task-output.log) lines)" + fi + elif [ -n "$TASK_TYPE" ]; then + echo "⏳ Starting..." + else + echo "Interactive" + fi + EOS + interval = 10 + } + env = { ANTHROPIC_API_KEY = data.coder_parameter.anthropic_api_key.value GITHUB_TOKEN = data.coder_external_auth.github.access_token @@ -516,6 +535,41 @@ resource "coder_agent" "main" { npm run db:migrate:local fi + # --- Start log viewer on port 13338 --- + if [ -n "$TASK_TYPE" ]; then + touch ~/task-output.log + cat > ~/log-server.sh << 'LOGEOF' +#!/bin/bash +while true; do + { + echo "HTTP/1.1 200 OK" + echo "Content-Type: text/html; charset=utf-8" + echo "Connection: close" + echo "" + echo "Task Log" + echo "" + echo "" + echo "

$TASK_TYPE #$ISSUE_NUMBER — $(hostname)

" + if [ -f ~/task-output.log ]; then + LINES=$(wc -l < ~/task-output.log) + if grep -q "Task completed" ~/task-output.log 2>/dev/null; then + echo "Status: ✅ Complete ($LINES lines)" + else + echo "Status: ⏳ Running ($LINES lines) — auto-refreshing every 5s" + fi + sed 's/&/\&/g; s//\>/g' ~/task-output.log + else + echo "Waiting for task to start..." + fi + echo "" + } | nc -l -p 13338 -q 1 2>/dev/null || true +done +LOGEOF + chmod +x ~/log-server.sh + nohup bash ~/log-server.sh &>/dev/null & + fi + # --- Automated task execution --- if [ -n "$TASK_TYPE" ] && [ -d ~/project ]; then cd ~/project @@ -540,6 +594,21 @@ resource "coder_agent" "main" { EOT } +resource "coder_app" "task_log" { + agent_id = coder_agent.main.id + slug = "task-log" + display_name = "Task Log" + icon = "/icon/document.svg" + url = "http://localhost:13338" + share = "owner" + + healthcheck { + url = "http://localhost:13338" + interval = 10 + threshold = 3 + } +} + # ============================================================================= # Main Workspace Deployment # ============================================================================= @@ -620,7 +689,7 @@ resource "kubernetes_deployment_v1" "workspace" { container { name = "coder-agent" - image = "codercom/enterprise-base:ubuntu-arm64" + image = "codercom/enterprise-base:latest" command = ["sh", "-c", coder_agent.main.init_script]