Giter VIP home page Giter VIP logo

jk's Introduction

jk

Build Status

jk is still in very early stages. The standard library API isn't frozen and will most likely change. Feedback is most definitely welcome!

jk - configuration as code

jk is a data templating tool designed to help writing structured configuration files.

The main idea behind jk is to use a general purpose language for this task. They offer mature tooling, great runtimes, a well established ecosystem and many learning resources. jk uses Javascript and a runtime tailored for configuration.

Quick start

A good way to start with jk is to read our introduction tutorial. For more context head to our introduction blog post!

More complex examples

Architecture & design

v8

jk itself is a Javascript runtime written in Go and embedding v8. It uses Ryan Dahl's v8worker2 to embed v8 and flatbuffers for the v8 โŸท Go communication.

Hermeticity

While a general purpose language is great, configuration code can be made more maintainable by restricting what it can do. A nice property jk has to offer is being hermetic: if you clone a git repository and execute a jk script, the resulting files should be the same on any machine. To give concrete examples, this means the jk standard library doesn't support environment variables nor has any networking capability.

Library support

jk provides an unopinionated data templating layer. On top of the jk runtime, libraries provide APIs for users to write configuration.

Roadmap

This project is still in early stages but future (exciting!) plans include:

  • Reach the state of having Kubernetes examples working and well documented.
  • Work on hermeticity. (eg. #110, #44, topic/hermeticity).
  • Native typescript support (#54).
  • HCL support (#94).

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue with the owners of this repository before making a change.

Setup

The jk executable itself is written in Go, but the JavaScript part of this project requires NodeJS.

Prerequisites:

  • go 1.11.4 or later (modules support)
  • nodejs, npm
  • make
  • pkg-config

First off, clone this repository:

$ git clone https://github.com/jkcfg/jk.git
# or with hub:
$ hub clone jkcfg/jk

$ cd ./jk

Then pull most of the dependencies using the Makefile:

$ make dep

jk is linked against v8worker2. As building V8 takes ~30 minutes, prebuilt versions are provided for linux/amd64 and darwin/amd64. This also includes flatc from flatbuffers:

# download the prebuilt artifacts from GitHub:
$ git clone https://github.com/jkcfg/prebuilt.git
$ cd ./prebuilt

# these following put files in /usr/local, so you may need sudo

# x64 Linux:
$ make install-linux-amd64

# x64 macOS:
$ make install-darwin-amd64

Building

After setting up the environment, the jk binary can be built:

$ make jk
$ ./jk --help # confirm it works

Additionally, on Linux, it's possible to use a docker container to build the project instead of installing the prebuilt libraries and binaries:

$ ./run-in-docker.sh make dep jk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.