mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-02-11 13:31:45 +01:00
Update docs and agent files
This commit is contained in:
18
CLAUDE.md
18
CLAUDE.md
@@ -22,7 +22,7 @@ make
|
|||||||
make frontend
|
make frontend
|
||||||
|
|
||||||
# Build only the backend (requires frontend to be built first)
|
# Build only the backend (requires frontend to be built first)
|
||||||
go build -ldflags='-s -X main.date=$(date +"%Y-%m-%d:T%H:%M:%S") -X main.version=1.4.4 -X main.commit=$(git rev-parse --short HEAD)' ./cmd/cc-backend
|
go build -ldflags='-s -X main.date=$(date +"%Y-%m-%d:T%H:%M:%S") -X main.version=1.5.0 -X main.commit=$(git rev-parse --short HEAD)' ./cmd/cc-backend
|
||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
@@ -41,7 +41,7 @@ go test ./internal/repository
|
|||||||
### Code Generation
|
### Code Generation
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Regenerate GraphQL schema and resolvers (after modifying api/*.graphqls)
|
# Regenerate GraphQL schema and resolvers (after modifying api/schema.graphqls)
|
||||||
make graphql
|
make graphql
|
||||||
|
|
||||||
# Regenerate Swagger/OpenAPI docs (after modifying API comments)
|
# Regenerate Swagger/OpenAPI docs (after modifying API comments)
|
||||||
@@ -90,7 +90,7 @@ The backend follows a layered architecture with clear separation of concerns:
|
|||||||
- Transaction support for batch operations
|
- Transaction support for batch operations
|
||||||
- **internal/api**: REST API endpoints (Swagger/OpenAPI documented)
|
- **internal/api**: REST API endpoints (Swagger/OpenAPI documented)
|
||||||
- **internal/graph**: GraphQL API (uses gqlgen)
|
- **internal/graph**: GraphQL API (uses gqlgen)
|
||||||
- Schema in `api/*.graphqls`
|
- Schema in `api/schema.graphqls`
|
||||||
- Generated code in `internal/graph/generated/`
|
- Generated code in `internal/graph/generated/`
|
||||||
- Resolvers in `internal/graph/schema.resolvers.go`
|
- Resolvers in `internal/graph/schema.resolvers.go`
|
||||||
- **internal/auth**: Authentication layer
|
- **internal/auth**: Authentication layer
|
||||||
@@ -108,7 +108,7 @@ The backend follows a layered architecture with clear separation of concerns:
|
|||||||
- File system backend (default)
|
- File system backend (default)
|
||||||
- S3 backend
|
- S3 backend
|
||||||
- SQLite backend (experimental)
|
- SQLite backend (experimental)
|
||||||
- **pkg/nats**: NATS client and message decoding utilities
|
- **internal/metricstoreclient**: Client for cc-metric-store queries
|
||||||
|
|
||||||
### Frontend Structure
|
### Frontend Structure
|
||||||
|
|
||||||
@@ -138,7 +138,7 @@ recommended). Configuration is per-cluster in `config.json`.
|
|||||||
3. The first authenticator that returns true performs the actual `Login`
|
3. The first authenticator that returns true performs the actual `Login`
|
||||||
4. JWT tokens are used for API authentication
|
4. JWT tokens are used for API authentication
|
||||||
|
|
||||||
**Database Migrations**: SQL migrations in `internal/repository/migrations/` are
|
**Database Migrations**: SQL migrations in `internal/repository/migrations/sqlite3/` are
|
||||||
applied automatically on startup. Version tracking in `version` table.
|
applied automatically on startup. Version tracking in `version` table.
|
||||||
|
|
||||||
**Scopes**: Metrics can be collected at different scopes:
|
**Scopes**: Metrics can be collected at different scopes:
|
||||||
@@ -173,7 +173,7 @@ applied automatically on startup. Version tracking in `version` table.
|
|||||||
|
|
||||||
**GraphQL** (gqlgen):
|
**GraphQL** (gqlgen):
|
||||||
|
|
||||||
- Schema: `api/*.graphqls`
|
- Schema: `api/schema.graphqls`
|
||||||
- Config: `gqlgen.yml`
|
- Config: `gqlgen.yml`
|
||||||
- Generated code: `internal/graph/generated/`
|
- Generated code: `internal/graph/generated/`
|
||||||
- Custom resolvers: `internal/graph/schema.resolvers.go`
|
- Custom resolvers: `internal/graph/schema.resolvers.go`
|
||||||
@@ -182,7 +182,7 @@ applied automatically on startup. Version tracking in `version` table.
|
|||||||
**Swagger/OpenAPI**:
|
**Swagger/OpenAPI**:
|
||||||
|
|
||||||
- Annotations in `internal/api/*.go`
|
- Annotations in `internal/api/*.go`
|
||||||
- Generated docs: `api/docs.go`, `api/swagger.yaml`
|
- Generated docs: `internal/api/docs.go`, `api/swagger.yaml`
|
||||||
- Run `make swagger` after API changes
|
- Run `make swagger` after API changes
|
||||||
|
|
||||||
## Testing Conventions
|
## Testing Conventions
|
||||||
@@ -196,7 +196,7 @@ applied automatically on startup. Version tracking in `version` table.
|
|||||||
|
|
||||||
### Adding a new GraphQL field
|
### Adding a new GraphQL field
|
||||||
|
|
||||||
1. Edit schema in `api/*.graphqls`
|
1. Edit schema in `api/schema.graphqls`
|
||||||
2. Run `make graphql`
|
2. Run `make graphql`
|
||||||
3. Implement resolver in `internal/graph/schema.resolvers.go`
|
3. Implement resolver in `internal/graph/schema.resolvers.go`
|
||||||
|
|
||||||
@@ -215,7 +215,7 @@ applied automatically on startup. Version tracking in `version` table.
|
|||||||
|
|
||||||
### Modifying database schema
|
### Modifying database schema
|
||||||
|
|
||||||
1. Create new migration in `internal/repository/migrations/`
|
1. Create new migration in `internal/repository/migrations/sqlite3/`
|
||||||
2. Increment `repository.Version`
|
2. Increment `repository.Version`
|
||||||
3. Test with fresh database and existing database
|
3. Test with fresh database and existing database
|
||||||
|
|
||||||
|
|||||||
@@ -173,14 +173,14 @@ ln -s <your-existing-job-archive> ./var/job-archive
|
|||||||
Job classification and application detection
|
Job classification and application detection
|
||||||
- [`taskmanager`](https://github.com/ClusterCockpit/cc-backend/tree/master/internal/taskmanager)
|
- [`taskmanager`](https://github.com/ClusterCockpit/cc-backend/tree/master/internal/taskmanager)
|
||||||
Background task management and scheduled jobs
|
Background task management and scheduled jobs
|
||||||
|
- [`metricstoreclient`](https://github.com/ClusterCockpit/cc-backend/tree/master/internal/metricstoreclient)
|
||||||
|
Client for cc-metric-store queries
|
||||||
- [`pkg/`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg)
|
- [`pkg/`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg)
|
||||||
contains Go packages that can be used by other projects.
|
contains Go packages that can be used by other projects.
|
||||||
- [`archive`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg/archive)
|
- [`archive`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg/archive)
|
||||||
Job archive backend implementations (filesystem, S3)
|
Job archive backend implementations (filesystem, S3, SQLite)
|
||||||
- [`metricstore`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg/metricstore)
|
- [`metricstore`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg/metricstore)
|
||||||
In-memory metric data store with checkpointing and metric loading
|
In-memory metric data store with checkpointing and metric loading
|
||||||
- [`nats`](https://github.com/ClusterCockpit/cc-backend/tree/master/pkg/nats)
|
|
||||||
NATS client and message handling
|
|
||||||
- [`tools/`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools)
|
- [`tools/`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools)
|
||||||
Additional command line helper tools.
|
Additional command line helper tools.
|
||||||
- [`archive-manager`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools/archive-manager)
|
- [`archive-manager`](https://github.com/ClusterCockpit/cc-backend/tree/master/tools/archive-manager)
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ All exported functions are safe for concurrent use:
|
|||||||
- `Start()` - Safe to call once
|
- `Start()` - Safe to call once
|
||||||
- `TriggerArchiving()` - Safe from multiple goroutines
|
- `TriggerArchiving()` - Safe from multiple goroutines
|
||||||
- `Shutdown()` - Safe to call once
|
- `Shutdown()` - Safe to call once
|
||||||
- `WaitForArchiving()` - Deprecated, but safe
|
|
||||||
|
|
||||||
Internal state is protected by:
|
Internal state is protected by:
|
||||||
- Channel synchronization (`archiveChannel`)
|
- Channel synchronization (`archiveChannel`)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ CROSS_LOGIN_JWT_PUBLIC_KEY="+51iXX8BdLFocrppRxIw52xCOf8xFSH/eNilN5IHVGc="
|
|||||||
|
|
||||||
Instructions
|
Instructions
|
||||||
|
|
||||||
- `cd tools/convert-pem-pubkey-for-cc/`
|
- `cd tools/convert-pem-pubkey/`
|
||||||
- Insert your public ed25519 PEM key into `dummy.pub`
|
- Insert your public ed25519 PEM key into `dummy.pub`
|
||||||
- `go run . dummy.pub`
|
- `go run . dummy.pub`
|
||||||
- Copy the result into ClusterCockpit's `.env`
|
- Copy the result into ClusterCockpit's `.env`
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# cc-frontend
|
# cc-frontend
|
||||||
|
|
||||||
[](https://github.com/ClusterCockpit/cc-svelte-datatable/actions/workflows/build.yml)
|
[](https://github.com/ClusterCockpit/cc-backend/actions/workflows/test.yml)
|
||||||
|
|
||||||
A frontend for [ClusterCockpit](https://github.com/ClusterCockpit/ClusterCockpit) and [cc-backend](https://github.com/ClusterCockpit/cc-backend). Backend specific configuration can de done using the constants defined in the `intro` section in `./rollup.config.js`.
|
A frontend for [ClusterCockpit](https://github.com/ClusterCockpit/ClusterCockpit) and [cc-backend](https://github.com/ClusterCockpit/cc-backend). Backend specific configuration can be done using the constants defined in the `intro` section in `./rollup.config.mjs`.
|
||||||
|
|
||||||
Builds on:
|
Builds on:
|
||||||
* [Svelte](https://svelte.dev/)
|
* [Svelte 5](https://svelte.dev/)
|
||||||
* [SvelteStrap](https://sveltestrap.js.org/)
|
* [SvelteStrap](https://sveltestrap.js.org/)
|
||||||
* [Bootstrap 5](https://getbootstrap.com/)
|
* [Bootstrap 5](https://getbootstrap.com/)
|
||||||
* [urql](https://github.com/FormidableLabs/urql)
|
* [urql](https://github.com/FormidableLabs/urql)
|
||||||
|
|||||||
Reference in New Issue
Block a user