Compiling Accio

Accio has been successfully compiled on Mac OS X (10.10, 10.11 and 10.12) and Ubuntu (14.04 and 16.04). This page describes how to successfully get started to develop Accio. Accio can be built either entirely or component by component. This page describes in depth the setup of a local development environment. You can either use a Vagrant-based environment or create your environment from scratch.

Compile from scratch

If you prefer, you can also create a development environment from scratch, by installing everything needed.

1. Install requirements

The following dependencies must be met in order to compile Accio:

  • Java JDK ≥ 8 is required to run both Bazel and Accio.
  • Bazel ≥ 0.11.0 is required to build Accio.
  • Node 3.9.5 is required if you want to develop Accio’s web interface.
  • Git is needed to keep Accio’s source code up-to-date.
  • Internet access is required to download dependencies both for Bazel and Accio.

Accio is compiled using the Bazel build tool. The Bazel documentation contains more information about how to install it on various platforms (Linux, macOS and Windows are supported).

2. Clone the Git repository

The source code is hosted inside a Git repository on GitHub. You need to install Git first, if it is not already done. You can directly clone the repository to get the latest version of the source code.

git clone git@github.com:privamov/accio.git
cd accio

All the development is done on the master branch, and releases are tagged. You can hence build a specific version:

git checkout v0.6.0 # Replace the version number with the one you target

3. Building with Bazel

Once your environment is set up, you may want to build Accio. Bazel is used to produce executable JAR files for Accio, which will appear in the bazel-bin/ folder. You can build the various components with the following commands:

bazel run @yarn//:yarn
bazel build accio/...

The first command is used to retrieve NPM dependencies (it is otherwise not done automatically, and the gateway will not compile), and the next command is used to compile all of Accio’s components.

Compile using Vagrant

If you have Vagrant and VirtualBox installed on your machine, you can launch a fully configured development environment via vagrant up. More on this is described in the dedicated page. The virtual machine that is created comes with all the needed tools to develop Accio.

The virtual machine is configured to the agent and the gateway processes as services. They are installed as standard systemd services (named accio-agent and accio-gateway), and may as such be controlled by using the standard systemctl command. For example, the agent can be restarted with the following command:

sudo systemctl restart accio-agent

Similarly, their logs can be accessed via the standard journalctl command. For example, the logs of the agent can be retrieved with the following command:

sudo journalctl -u accio-agent

Inside the virtual machine, all the code repository is mounted inside the /vagrant folder. However, to avoid altering files on your local computer, these files are later rsync’ed under /home/vagrant/accio, which is the actual workspace from which things will be built. You can manually sync the files by launching the update-sources utility. Note that some files are automatically excluded, such as bazel-* and .git directories. The systemd files (found in the repository under etc/vagrant/systemd) will also be synchronised, but the services will not be restarted.

In addition to the standard bazel command, the acciobuild utility is also available to help you work in the Vagrant environment. It automatically handles the synchronisation of sources, before actually calling Bazel and restarting the running components. acciobuild takes as argument a list of components to build, where each component may be one of: agent, gateway, executor, client or all. For example, the agent and the executor can be built with the following command:

acciobuild agent executor

Once the components are built, they are installed on the system, and the associated services are restarted (in the case of the agent and the gateway).

IDE integration

Bazel comes with an official plugin for IntelliJ, as well as some non-official plugins for other IDEs (such as Eclipse).