Skip to content

Add Go-based static file server as nginx alternative - #25

Open
redhat-chai-bot wants to merge 1 commit into
cloud-bulldozer:mainfrom
redhat-chai-bot:add-go-static-server
Open

redhat-chai-bot wants to merge 1 commit into
cloud-bulldozer:mainfrom
redhat-chai-bot:add-go-static-server

Conversation

@redhat-chai-bot

Copy link
Copy Markdown
Contributor

Summary

Adds a new go-static-server/ image alongside the existing nginx/ image. This is a pure-Go drop-in replacement for the nginx static file server used in PerfScale benchmarking workloads.

What it does

  • Serves 15 pre-generated static HTML files (128B through 2MB) on HTTP :8080 and HTTPS :8443
  • Accepts GET and POST on all paths (POST returns the same static file, matching nginx's error_page 405 =200 behavior)
  • Defaults / to 128.html
  • 600s idle timeout
  • Dual-stack IPv4/IPv6 support
  • TLS cert/key paths configurable via TLS_CERT / TLS_KEY env vars

Image design

  • 3-stage Dockerfile: Go build → cert generation → scratch
  • embed.FS: Static files compiled into the binary — no filesystem dependency at runtime
  • Self-signed TLS certs generated at build time via a Go program (ssl/gencert.go) — no private key material committed to the repo
  • Scratch-based final image: ~9 MB total (vs ubi9-minimal + nginx)

Files added

  • go-static-server/main.go — Go server (~93 lines)
  • go-static-server/go.mod
  • go-static-server/generate_html.sh — generates the 15 static HTML files
  • go-static-server/ssl/gencert.go — self-signed cert generator
  • go-static-server/Dockerfile — multi-stage scratch build
  • go-static-server/README.md — build/run/comparison documentation

Testing

Built and verified in a workspace environment:

  • HTTP GET on /, /1024.html, /65536.html → 200 with correct sizes
  • HTTPS GET on / → 200 with TLS 1.3
  • POST on /128.html → 200 (not 405)
  • All 15 file sizes verified exact

AI-generated. Review for accuracy.

@afcollins requested in Slack thread

Warning

Content scanning did not attest this change.
The scanner could not produce a verdict for the pushed content (never_attempted), so it has not been checked for credentials or malware.
Content scanning currently fails open, so this did not hold the change request for review — please review the diff with that in mind.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant