Skip to content
Open
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
16 changes: 2 additions & 14 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# code downloads and caches all dependencies for earthly and then copies the go code
# directories into the image.
# If BUILDKIT_PROJECT or CLOUD_API environment variables are set it will also update the go mods
# If BUILDKIT_PROJECT environment variable is set it will also update the go mods
# for the local versions
code:
FROM +deps
Expand All @@ -68,21 +68,9 @@
--mount type=cache,target=/go/pkg/mod,sharing=shared,id=go-mod \
go mod download
END
# Use CLOUD_API to point go.mod to a cloud API dir being actively developed. Examples:
# --CLOUD_API=../cloud/api+proto/api/public/'*'
# --CLOUD_API=github.com/earthly/cloud/api:<git-ref>+proto/api/public/'*'
# --CLOUD_API=github.com/earthly/cloud-api:<git-ref>+code/'*'
ARG CLOUD_API
IF [ "$CLOUD_API" != "" ]
COPY --dir "$CLOUD_API" /cloud-api/
RUN go mod edit -replace github.com/earthly/cloud-api=/cloud-api
RUN \
--mount type=cache,target=/go/pkg/mod,sharing=shared,id=go-mod \
go mod download
END
COPY ./ast/parser+parser/*.go ./ast/parser/
COPY --dir autocomplete buildcontext builder cleanup cmd config conslogging debugger \
docker2earthly dockertar domain features internal logbus regproxy states slog util variables ./
docker2earthly dockertar domain features internal logbus logstream regproxy states slog util variables ./
COPY --dir buildkitd/buildkitd.go buildkitd/settings.go buildkitd/certificates.go buildkitd/
COPY --dir earthfile2llb/*.go earthfile2llb/
COPY --dir ast/antlrhandler ast/spec ast/command ast/commandflag ast/*.go ast/
Expand Down Expand Up @@ -195,7 +183,7 @@
govulncheck ./... >> /tmp/govulncheck_output || touch /tmp/govulncheck_failed
END
# print output for all modules and fail if any vulnerabilities were found
RUN \

Check failure on line 186 in Earthfile

View workflow job for this annotation

GitHub Actions / Go Vulnerabilities Report

Error

The command RUN if [ -f /tmp/govulncheck_failed ]; then cat /tmp/govulncheck_output; exit 1; fi did not complete successfully. Exit code 1
if [ -f /tmp/govulncheck_failed ]; then \
cat /tmp/govulncheck_output; \
exit 1; \
Expand Down
2 changes: 1 addition & 1 deletion cmd/earthly/app/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/fatih/color"
"github.com/moby/buildkit/util/grpcerrors"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion earthfile2llb/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/EarthBuild/earthbuild/features"
"github.com/EarthBuild/earthbuild/inputgraph"
"github.com/EarthBuild/earthbuild/logbus"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/states"
"github.com/EarthBuild/earthbuild/states/dedup"
"github.com/EarthBuild/earthbuild/states/image"
Expand All @@ -50,7 +51,6 @@ import (
"github.com/EarthBuild/earthbuild/variables/reserved"
"github.com/containerd/platforms"
"github.com/distribution/reference"
"github.com/earthly/cloud-api/logstream"
"github.com/google/uuid"
"github.com/moby/buildkit/client/llb"
dockerimage "github.com/moby/buildkit/exporter/containerimage/image"
Expand Down
2 changes: 1 addition & 1 deletion earthfile2llb/with_docker_run_local_reg.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (

"github.com/EarthBuild/earthbuild/domain"
"github.com/EarthBuild/earthbuild/logbus/solvermon"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/states"
"github.com/EarthBuild/earthbuild/util/containerutil"
"github.com/EarthBuild/earthbuild/util/syncutil/semutil"
"github.com/earthly/cloud-api/logstream"
"github.com/pkg/errors"
)

Expand Down
2 changes: 1 addition & 1 deletion earthfile2llb/with_docker_run_reg.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ import (

"github.com/EarthBuild/earthbuild/domain"
"github.com/EarthBuild/earthbuild/logbus/solvermon"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/states"
"github.com/EarthBuild/earthbuild/util/llbutil/pllb"
"github.com/EarthBuild/earthbuild/util/platutil"
"github.com/EarthBuild/earthbuild/util/syncutil/semutil"
"github.com/earthly/cloud-api/logstream"
"github.com/moby/buildkit/client/llb"
"github.com/pkg/errors"
)
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ require (
github.com/docker/go-connections v0.6.0
github.com/docker/go-units v0.5.0
github.com/dustin/go-humanize v1.0.1
github.com/earthly/cloud-api v1.0.1-0.20240712142419-23b6f0913996
github.com/elastic/go-sysinfo v1.15.4
github.com/fatih/color v1.18.0
github.com/gofrs/flock v0.13.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ github.com/earthbuild/buildkit v0.0.0-20240515200521-531b303aa8ec h1:aJS+Pmv8KW3
github.com/earthbuild/buildkit v0.0.0-20240515200521-531b303aa8ec/go.mod h1:1/yAC8A0Tu94Bdmv07gaG1pFBp+CetVwO7oB3qvZXUc=
github.com/earthbuild/fsutil v0.0.0-20231030221755-644b08355b65 h1:IOk0NURVGR6BO+dZXvuVSazZDBwJBFNvyv7kN9309m4=
github.com/earthbuild/fsutil v0.0.0-20231030221755-644b08355b65/go.mod h1:9kMVqMyQ/Sx2df5LtnGG+nbrmiZzCS7V6gjW3oGHsvI=
github.com/earthly/cloud-api v1.0.1-0.20240712142419-23b6f0913996 h1:UobaUMrXjUcVaHXAev9aOflHHRg9gO+uOwhCvWJ9+cw=
github.com/earthly/cloud-api v1.0.1-0.20240712142419-23b6f0913996/go.mod h1:rU/tYJ7GFBjdKAITV2heDbez++glpGSbtJaZcp73rNI=
github.com/elastic/go-sysinfo v1.15.4 h1:A3zQcunCxik14MgXu39cXFXcIw2sFXZ0zL886eyiv1Q=
github.com/elastic/go-sysinfo v1.15.4/go.mod h1:ZBVXmqS368dOn/jvijV/zHLfakWTYHBZPk3G244lHrU=
github.com/elastic/go-windows v1.0.2 h1:yoLLsAsV5cfg9FLhZ9EXZ2n2sQFKeDYrHenkcivY4vI=
Expand Down
2 changes: 1 addition & 1 deletion logbus/bus.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"
"time"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
)

// Subscriber is an object that can receive deltas.
Expand Down
2 changes: 1 addition & 1 deletion logbus/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"sync/atomic"
"time"

"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/util/circbuf"
"github.com/earthly/cloud-api/logstream"
"github.com/pkg/errors"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
Expand Down
2 changes: 1 addition & 1 deletion logbus/formattedwriter.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package logbus

import (
"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
)

// FormattedWriter is a writer that produces DeltaFormattedLog messages.
Expand Down
2 changes: 1 addition & 1 deletion logbus/formatter/formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (

"github.com/EarthBuild/earthbuild/conslogging"
"github.com/EarthBuild/earthbuild/logbus"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/util/deltautil"
"github.com/EarthBuild/earthbuild/util/execstatssummary"
"github.com/EarthBuild/earthbuild/util/progressbar"
"github.com/EarthBuild/earthbuild/util/stringutil"
runc "github.com/containerd/go-runc"
humanize "github.com/dustin/go-humanize"
"github.com/earthly/cloud-api/logstream"
"github.com/hashicorp/go-multierror"
"github.com/mattn/go-isatty"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion logbus/generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"time"

"github.com/EarthBuild/earthbuild/conslogging"
"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
)

// Generic is a generic writer for build output unrelated to a specific target.
Expand Down
2 changes: 1 addition & 1 deletion logbus/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/EarthBuild/earthbuild/ast/spec"
"github.com/EarthBuild/earthbuild/domain"
"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/moby/buildkit/util/sshutil"
)

Expand Down
2 changes: 1 addition & 1 deletion logbus/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"github.com/EarthBuild/earthbuild/logbus/formatter"
"github.com/EarthBuild/earthbuild/logbus/solvermon"
"github.com/EarthBuild/earthbuild/logbus/writersub"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/util/deltautil"
"github.com/EarthBuild/earthbuild/util/execstatssummary"
"github.com/earthly/cloud-api/logstream"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"google.golang.org/protobuf/encoding/protojson"
Expand Down
2 changes: 1 addition & 1 deletion logbus/solvermon/solvermon.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"time"

"github.com/EarthBuild/earthbuild/logbus"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/util/statsstreamparser"
"github.com/EarthBuild/earthbuild/util/stringutil"
"github.com/EarthBuild/earthbuild/util/vertexmeta"
"github.com/EarthBuild/earthbuild/util/xcontext"
"github.com/earthly/cloud-api/logstream"
"github.com/moby/buildkit/client"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
Expand Down
2 changes: 1 addition & 1 deletion logbus/solvermon/vertexmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"time"

"github.com/EarthBuild/earthbuild/logbus"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/EarthBuild/earthbuild/util/errutil"
"github.com/EarthBuild/earthbuild/util/statsstreamparser"
"github.com/EarthBuild/earthbuild/util/stringutil"
"github.com/EarthBuild/earthbuild/util/vertexmeta"
"github.com/earthly/cloud-api/logstream"
"github.com/moby/buildkit/client"
"github.com/pkg/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion logbus/solvermon/vertexmon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package solvermon
import (
"testing"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
)
Expand Down
2 changes: 1 addition & 1 deletion logbus/target.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"sync"
"time"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
)

// Target is a delta generator for a target.
Expand Down
2 changes: 1 addition & 1 deletion logbus/writersub/raw.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"sync"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)
Expand Down
2 changes: 1 addition & 1 deletion logbus/writersub/writersub.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"
"sync"

"github.com/earthly/cloud-api/logstream"
"github.com/EarthBuild/earthbuild/logstream"
)

// WriterSub is a bus subscriber that can print formatted logs to a writer.
Expand Down
46 changes: 46 additions & 0 deletions logstream/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# logstream

This package contains Protocol Buffer definitions and generated Go code for logging and manifest tracking in EarthBuild.

## Overview

The logstream package defines the data structures used for:
- Build manifests (targets, commands, status)
- Log streaming (raw and formatted logs)
- Delta updates for incremental manifest changes

## History

This package was originally part of `github.com/earthly/cloud-api` but has been internalized into the EarthBuild project to remove the external dependency. The Protocol Buffer definitions and generated code provide the same functionality as the original cloud-api version.

## Files

- `manifest.proto` - Defines build manifest structures (RunManifest, TargetManifest, CommandManifest, etc.)
- `delta.proto` - Defines delta/incremental update structures (Delta, DeltaLog, DeltaFormattedLog, etc.)
- `manifest.pb.go` - Generated Go code from manifest.proto
- `delta.pb.go` - Generated Go code from delta.proto

## Regenerating Go Code

If you need to regenerate the Go code from the proto files:

```bash
# Install protoc and protoc-gen-go if not already installed
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest

# Generate Go code
protoc --go_out=. --go_opt=paths=source_relative \
manifest.proto delta.proto
```

Alternatively, you can use buf or other proto generation tools.

## Usage

This package is used throughout EarthBuild for:
- Tracking build state and progress
- Streaming logs from build commands
- Reporting build status and failures
- Managing build manifests

See the `logbus` package for the main consumers of these types.
Loading
Loading