Skip to content

Conversation

@cpuguy83
Copy link
Collaborator

@cpuguy83 cpuguy83 commented Jan 6, 2026

Dagger was convenient at the time for getting the site running without needing a bunch of things installed on the machine, but is overkill for the usage and even problematic because:

  1. Introduces a whole different go module (b/c dagger dependencies)
  2. Doesn't work in some cases (namely I have issues with dagger+nftables)
  3. Is still an extra thing in the tooling that needs to be installed even if its handled automatically.

Now that we have better stuff for interacting with buildkit, and understand more of how to do that, we can actually serve the whole website directly out of a buildkit build without any extra tooling than what is required to work on the rest of the project.

This uses buildkit to build the static site content and then serves it directly out of the buildkit cache.

Copilot AI review requested due to automatic review settings January 6, 2026 20:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the Dagger dependency from the website tooling and replaces it with direct BuildKit integration. The change eliminates dependency conflicts, improves compatibility (avoiding issues with nftables), and reduces the overall tooling requirements by using the project's existing BuildKit infrastructure.

Key Changes:

  • Replaced Dagger-based website build and serve with custom BuildKit integration
  • Enhanced bkfs package to support ReadDir operations on directory file handles
  • Reorganized architecture documentation from MDX import to standalone Markdown file

Reviewed changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
website/main.go Complete rewrite using BuildKit client, LLB state generation, and built-in HTTP server to replace Dagger orchestration
website/go.mod Removed Dagger dependency and all its transitive dependencies
website/go.sum Removed all Dagger-related dependency checksums
website/Dockerfile New file defining Node.js base image for BuildKit frontend
website/docusaurus.config.ts Made baseUrl configurable via environment variable for flexible deployments
website/docs/architecture.mdx Removed MDX file that imported root ARCHITECTURE.md
website/docs/architecture.md Added standalone architecture documentation for website
ARCHITECTURE.md Replaced with file path reference to website location
frontend/pkg/bkfs/bkfs.go Added ReadDir method to stateRefFile to implement fs.ReadDirFile interface

website/main.go Outdated
Comment on lines 266 to 267
srv.Shutdown(context.WithoutCancel(ctx))

Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTTP server shutdown is called with context.WithoutCancel(ctx), but this creates a background context that never gets canceled. Since the server is being shut down because ctx.Done() was signaled (line 265), using WithoutCancel means the shutdown will wait indefinitely for all connections to close. Consider using a timeout context (e.g., context.WithTimeout) to ensure the server shuts down within a reasonable timeframe.

Suggested change
srv.Shutdown(context.WithoutCancel(ctx))
shutdownCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
_ = srv.Shutdown(shutdownCtx)

Copilot uses AI. Check for mistakes.
website/main.go Outdated
srv := &http.Server{
Handler: handler,
}
go srv.Serve(l)
Copy link

Copilot AI Jan 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HTTP server is started in a goroutine with go srv.Serve(l), but the error returned by Serve is not checked. If Serve returns an error other than http.ErrServerClosed, it should be logged to help with debugging server issues.

Suggested change
go srv.Serve(l)
go func() {
if err := srv.Serve(l); err != nil && err != http.ErrServerClosed {
slog.Error("HTTP server error", "error", err)
}
}()

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,141 @@
# Dalec Architecture
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just moved from the repo root (and root has a symlink) so that the builder has access to it.

Dagger was convenient at the time for getting the site running without
needing a bunch of things installed on the machine, but is overkill for
the usage and even problematic because:

1. Introduces a whole different go module (b/c dagger dependencies)
2. Doesn't work in some cases (namely I have issues with
   dagger+nftables)
3. Is still an extra thing in the tooling that needs to be installed
   even if its handled automatically.

Now that we have better stuff for interacting with buildkit, and
understand more of how to do that, we can actually serve the whole
website  directly out of a buildkit build without any extra tooling than
what is required to work on the rest of the project.

This uses buildkit to build the static site content and then serves it
directly out of the buildkit cache.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
@cpuguy83
Copy link
Collaborator Author

cpuguy83 commented Jan 7, 2026

@MorrisLaw A few more minor cleanups here if you could take another look.

@cpuguy83 cpuguy83 merged commit e536262 into project-dalec:main Jan 7, 2026
26 checks passed
@cpuguy83 cpuguy83 deleted the remove_dagger branch January 7, 2026 17:05
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.

3 participants