Important
Update , October 2025: This repository is no longer maintained. Code is moved into radix-operator.
The job scheduler server for application jobs
Request from application container URLs
POSThttp://<job-name>:8080/api/v1/jobs- start a new jobGEThttp://<job-name>:8080/api/v1/jobs- get a job listGEThttp://<job-name>:8080/api/v1/jobs/<job-name>- get a job statusDELETEhttp://<job-name>:8080/api/v1/jobs/<job-name>- delete a jobPOSThttp://<job-name>:8080/api/v1/jobs/<batch-name>/stop- stop a batchPOSThttp://<job-name>:8080/api/v1/batches- start a new batchGEThttp://<job-name>:8080/api/v1/batches- get a batch listGEThttp://<job-name>:8080/api/v1/batches/<batch-name>- get a batch statusDELETEhttp://<job-name>:8080/api/v1/batches/<batch-name>- delete a batchPOSThttp://<job-name>:8080/api/v1/batches/<batch-name>/stop- stop a batchPOSThttp://<job-name>:8080/api/v1/batches/<batch-name>/jobs/<job-name>/stop- stop a batch job
You need Go installed. Run make bootstrap to install required tools.
We follow the semantic version as recommended by go.
radix-job-scheduler has three places to set version
-
apiVersionRouteinrouter/server.goandBasePathindocs/docs.go- API version, used in API's URL -
Versionindocs/docs.go- indicates changes in radix-job-scheduler logic - to see (e.g in swagger), that the version in the environment corresponds with what you wantedRun following command to update version in
swagger.jsonmake swagger -
If generated file
swagger.jsonis changed (methods or structures) - copy it to the public site
By default Info and Error messages are logged. This can be configured via environment variable LOG_LEVEL (pods need to be restarted after changes)
LOG_LEVEL=ERROR- log onlyErrormessagesLOG_LEVEL=INFOor not set - logInfoandErrormessagesLOG_LEVEL=WARNINGor not set - logInfo,WarningandErrormessagesLOG_LEVEL=DEBUG- logDebug,Warning,InfoandErrormessages
By default swagger UI is not available. This can be configured via environment variable USE_SWAGGER
-
USE_SWAGGER=true- allows to use swagger UI with URL<api-endpoint>/swaggerui -
USE_PROFILERfalseornot set- do not use profilertrue- use pprof profiler, running onhttp://localhost:7070/debug/pprof. Use web-UI to profile, when started service:
Prerequisite is an installed util
graphviz- Linux:
sudo apt-get install graphviz - Mac:
brew install graphviz
Run following command to start service with profiler
go tool pprof -http=:6070 http://localhost:7070/debug/pprof/heapCompare two states:
curl -s http://localhost:7070/debug/pprof/heap > ~/tmp/base.heap #perform some activity, then grab data again, comparing with the base go tool pprof -http=:6070 -base ~/tmp/base.heap http://localhost:7070/debug/pprof/heap
We use gomock to generate mocks used in unit test. https://github.com/golang/mock
You need to regenerate mocks if you make changes to any of the interfaces in the code, e.g. the job Handler interface
Run make mocks to regenerate mocks
We follow the semantic version as recommended by go.
-
tagin git repository (inmainbranch)Run following command to set
tag(with corresponding version)git tag v1.0.0 git push origin v1.0.0
Want to contribute? Read our contributing guidelines
This is how we handle security issues