cc-backend/README.md

54 lines
2.1 KiB
Markdown
Raw Normal View History

2021-12-09 16:27:48 +01:00
# ClusterCockpit with a Golang backend
2021-03-31 08:52:43 +02:00
2021-12-17 15:49:22 +01:00
__*DOES NOT WORK WITH CURRENT FRONTEND*__
2021-11-26 10:35:07 +01:00
[![Build](https://github.com/ClusterCockpit/cc-jobarchive/actions/workflows/test.yml/badge.svg)](https://github.com/ClusterCockpit/cc-jobarchive/actions/workflows/test.yml)
2021-03-31 08:52:43 +02:00
2022-01-07 09:54:12 +01:00
Create your job-archive accoring to [this specification](https://github.com/ClusterCockpit/cc-specifications). At least one cluster with a valid `cluster.json` file is required. Having no jobs in the job-archive at all is fine. You may use the sample job-archive available for download [in cc-docker/develop](https://github.com/ClusterCockpit/cc-docker/tree/develop).
### Run server
2021-03-31 08:54:14 +02:00
```sh
# The frontend is a submodule, so use `--recursive`
git clone --recursive git@github.com:ClusterCockpit/cc-jobarchive.git
2021-03-31 08:54:14 +02:00
# Prepare frontend
cd ./cc-jobarchive/frontend
yarn install
2021-12-09 16:27:48 +01:00
yarn build
2021-03-31 08:58:34 +02:00
cd ..
go get
go build
# The job-archive directory must be organised the same way as
# as for the regular ClusterCockpit.
ln -s <your-existing-job-archive> ./var/job-archive
# Create empty job.db (Will be initialized as SQLite3 database)
touch ./var/job.db
# This will first initialize the job.db database by traversing all
# `meta.json` files in the job-archive. After that, a HTTP server on
# the port 8080 will be running. The `--init-db` is only needed the first time.
2022-01-07 09:54:12 +01:00
./cc-jobarchive --init-db --add-user <your-username>:admin:<your-password>
# Show other options:
./cc-jobarchive --help
2021-03-31 08:58:34 +02:00
```
### Configuration
2022-01-07 09:54:12 +01:00
A config file in the JSON format can be provided using `--config` to override the defaults. Look at the beginning of `server.go` for the defaults and consequently the format of the configuration file.
### Update GraphQL schema
This project uses [gqlgen](https://github.com/99designs/gqlgen) for the GraphQL API. The schema can be found in `./graph/schema.graphqls`. After changing it, you need to run `go run github.com/99designs/gqlgen` which will update `graph/model`. In case new resolvers are needed, they will be inserted into `graph/schema.resolvers.go`, where you will need to implement them.
2019-04-29 10:26:20 +02:00
### TODO
- [ ] Documentation
- [ ] Write more TODOs
2021-12-09 16:27:48 +01:00
- [ ] Caching
- [ ] Generate JWTs based on the provided keys