server

module
v2.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2017 License: GPL-3.0

README

bblfshd Build Status codecov license GitHub release

This repository contains bblfsh daemon (bblfshd), which includes the runtime that runs the driver in containers and the bblfshctl, a cli tool used too control the installed drivers and query the status of the daemon.

Drivers are implemented as docker image that each have their own repository in the bblfsh organization on GitHub. For more information, see bblfsh SDK documentation.

Getting Started

See the Getting Started guide.

Quick start

The recommended way to run bblfshd is using docker:

docker run -d --name bblfshd --privileged -p 9432:9432 -v /var/lib/bblfshd:/var/lib/bblfshd bblfsh/bblfshd

The container should be executed with the --privileged flag since bblfshd it's based on container technology and interacts with the kernel at a low level. bblfshd, expose a gRPC server at the port 9432 by default, this gRPC will be used by the clients to interact with the server. Also, we mount the path /var/lib/bblfshd/ where all the driver images and container instances will be stored.

Now you we need to install the driver images into the daemon, you can install the official images just running the command:

docker exec -it bblfshd bblfshctl driver install --all

You can check the installed versions executing:

docker exec -it bblfshd bblfshctl driver list
+----------+-------------------------------+---------+--------+---------+--------+-----+-------------+
| LANGUAGE |             IMAGE             | VERSION | STATUS | CREATED |   OS   | GO  |   NATIVE    |
+----------+-------------------------------+---------+--------+---------+--------+-----+-------------+
| python   | //bblfsh/python-driver:latest | v1.1.5  | beta   | 4 days  | alpine | 1.8 | 3.6.2       |
| java     | //bblfsh/java-driver:latest   | v1.1.0  | alpha  | 6 days  | alpine | 1.8 | 8.131.11-r2 |
+----------+-------------------------------+---------+--------+---------+--------+-----+-------------+

To test the driver you can executed a parse request to the server with the bblfshctl parse command, and an example contained in the docker image:

docker exec -it bblfshd bblfshctl parse /opt/bblfsh/etc/examples/python.py

Development

If you wish to work on bblfshd , you'll first need Go installed on your machine (version 1.9+ is required) and Docker, docker its used to build and run the test in an isolated environment.

For local development of bblfshd, first make sure Go is properly installed and that a GOPATH has been set. You will also need to add $GOPATH/bin to your $PATH.

Next, using Git, clone this repository into $GOPATH/src/github.com/bblfsh/bblfshd. All the necessary dependencies are automatically installed, so you just need to type make. This will compile the code and then run the tests. If this exits with exit status 0, then everything is working!

Dependencies

Ensure you have ostree and development libraries for ostree installed.

You can install from your distribution pack manager as follow, or built from source (more on that here).

Debian, Ubuntu, and related distributions:

$ apt-get install libostree-dev

Fedora, CentOS, RHEL, and related distributions:

$ yum install -y ostree-devel

Arch and related distributions:

$ pacman -S ostree
Building From Source

Build with:

$ make build
Running Tests

Run tests with:

$ make test

License

GPLv3, see LICENSE

Directories

Path Synopsis
cli
protocol
Package protocol is a generated protocol buffer package.
Package protocol is a generated protocol buffer package.
Package runtime provide the runtime environment to execute the bblfsh drivers The runtime is based on libcontainer allowing to the runtime run the drivers inside of a isolated lightweight container.
Package runtime provide the runtime environment to execute the bblfsh drivers The runtime is based on libcontainer allowing to the runtime run the drivers inside of a isolated lightweight container.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL