Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
bf31b97
added route in gc and initial controller
meethereum Sep 13, 2025
d0c8769
added initial status reporting logic
meethereum Sep 29, 2025
3a194ca
refactor : minor fixes and todos
meethereum Sep 29, 2025
b013bd1
fix : bug in extracting satellite name and default interval for state…
meethereum Sep 29, 2025
c62c251
lint fix
meethereum Sep 29, 2025
ac5e332
fix leaky goroutines in reporting process
meethereum Sep 29, 2025
e9c3bf4
use existing start function
meethereum Sep 29, 2025
4e15f4c
cleanup : reporting_process.go
meethereum Oct 7, 2025
25d073e
eliminate channels and hold state in a single variable
meethereum Oct 8, 2025
a0eb13c
fix : go.mod
meethereum Oct 8, 2025
d9e61b2
Merge branch 'container-registry:main' into status-reporting
meethereum Oct 8, 2025
37e6419
chore : give 2xx status codes and timeout for heartbeat request to gc
meethereum Oct 8, 2025
763fdc2
Merge branch 'status-reporting' of https://github.com/meethereum/harb…
meethereum Oct 8, 2025
fa1f204
lint
meethereum Oct 8, 2025
4105d3c
fix : update dagger version in dagger.json
meethereum Oct 8, 2025
4892862
chore : update config structuring
meethereum Oct 16, 2025
fb8eefd
fix : ground control go.mod and go.sum
meethereum Oct 20, 2025
1801f2c
fix: dagger build pipeline
meethereum Oct 20, 2025
da1effd
fix : dagger release pipeline
meethereum Oct 23, 2025
9d8be02
added docs
meethereum Oct 23, 2025
71cd308
fix : heartbeat pretty print
meethereum Oct 27, 2025
b7a233f
chore : consistent error handling
meethereum Oct 27, 2025
f94b272
chore : hot reload fix
meethereum Oct 27, 2025
d127f52
better variable naming
meethereum Oct 27, 2025
e5436be
fix : logging message in hot reload
meethereum Oct 27, 2025
c1ad01b
fix : conditional startup of scheduler
meethereum Oct 27, 2025
91fdf62
revert breaking change
meethereum Oct 27, 2025
d4f9134
change default heartbeat interval
meethereum Oct 28, 2025
ab13639
doc updates
meethereum Oct 28, 2025
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
7 changes: 4 additions & 3 deletions .dagger/e2e.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,16 @@ func (m *HarborSatellite) startPostgres(ctx context.Context) {
func (m *HarborSatellite) startGroundControl(ctx context.Context) {

gcDir := m.Source.Directory("./ground-control")
rootDir := m.Source.Directory(".")

_, err := dag.Container().
From("golang:1.24-alpine@sha256:68932fa6d4d4059845c8f40ad7e654e626f3ebd3706eef7846f319293ab5cb7a").
WithMountedCache("/go/pkg/mod", dag.CacheVolume("go-mod")).
WithEnvVariable("GOMODCACHE", "/go/pkg/mod").
WithMountedCache("/go/build-cache", dag.CacheVolume("go-build")).
WithEnvVariable("GOCACHE", "/go/build-cache").
WithDirectory("/app", gcDir).
WithWorkdir("/app").
WithDirectory("/app", rootDir).
WithWorkdir("/app/ground-control").
WithEnvVariable("DB_HOST", "postgres").
WithEnvVariable("DB_PORT", "5432").
WithEnvVariable("DB_USERNAME", "postgres").
Expand All @@ -89,7 +90,7 @@ func (m *HarborSatellite) startGroundControl(ctx context.Context) {
WithEnvVariable("HARBOR_URL", harborDomain).
WithEnvVariable("CACHEBUSTER", time.Now().String()).
WithDirectory("/migrations", gcDir.Directory("./sql/schema")).
WithWorkdir("/app").
WithWorkdir("/app/ground-control").
WithExec([]string{"go", "build", "-o", "gc", "main.go"}).
WithExposedPort(8080, dagger.ContainerWithExposedPortOpts{ExperimentalSkipHealthcheck: true}).
WithEntrypoint([]string{"./gc"}).
Expand Down
10 changes: 1 addition & 9 deletions .dagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,7 @@ func (m *HarborSatellite) Build(
source *dagger.Directory,
component string,
) (*dagger.Directory, error) {
var directory *dagger.Directory
switch {
case component == "satellite":
directory = source
case component == "ground-control":
directory = source.Directory(GROUND_CONTROL_PATH)
default:
return nil, fmt.Errorf("unknown component: %s", component)
}
directory := source
return m.build(directory, component), nil
}

Expand Down
12 changes: 10 additions & 2 deletions .dagger/publish_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (m *HarborSatellite) PublishImage(
WithMountedDirectory(PROJ_MOUNT, directory).
WithExec([]string{"ls", PROJ_MOUNT})
dirContainer.Stdout(ctx)
builders := m.getBuildContainer(ctx, component, directory)
builders := m.getBuildContainer(ctx, component, source)
releaseImages := []*dagger.Container{}

for i, tag := range imageTags {
Expand Down Expand Up @@ -170,6 +170,14 @@ func (m *HarborSatellite) getBuildContainer(
) []*dagger.Container {
var builds []*dagger.Container

var workDir string
switch {
case component == "satellite":
workDir = PROJ_MOUNT
case component == "ground-control":
workDir = PROJ_MOUNT + "/ground-control"
}

fmt.Println("🛠️ Building with Dagger...")
supportedBuilds := getSupportedBuilds()
for goos, arches := range supportedBuilds {
Expand All @@ -182,7 +190,7 @@ func (m *HarborSatellite) getBuildContainer(
WithMountedCache("/go/build-cache", dag.CacheVolume("go-build-"+GO_VERSION)).
WithEnvVariable("GOCACHE", "/go/build-cache").
WithMountedDirectory(PROJ_MOUNT, source).
WithWorkdir(PROJ_MOUNT).
WithWorkdir(workDir).
WithEnvVariable("GOOS", goos).
WithEnvVariable("GOARCH", goarch)

Expand Down
10 changes: 9 additions & 1 deletion .dagger/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ func (m *HarborSatellite) build(source *dagger.Directory, component string) *dag

outputs := dag.Directory()

var workDir string
switch {
case component == "satellite":
workDir = PROJ_MOUNT
case component == "ground-control":
workDir = PROJ_MOUNT + "/ground-control"
}

golang := dag.Container().
From(DEFAULT_GO).
WithDirectory(PROJ_MOUNT, source).
WithWorkdir(PROJ_MOUNT).
WithWorkdir(workDir).
WithExec([]string{"ls", "-la"})

// Iterate through supported builds
Expand Down
3 changes: 2 additions & 1 deletion QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ curl -i --location 'http://localhost:8080/configs' \
"register_satellite_interval": "@every 00h00m10s",
"local_registry": {
"url": "http://0.0.0.0:8585"
}
},
"heartbeat_interval": "@every 00h00m30s", # optional, default interval is 5 minutes
},
"zot_config": {
"distSpecVersion": "1.1.0",
Expand Down
5 changes: 2 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ func run(jsonLogging bool, token, groundControlURL string) error {
ctx,
cm,
log,
nil,
nil, // Will be set after scheduler creation
)

Expand Down Expand Up @@ -155,9 +156,7 @@ func run(jsonLogging bool, token, groundControlURL string) error {
}

for _, s := range s.GetSchedulers() {
if s.Name() == config.ReplicateStateJobName {
hotReloadManager.SetStateReplicationScheduler(s)
}
hotReloadManager.SetStateReplicationScheduler(s)
}

// Wait until context is cancelled
Expand Down
2 changes: 1 addition & 1 deletion dagger.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "harbor-satellite",
"engineVersion": "v0.18.12",
"engineVersion": "v0.19.2",
"sdk": {
"source": "go"
},
Expand Down
36 changes: 15 additions & 21 deletions go.mod
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/container-registry/harbor-satellite
go 1.24.0

require (
dagger.io/dagger v0.18.11
github.com/google/go-containerregistry v0.20.3
github.com/prometheus/client_golang v1.21.1
golang.org/x/sync v0.15.0
Expand All @@ -14,7 +13,9 @@ require (
require (
github.com/joho/godotenv v1.5.1
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.10.0
github.com/shirou/gopsutil/v4 v4.25.8
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.11.1
)

require (
Expand All @@ -29,61 +30,60 @@ require (
github.com/aquasecurity/iamgo v0.0.10 // indirect
github.com/aquasecurity/jfather v0.0.8 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
github.com/cncf/xds/go v0.0.0-20250326154945-ae57f3c0d45f // indirect
github.com/containerd/containerd/api v1.8.0 // indirect
github.com/containerd/containerd/v2 v2.0.3 // indirect
github.com/containerd/errdefs/pkg v0.3.0 // indirect
github.com/containerd/platforms v1.0.0-rc.1 // indirect
github.com/containerd/plugin v1.0.0 // indirect
github.com/ebitengine/purego v0.8.4 // indirect
github.com/envoyproxy/go-control-plane/envoy v1.32.4 // indirect
github.com/envoyproxy/protoc-gen-validate v1.2.1 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
github.com/go-json-experiment/json v0.0.0-20250223041408-d3c622f1b874 // indirect
github.com/go-ole/go-ole v1.3.0 // indirect
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
github.com/gocsaf/csaf/v3 v3.1.1 // indirect
github.com/google/go-github/v62 v62.0.0 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
github.com/in-toto/attestation v1.1.1 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/moby/sys/capability v0.4.0 // indirect
github.com/moby/sys/userns v0.1.0 // indirect
github.com/notaryproject/tspclient-go v1.0.0 // indirect
github.com/oklog/ulid/v2 v2.1.0 // indirect
github.com/openvex/discovery v0.1.1-0.20240802171711-7c54efc57553 // indirect
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
github.com/rust-secure-code/go-rustaudit v0.0.0-20250226111315-e20ec32e963c // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/oops v1.17.0 // indirect
github.com/sassoftware/go-rpmutils v0.4.0 // indirect
github.com/sigstore/protobuf-specs v0.4.0 // indirect
github.com/sigstore/sigstore-go v0.7.0 // indirect
github.com/smallstep/pkcs7 v0.2.1 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/spiffe/go-spiffe/v2 v2.5.0 // indirect
github.com/theupdateframework/go-tuf/v2 v2.0.2 // indirect
github.com/tklauser/numcpus v0.10.0 // indirect
github.com/tonistiigi/go-csvvalue v0.0.0-20240814133006-030d3b2625d0 // indirect
github.com/veraison/go-cose v1.3.0 // indirect
github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
github.com/zeebo/errs v1.4.0 // indirect
gitlab.com/gitlab-org/api/client-go v0.124.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/detectors/gcp v1.35.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc v0.12.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp v0.12.2 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.34.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 // indirect
go.opentelemetry.io/otel/log v0.12.2 // indirect
go.opentelemetry.io/otel/sdk/log v0.12.2 // indirect
go.opentelemetry.io/otel/sdk/metric v1.36.0 // indirect
go.opentelemetry.io/proto/otlp v1.6.0 // indirect
golang.org/x/oauth2 v0.28.0 // indirect
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
)

Expand All @@ -109,12 +109,11 @@ require (
github.com/Azure/go-autorest/tracing v0.6.1 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20221128193559-754e69321358 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.4.1 // indirect
github.com/BurntSushi/toml v1.4.0 // indirect
github.com/BurntSushi/toml v1.4.0
github.com/CycloneDX/cyclonedx-go v0.9.2 // indirect
github.com/GoogleCloudPlatform/docker-credential-gcr v2.0.5+incompatible // indirect
github.com/Intevation/gval v1.3.0 // indirect
github.com/Intevation/jsonpath v0.2.1 // indirect
github.com/Khan/genqlient v0.8.1 // indirect
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/MakeNowJust/heredoc v1.0.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
Expand All @@ -128,7 +127,6 @@ require (
github.com/ThalesIgnite/crypto11 v1.2.5 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/adrg/xdg v0.5.3 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/agnivade/levenshtein v1.2.1 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
Expand Down Expand Up @@ -286,7 +284,6 @@ require (
github.com/hashicorp/go-uuid v1.0.3 // indirect
github.com/hashicorp/go-version v1.7.0 // indirect
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
github.com/hashicorp/hcl v1.0.1-vault-7 // indirect
github.com/hashicorp/hcl/v2 v2.23.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/in-toto/in-toto-golang v0.9.0 // indirect
Expand Down Expand Up @@ -314,7 +311,6 @@ require (
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
github.com/lufia/plan9stats v0.0.0-20240513124658-fba389f38bae // indirect
github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mailru/easyjson v0.9.0 // indirect
github.com/masahiro331/go-disk v0.0.0-20240625071113-56c933208fee // indirect
github.com/masahiro331/go-ebs-file v0.0.0-20240917043618-e6d2bea5c32e // indirect
Expand Down Expand Up @@ -384,7 +380,6 @@ require (
github.com/rubenv/sql-migrate v1.7.1 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sagikazarmark/locafero v0.7.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/samber/lo v1.49.1 // indirect
github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect
github.com/sassoftware/relic v7.2.1+incompatible // indirect
Expand Down Expand Up @@ -419,7 +414,7 @@ require (
github.com/thales-e-security/pool v0.0.2 // indirect
github.com/theupdateframework/go-tuf v0.7.0 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/go-sysconf v0.3.15 // indirect
github.com/transparency-dev/merkle v0.0.2 // indirect
github.com/twitchtv/twirp v8.1.3+incompatible // indirect
github.com/ulikunitz/xz v0.5.12 // indirect
Expand Down Expand Up @@ -450,7 +445,7 @@ require (
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
golang.org/x/mod v0.25.0 // indirect
golang.org/x/net v0.41.0 // indirect
golang.org/x/sys v0.33.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.32.0 // indirect
golang.org/x/text v0.26.0 // indirect
golang.org/x/time v0.11.0 // indirect
Expand All @@ -464,7 +459,6 @@ require (
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/cheggaaa/pb.v1 v1.0.28 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading