Monorepo for Tangled tangled.org

knotmirror: introduce knotmirror #1160

merged opened by boltless.me targeting master from sl/knotmirror

knotmirror is an external service that is intended to be used by appview. It will ingest all known git repos and provide xrpc methods to inspect them, so appview won't need to fetch individual knots on every page render.

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 3
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3mh3qbj6xvc22
-1
Interdiff #2 #3
.gitignore

This file has not been changed.

cmd/knotmirror/main.go

This file has not been changed.

flake.nix

This file has not been changed.

go.mod

This file has not been changed.

go.sum

This file has not been changed.

knotmirror/adminpage.go

This file has not been changed.

knotmirror/config/config.go

This file has not been changed.

knotmirror/crawler.go

This file has not been changed.

knotmirror/db/db.go

This file has not been changed.

knotmirror/db/hosts.go

This file has not been changed.

knotmirror/db/repos.go

This file has not been changed.

knotmirror/git.go

This file has not been changed.

knotmirror/knotmirror.go

This file has not been changed.

knotmirror/knotstream/knotstream.go

This file has not been changed.

knotmirror/knotstream/metrics.go

This file has not been changed.

knotmirror/knotstream/scheduler.go

This file has not been changed.

knotmirror/knotstream/slurper.go

This file has not been changed.

knotmirror/knotstream/subscription.go

This file has not been changed.

knotmirror/metrics.go

This file has not been changed.

knotmirror/models/models.go

This file has not been changed.

knotmirror/readme.md

This file has not been changed.

-1
knotmirror/resyncer.go
··· 31 31 repoFetchTimeout time.Duration 32 32 manualResyncTimeout time.Duration 33 33 parallelism int 34 - 35 34 } 36 35 37 36 func NewResyncer(l *slog.Logger, db *sql.DB, gitm GitMirrorManager, cfg *config.Config) *Resyncer {
knotmirror/tapclient.go

This file has not been changed.

knotmirror/templates/base.html

This file has not been changed.

knotmirror/templates/hosts.html

This file has not been changed.

knotmirror/templates/repos.html

This file has not been changed.

nix/gomod2nix.toml

This file has not been changed.

nix/pkgs/knot-mirror.nix

This file has not been changed.

History

5 rounds 4 comments
sign up or login to add to the discussion
1 commit
expand
knotmirror: introduce knotmirror
2/3 failed, 1/3 success
expand
expand 0 comments
pull request successfully merged
1 commit
expand
knotmirror: introduce knotmirror
expand 0 comments
1 commit
expand
knotmirror: introduce knotmirror
expand 0 comments
1 commit
expand
knotmirror: introduce knotmirror
expand 4 comments

cmd/knotmirror/main.go:49 we can have the entire thing config'd via env vars, no need for more flags IMO. knotmirror/crawler.go:11: what does the Crawler do? knotmirror/models/models.go:45-63: do we need the func and the global?

will post this as a preliminary review, and do a further code review shortly, i can see that PRs above this stack mutate the knotmirror modules, such as the postgres migration. would appreciate if the stack were cleaned up to remove such mutations as it is slightly hard to follow.

no need for more flags IMO

The intention was to make knotmirror service embeddable by allowing full config as an input of knotmirror.Run(). And while doing that, I thought it would be nice if we can have cli flags to override the config.

what does the Crawler do?

Crawler came from tap.Crawler which periodically schedules the resync job for known repos. As we don't have a way to check the repository state, I leave the implementation blank. It isn't strictly necessary and not valuable to implement in current structure. See TAN-283 on how I am going to check repository sync state. So yeah, it does nothing right now.

do we need the func and the global?

Uh, I think I lost one of my changes while reordering commits... I will fix that.

would appreciate if the stack were cleaned up to remove such mutations as it is slightly hard to follow.

will do.

knotmirror/knotstream/slurper.go:331

I think this is counting nanoseconds instead of seconds. Intentional?

good catch. Seems like I brought a bug from indigo/relay. Sorry for that, should check more carefully.

1 commit
expand
knotmirror: introduce knotmirror
expand 0 comments