qontract (Queryable cONTRACT) is a collection of tools used to SREs to expose available managed services to application developer teams. This repository compromises the server component, which is implemented as a GraphQL API.
Although it is not required, it's recommended that you use yarn for install dependencies and running development scripts.
To install this projects dependencies to a local
yarn run watch
Or alternatively, you can run the TypeScript compilation once:
To run an instance of the qontract GraphQL console:
LOAD_METHOD=fs DATAFILES_FILE=your_test_datafile yarn run server
Specific instructions for CentOS 7:
Creating the data and schema bundles
The bundles are required to run the validation and to start the server.
docker pull quay.io/app-sre/qontract-validator:latest docker run --rm -v $DATA_DIR:/data:z quay.io/app-sre/qontract-validator:latest qontract-bundler /data > data.json docker run --rm -v $SCHEMAS_DIR:/schemas:z quay.io/app-sre/qontract-validator:latest qontract-bundler /schemas > schemas.json
As of right now, the
assets/schemas/ dir in the
qontract-server git repository, although in the future it will be removed from
Validating the data against the schemas
docker run --rm -v $BUNDLES_DIR:/bundles:z quay.io/app-sre/qontract-validator:latest qontract-validator --only-errors /bundles/schemas.json /bundles/data.json
$BUNDLES_DIR is a directory that must contain the
schemas.json file created in the previous section.
All code should follow the airbnb style guide, which is enforced by this projects lint script:
yarn run lint