- groups:add / ranges:plan / nodes:create / coordinator:run commands - the node API: lease, the range's chunks as one framed stream from the spool, batches, heartbeat, finish, release (node guard, token per node) - edge:node: needs COORDINATOR_URL and NODE_TOKEN only (placeholders for the rest), posts a batch every 10 chunks, gives its range back on SIGTERM - releases are gathered per batch: 1.04 chunk rows per release at 10 chunks per batch (1.35 when built per XOVER chunk) - partitions are checked per batch instead of remembered Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
52 lines
1.5 KiB
TypeScript
52 lines
1.5 KiB
TypeScript
/*
|
||
|--------------------------------------------------------------------------
|
||
| Routes file
|
||
|--------------------------------------------------------------------------
|
||
|
|
||
| The routes file is used for defining the HTTP routes.
|
||
|
|
||
*/
|
||
|
||
import { middleware } from '#start/kernel'
|
||
import router from '@adonisjs/core/services/router'
|
||
import { controllers } from '#generated/controllers'
|
||
|
||
router.get('/', () => {
|
||
return { hello: 'world' }
|
||
})
|
||
|
||
router
|
||
.group(() => {
|
||
router
|
||
.group(() => {
|
||
router.post('signup', [controllers.NewAccount, 'store'])
|
||
router.post('login', [controllers.AccessTokens, 'store'])
|
||
})
|
||
.prefix('auth')
|
||
.as('auth')
|
||
|
||
router
|
||
.group(() => {
|
||
router.get('profile', [controllers.Profile, 'show'])
|
||
router.post('logout', [controllers.AccessTokens, 'destroy'])
|
||
})
|
||
.prefix('account')
|
||
.as('profile')
|
||
.use(middleware.auth())
|
||
|
||
// Edge workers (REBUILD.md, parts 1–2).
|
||
router
|
||
.group(() => {
|
||
router.post('lease', [controllers.Node, 'lease'])
|
||
router.get('ranges/:id/stream', [controllers.Node, 'stream'])
|
||
router.post('ranges/:id/batches', [controllers.Node, 'batch'])
|
||
router.post('ranges/:id/heartbeat', [controllers.Node, 'heartbeat'])
|
||
router.post('ranges/:id/finish', [controllers.Node, 'finish'])
|
||
router.post('ranges/:id/release', [controllers.Node, 'release'])
|
||
})
|
||
.prefix('node')
|
||
.as('node')
|
||
.use(middleware.auth({ guards: ['node'] }))
|
||
})
|
||
.prefix('/api/v1')
|