carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1../../cmd/console/main.go|openServeDB|console.OpenGated(envOr("CONSOLE_DB", "/data/console/console.db"))
2../../cmd/console/main.go|openStore|release.NewDirStore(d)
3../../cmd/console/main.go|openStore|release.NewDeploymentS3Store(context.Background(), b)
4../../cmd/console/main.go|serve|lease.NewVersionedS3(context.Background(), buckets)
5../../cmd/console/main.go|serve|release.NewS3StoreIn(context.Background(), dbBucket, dbRegion)
6../../cmd/console/main.go|serve|mail.NewAWSProvisioner(ctx, region, mailBoundary)
7../../cmd/console/main.go|storeBackend|objstore.NewAWSProvisioner(context.Background(), region, endpoint, boundary)
8../../cmd/console/main.go|storeScannerFor|objstore.NewClamAVScanner(context.Background(), d.Region, d.Endpoint, addr, maxBytes, signer)
9../hostops/app_mutation_runner.go|RunAppMutation|b.control.BeginExclusive(ctx, account, app, a.Value.AppID, AppOperation{ID: id, Kind: OpAppMutation, AppID: a.Value.AppID, Phase: "issued", Intent: intent}, owner)
10../hostops/ingest.go|RecoverIngest|w.RecoverSQLTransaction(ctx, account, app, appID, e.ID, local)
11../hostops/ingest.go|RecoverSQLTransaction|local.FenceSQL(ctx, sc)
12../hostops/ingest.go|RecoverSQLTransaction|o.FenceSQLOutcome(ctx, sc)
13../hostops/ingest.go|RunSQLIngest|b.control.RegisterIngest(ctx, account, app, appID, id, owner)
14../hostops/lifecycle_grant.go|RecoveryPass|w.RunRecovery(ctx, r.Pass)
15../hostops/move_enrollment.go|RegisterMove|a.Control.RegisterStart(ctx, h.Account, h.App, appID, id, reg, a.Now())
16../hostops/move_enrollment.go|StartClaimMoveRecord|h.captureMoveStartBase(ctx, seq)
17../hostops/move_fence_release.go|releaseFencedTarget|hostclaim.ReleaseFencedTarget(r)
18../hostops/move_fence_release.go|releaseFencedTarget|hostclaim.VerifyMoveTargetFence(ctx, g.w.raw, o, ref, MoveFenceRegions{Authority: g.authority, HomeRegion: o.Claim.Op.Intent["home_region"]})
19../hostops/move_loss_authority.go|DeclareMoveLoss|a.Control.DeclareMoveLoss(ctx, a.Signer, a.Directory.Bucket, actor, account, app, host, box, in)
20../hostops/move_loss_authority.go|InspectMoveLoss|a.Control.InspectMoveLoss(ctx, a.Signer, a.Directory.Bucket, actor, account, app, host, box)
21../hostops/move_recovery_bridge.go|RecoverTerminatedMovingHost|hostclaim.ConvertMovingToRelocating(mh.Lifecycle(ctx), s, fresh, c.Op.ID, ref, authority, guard)
22../hostops/move_recovery_grant.go|Convert|hostclaim.ConvertMovingToRelocating(ctx, g.w.raw, o, g.o.OpID, ref, authority, guard)
23../hostops/move_recovery_grant.go|ResolveStart|runner.resolveUncertain(ctx, e, result)
24../hostops/move_start_resolve.go|ResolveMoveStart|h.Runner(h.w.now).resolveUncertain(ctx, e, result)
25../hostops/mutation_boundary.go|NewMutationBoundary|NewObservedMutationBoundary(enabled, raw, check, nil)
26../hostops/production_held_start.go|startAppLifecycle|BeginPurge(id, by, a.Now(), regions, boxes, fenced)
27../hostops/purge_control.go|DrainPurgeRegistrations|w.SavePurgeJournal(ctx, j, tag)
28../hostops/purge_control.go|DrainPurgeRegistrations|w.SavePurgeJournal(ctx, j, tag)
29../hostops/purge_control.go|DrainPurgeRegistrations|w.SavePurgeJournal(ctx, j, tag)
30../hostops/purge_fences.go|CompletePurgeFences|c.Control.RemovePurgeJournal(ctx, account, app, id)
31../hostops/purge_fences.go|CompletePurgeFences|c.Control.SavePurgeJournal(ctx, fresh, tag)
32../hostops/purge_fences.go|CompletePurgeFences|c.Control.SavePurgeJournal(ctx, fresh, tag)
33../hostops/purge_hosts.go|CensusPurge|c.Control.SavePurgeJournal(ctx, j, tag)
34../hostops/purge_hosts.go|ClaimPurgeHosts|c.Control.SavePurgeJournal(ctx, fresh, tag)
35../hostops/purge_hosts.go|ClaimPurgeHosts|c.Control.SavePurgeJournal(ctx, fresh, tag)
36../hostops/purge_hosts.go|RetirePurgeHosts|c.Control.SavePurgeJournal(ctx, fresh, tag)
37../hostops/purge_hosts.go|RetirePurgeHosts|c.Control.SavePurgeJournal(ctx, fresh, tag)
38../hostops/purge_hosts.go|RetirePurgeHosts|c.Control.SavePurgeJournal(ctx, fresh, tag)
39../hostops/purge_journal.go|DeletePurgeSweep|w.SavePurgeJournal(ctx, fresh, tag)
40../hostops/purge_journal.go|PreparePurgeSweep|w.SavePurgeJournal(ctx, j, tag)
41../hostops/purge_journal.go|VerifyPurgeSweep|w.SavePurgeJournal(ctx, j, tag)
42../hostops/recovery.go|Pass|r.ReportAutomaticLosses(ctx, host)
43../hostops/recovery.go|Pass|runMoveLogDrain(ctx, r.MoveLogs)
44../hostops/recovery.go|Pass|runMoveRecovery(ctx, obs, r.Moves, r.MoveFenceAuthority)
45../hostops/sidecarwake.go|TouchSidecarWake|a.Control.RegisterStart(ctx, account, app, appID, id, reg, a.Now())
46../mail/aws.go|NewAWSProvisioner|iam.NewFromConfig(cfg)
47../mail/aws.go|NewAWSProvisioner|sesv2.NewFromConfig(cfg)
48../mail/aws.go|NewAWSProvisioner|sts.NewFromConfig(cfg)
49../mail/sessend.go|NewSESEmailSender|sesv2.NewFromConfig(cfg)
50apihostclaim.go|handleAPIHostResolveInspect|s.cfg.ClaimAuthority.InspectMoveLoss(r.Context(), actor, account, app, r.PathValue("host"), in.Box)
51apihostclaim.go|handleAPIHostResolve|s.cfg.ClaimAuthority.DeclareMoveLoss(r.Context(), actor, account, app, r.PathValue("host"), s.claimChallengeBox(in.Submission), in.Submission)
52apiinstancemove.go|claimConsoleMove|a.Control.ConsoleMove(ctx, o, action)
53apiinstancemove.go|claimMoveLoss|a.DeclareMoveLoss(ctx, actor, acct.Sqid, app, host, box, *sub)
54apiinstancemove.go|claimMoveLoss|a.InspectMoveLoss(ctx, actor, acct.Sqid, app, host, box)
55apiinstanceimport.go|putSnapshot|os.Open(path)
56apiinstanceseed.go|uploadSnapshot|os.Open(path)
57apiruns.go|handleAPIRunCreate|rec.ActiveRun.Open()
58apiruns.go|writeRunObjects|os.Open(f.path)
59apirunsfollow.go|handleAPIRunAck|run.Open()
60apirunsfollow.go|runTransitionRefused|run.Open()
61cepull.go|realCECosts|costexplorer.NewFromConfig(cfg)
62claim_alias.go|attachDomainClaim|a.Control.RegisterStart(ctx, acct.Sqid, app, appID, id, reg, time.Now())
63claim_app_admission.go|bindClaimAppIdentity|s.claimEnrollmentContext(ctx, acct, app, appID)
64claim_app_admission.go|bindClaimAppIdentity|s.store.WithAppMutation(ctx, []sqlGrant{permitGrant(ctx, s.cfg.Releases, acct.Sqid, scope)}, func(st *Store) error { return st.BindClaimAppIdentity(acct.ID, app, appID) })
65claim_app_admission.go|initializeBackfillClaimAppAdmission|w.EnrollBackfillApp(ctx, grant)
66claim_app_admission.go|reserveClaimAppAdmission|w.EnrollNewApp(ctx, acct.Sqid, app)
67claim_app_enroll.go|createClaimAppRow|s.claimEnrollmentContext(ctx, acct, app, appID)
68claim_app_enroll.go|createClaimAppRow|w.EnrollNewApp(ctx, acct.Sqid, app)
69claim_app_mutation.go|claimAppCall|release.WithAppMutation(ctx, s.cfg.Releases, acct.Sqid, app, action, func(callCtx context.Context) error { var callErr error result, callErr = call(callCtx) return callErr })
70claim_create.go|beginClaimCreate|a.Control.RegisterStart(ctx, acct.Sqid, app, appID, id, registration, time.Now())
71claim_mail_admitter.go|AcquireClaimMailGate|g.w.AcquireMailGate(ctx, hostops.MailGateOwner(owner), hostops.MailGateScope(scope))
72claim_mail_admitter.go|AdmitClaimMailApps|m.control.BeginExclusive(ctx, app.Account, app.App, appID, op, m.owner)
73claim_mail_admitter.go|AdmitClaimMailApps|m.control.ResumeExclusive(ctx, app.Account, app.App, appID, opID, hostops.OpPurging, m.owner)
74claim_mail_admitter.go|ReleaseClaimMailGate|g.w.ReleaseMailGate(held, l)
75claim_materialize.go|materializeClaimApp|release.WithAppMutation(ctx, bucket, account, app, "projection", func(ctx context.Context) error { _, err := projectClaimApp(ctx, bucket, st, accountID, account, app, now) return err })
76claim_materialize.go|projectClaimApp|st.WithAppMutation(ctx, []sqlGrant{purgeReceiptGrant(bucket, account, scope, op)}, func(v *Store) error { if err := v.BindClaimAppOperation(accountID, app, id, op, a.Value.Revision); err != nil { return err } if err := v.MarkClaimAppRetired(accountID, app, id, now); err != nil { return err } return v.PurgeClaimAppRow(ctx, accountID, app, id, op) })
77claim_materialize.go|projectClaimApp|st.WithAppMutation(ctx, []sqlGrant{restoreReceiptGrant(ctx, bucket, account, scope, r)}, func(v *Store) error { _, err := v.FinishClaimRestoreRow(accountID, app, id, r.DeletedAt, now) return err })
78claim_materialize.go|projectClaimApp|st.WithAppMutation(ctx, []sqlGrant{tombstoneGrant(ctx, bucket, account, scope, tag)}, func(v *Store) error { _, err := v.SetClaimRestoring(accountID, app, id, false) return err })
79claim_materialize.go|projectClaimApp|st.WithAppMutation(ctx, []sqlGrant{tombstoneGrant(ctx, bucket, account, scope, tag)}, func(v *Store) error { _, err := v.TrashClaimAppRow(accountID, app, id, tomb.DeletedAt) return err })
80claim_placement.go|Resume|p.Controller.Control.ResumeExclusive(ctx, account, app, appID, id, hostops.OpPlacing, p.Owner)
81claim_placement.go|Start|p.Controller.Control.BeginExclusive(ctx, account, app, appID, op, p.Owner)
82claim_placement.go|sqlEffect|p.Server.store.WithAppMutation(ctx, []sqlGrant{permitGrant(ctx, p.Controller.Store, h.Account(), scope)}, fn)
83claim_purge.go|Request|w.ReservePurge(ctx, j, p.Owner, p.Controller.Now())
84claim_purge.go|Resume|s.store.WithAppMutation(ctx, []sqlGrant{permitGrant(ctx, s.cfg.Releases, account, scope)}, func(st *Store) error { if err := st.MarkClaimAppRetired(acct.ID, app, appID, p.Controller.Now()); err != nil { return err } return st.PurgeClaimAppRow(ctx, acct.ID, app, appID, id) })
85claim_purge.go|Resume|s.store.WithAppMutation(ctx, []sqlGrant{permitGrant(ctx, s.cfg.Releases, account, scope)}, func(st *Store) error { return st.BindClaimAppOperation(acct.ID, app, appID, id, revision) })
86claim_purge.go|Resume|w.BeginPurge(ctx, account, app, appID, id, p.Owner)
87claim_purge.go|Resume|w.RemovePurgeJournal(ctx, account, app, id)
88claim_purge.go|Resume|w.RemovePurgeJournal(ctx, account, app, id)
89claim_purge.go|Resume|w.SavePurgeJournal(ctx, fresh, tag)
90claim_purge.go|Resume|w.SavePurgeJournal(ctx, fresh, tag)
91claim_purge.go|Resume|w.SavePurgeJournal(ctx, j, tag)
92claim_purge.go|Resume|w.SavePurgeJournal(ctx, j, tag)
93claim_purge.go|Resume|w.SavePurgeJournal(ctx, j, tag)
94claim_purge.go|captureDomains|w.SavePurgeJournal(ctx, j, tag)
95claim_purge.go|teardown|w.SavePurgeJournal(ctx, j, tag)
96claim_relay.go|relayAppMutation|release.WithAppMutation(ctx, s.cfg.Releases, acct, app, action, fn)
97claim_restore.go|restoreClaimApp|s.store.WithAppMutation(ctx, []sqlGrant{permitGrant(pctx, s.cfg.Releases, acct.Sqid, scope)}, func(v *Store) error { _, err := v.SetClaimRestoring(acct.ID, app, appID, true) return err })
98claim_restore.go|restoreClaimApp|w.BeginExclusive(ctx, acct.Sqid, app, appID, hostops.AppOperation{ID: op, Kind: hostops.OpAppMutation, AppID: appID, Phase: "issued", Intent: map[string]string{"action": "restore", hostops.RestoreActionStarted: strconv.FormatInt(now.Unix(), 10)}}, owner)
99claim_retire.go|retireClaimHostRecord|c.Control.BeginExclusive(ctx, ref.Account, ref.App, appID, begin, s.claimOwner)
100claim_retire.go|retireClaimHostRecord|c.Control.ResumeExclusive(ctx, ref.Account, ref.App, appID, op.ID, hostops.OpDeleting, s.claimOwner)
101claim_route_writes.go|appMutation|release.WithAppMutation(ctx, s.cfg.Releases, acct.Sqid, app, action, fn)
102claim_runtime.go|ConfigureClaimRuntime|a.Control.ReportAutomaticLosses(ctx, a.Signer, host)
103claim_runtime.go|ConfigureClaimRuntime|hostops.BindMutationRunner(data, control, owner, s.mutationAppID)
104claim_runtime.go|ConfigureClaimRuntime|hostops.NewConditionalRecordStore(raw, s.cfg.ReleasePub, s.cfg.dbClaimHomeRegion())
105claim_runtime.go|ConfigureClaimRuntime|hostops.NewControlWriter(raw, s.cfg.ReleasePub, time.Now, s.cfg.dbClaimHomeRegion())
106claim_runtime.go|ConfigureClaimRuntime|hostops.NewObservedMutationBoundary(true, records, check, s.claimMutationObserver)
107claim_runtime.go|ConfigureClaimRuntime|hostops.NewProductionMutationCheck(raw, control)
108claim_runtime.go|ConfigureClaimRuntime|hostops.NewVersionedBoundary(true, s.cfg.DBVersions, raw, control, s.cfg.Bucket, dataBuckets, s.claimMutationObserver)
109claim_runtime.go|sweepOneClaimAdmission|c.Control.RecoverSQLTransaction(ctx, app.Account, app.Name, appID, id, s.store)
110claim_sql_auto.go|withAutoAppSQL|s.WithAppMutation(pctx, []sqlGrant{permitGrant(pctx, s.claimBucket, acct.Sqid, scope)}, call)
111claim_sql_grants.go|WithAppMutation|p.BindTransaction(database)
112claim_sql_grants.go|WithAppMutation|s.withPreparedClaimSQL(ctx, scopes, func(context.Context, claimSQLScope) error { return nil }, local, receipts, true, fn)
113claim_sql_grants.go|permitGrant|hostops.PrepareSQLPermit(pctx, rd, sqid, sc.App, sc.AppID)
114claim_sql_identity_linux.go|sqlPhysicalIdentity|syscall.Open(path, syscall.O_RDONLY|syscall.O_CLOEXEC|syscall.O_NOFOLLOW, 0)
115claim_sql_receipts.go|FenceSQL|s.FenceSQLOutcome(ctx, sc)
116claim_sql_receipts.go|finishPreparedSQL|s.FenceSQL(proofCtx, p.Receipt())
117economicspass.go|sizeProvisionedStore|objstore.S3ClientFor(ctx, p.Region, p.Endpoint)
118geoippublish.go|Commit|os.Open(st.path)
119hostclaimbackfill.go|RunClaimRecoveryPass|a.Control.RunRecovery(ctx, s.runClaimRecoveryPassBody)
120hostwakereset.go|registerWakeRetryReset|a.Control.RegisterStart(ctx, h.Account, h.App, reg.AppID, id, reg, registeredAt)
121hostwakereset.go|registerWakeRetryReset|start.FinishWakeRetryReset(cleanup)
122movesrecovery.go|deliverMoveLog|lw.WriteMoveLog(ctx, hostops.MoveLogEntry{Host: r.Host, Op: r.Op, Incarnation: r.Incarnation, Name: r.Name, Body: r.Body})
123movesrecovery.go|movesRecovery|a.Control.ConsoleMove(ctx, co, hostops.ConsoleMoveAbort)
124movesrecovery.go|movesRecovery|g.Claim(ctx, d.Claim)
125movesrecovery.go|movesRecovery|g.Convert(ctx, *in.Fence)
126movesrecovery.go|movesRecovery|g.Record(ctx, d.Record)
127movesrecovery.go|movesRecovery|g.Record(ctx, d.Record)
128movesrecovery.go|movesRecovery|g.ReleaseFencedTarget(ctx, *in.TargetFence)
129movesrecovery.go|movesRecovery|g.ResolveStart(ctx)
130movesrecovery.go|movesRecovery|g.StampLostMoveTargetParked(ctx)
131runsweep.go|runSweepPass|r.Open()
132scanpass.go|storeLister|objstore.S3ClientFor(ctx, p.Region, p.Endpoint)
133store.go|Open|sql.Open("sqlite", path)
134store_gate.go|Connect|k.g.d.Open(k.g.dsn)
135store_gate.go|openGated|sql.OpenDB(claimConnector{g: g, trusted: true})
136store_gate.go|openGated|sql.OpenDB(claimConnector{g: g})
137store_gate.go|withClaimSQL|s.withPreparedClaimSQL(ctx, scopes, check, func(ctx context.Context, _ claimSQLScope) error { return ctx.Err() }, nil, false, fn)
138view.go|openRegistry|registry.Open(path)
139claim_loss_pages.go|ClaimLossPageAttempt|s.db.ExecContext(ctx, `INSERT INTO claim_loss_pages (rule, first_attempted_at, attempted_at) VALUES (?, ?, ?) ON CONFLICT(rule) DO UPDATE SET attempted_at = excluded.attempted_at WHERE claim_loss_pages.attempted_at <= CASE WHEN claim_loss_pages.first_attempted_at > ? THEN ? ELSE ? END`, rule, now.UnixNano(), now.UnixNano(), now.Add(-claimLossPageDailyInterval).UnixNano(), now.Add(-claimLossPageInterval).UnixNano(), now.Add(-claimLossPageDailyInterval).UnixNano())
140claim_loss_pages.go|pageClaimLossRecord|hostclaim.ReadLossRecord(read, s.cfg.Releases, s.cfg.ReleasePub, id)
141claim_loss_pages.go|pageClaimLossesAt|s.cfg.Releases.List(ctx, "control/host-loss/")
142claim_loss_pages.go|pageClaimLoss|s.store.ClaimLossPageAttempt(ctx, condition+" "+r.ID, now())
143store_gate.go|OpenGated|s.db.Exec(`CREATE TABLE IF NOT EXISTS claim_loss_pages ( rule TEXT PRIMARY KEY, first_attempted_at INTEGER NOT NULL, attempted_at INTEGER NOT NULL );`)
144store_gate.go|OpenGated|s.db.Exec(`ALTER TABLE claim_loss_pages ADD COLUMN first_attempted_at INTEGER`)
145store_gate.go|OpenGated|s.db.Exec(`UPDATE claim_loss_pages SET first_attempted_at = attempted_at WHERE first_attempted_at IS NULL`)
146claim_loss_pages.go|pageClaimLossesAt|s.store.db.ExecContext(ctx, `INSERT INTO claim_loss_pages (rule, first_attempted_at, attempted_at, last_key) VALUES ('scan', 0, 0, ?) ON CONFLICT(rule) DO UPDATE SET last_key = excluded.last_key`, key)
147claim_loss_pages.go|pageClaimLossesAt|s.store.db.QueryRowContext(ctx, `SELECT last_key FROM claim_loss_pages WHERE rule = 'scan'`)
148store_gate.go|OpenGated|s.db.Exec(`ALTER TABLE claim_loss_pages ADD COLUMN last_key TEXT NOT NULL DEFAULT ''`)
149awsregionmetric.go|capacityPublisherFromEnv|cloudwatch.NewFromConfig(cfg, func(o *cloudwatch.Options) { o.Region = awsRegion })
150enrollpass.go|startEnrollPass|newAutoEnroller(s.cfg.ClaimAuthority, members)
151enrollpass.go|startEnrollPass|runEnrollPass(ctx, e, enrollPassInterval, log.Printf)
152enrollpass.go|runEnrollPass|e.EnrollPass(ctx)
153