This Month in Reactive Graph! October 2024

Hello and welcome to another issue of This Month in Reactive Graph! Reactive Graph is a runtime empowering everyone to build reliable and efficient software. This is a monthly summary of its progress and community. Want something mentioned? Send us a pull request. Want to get involved? We love contributions.

This Month in Reactive Graph is openly developed on GitHub and archives can be viewed at this-month-in.reactive-graph.io. If you find any errors in this month's issue, please submit a PR.


Table of Contents


October 2024 was a very productive month for Reactive Graph. We focused on Continuous Integration and Delivery. The results are impressive:

Self Info

The Reactive Graph binary can now output information about itself. This includes the version number, the rust compiler version, the rust compiler channel, the target triple, and the git commit hash.

$ reactive-graph info
+---------+--------------------------+---------+------------------------------------------+---------------+---------------+
| version | target_triple            | git_tag | git_commit                               | rustc_channel | rustc_version |
+---------+--------------------------+---------+------------------------------------------+---------------+---------------+
| 0.10.0  | x86_64-unknown-linux-gnu |         | 7d8b37cf5549a12a4da5feff5184778d25110e62 | stable        | 1.82.0        |
+---------+--------------------------+---------+------------------------------------------+---------------+---------------+
$ reactive-graph info --output-format=json
[
  {
    "version": "0.10.0",
    "target_triple": "x86_64-unknown-linux-gnu",
    "git_tag": "",
    "git_commit": "7d8b37cf5549a12a4da5feff5184778d25110e62",
    "rustc_channel": "stable",
    "rustc_version": "1.82.0"
  }
]

Self Updater

What is probably most interesting for end users is that Reactive Graph now has the ability to update itself. Thanks to the Rust self_update library, implementation was relatively easy.

A new command has been implemented with which you can process the update:

$ reactive-graph update --help
Update the Reactive Graph binary

Usage: reactive-graph update [OPTIONS] [COMMAND]

Commands:
  info  Shows information about the selected release
  list  Lists the releases
  help  Print this message or the help of the given subcommand(s)

Options:
  -n, --nightly                 Updates to the nightly release
  -l, --latest                  Updates to the latest release. Currently, the latest release is the nightly release. This will change in the future
  -c, --current                 Updates to the current release
  -v, --version <VERSION>       Updates to a specific version
      --hide-download-progress  Hides the download progress
      --hide-output             Hides the output
  -q, --quiet                   Hides the download progress and the output
  -y, --no-confirm              Don't ask
  -h, --help                    Print help

You can use the subcommand info to find out which version would be updated to.

$ reactive-graph update info
+---------------+---------+------------+------------------------------------------+------------------------------------------+
| Release Name  | Version | Date       | Asset Name                               | Download URL                             |
+---------------+---------+------------+------------------------------------------+------------------------------------------+
| Nightly Build | nightly | 2024-10-29 | reactive-graph-nightly-x86_64-unknown-li | https://api.github.com/repos/reactive-gr |
|               |         |            | nux-gnu.tar.gz                           | aph/reactive-graph/releases/assets/20270 |
|               |         |            |                                          | 9875                                     |
+---------------+---------+------------+------------------------------------------+------------------------------------------+

As you can see, the nightly version would be installed. It also shows the name of the asset to be downloaded and from which URL the download would occur.

If you finally want to carry out the update, you can do this with the command:

$ reactive-graph update
Checking target-arch... x86_64-unknown-linux-gnu
Checking current version... v0.10.0
Looking for tag: nightly

reactive-graph release status:
  * Current exe: "/home/user/.cargo/bin/reactive-graph"
  * New exe release: "reactive-graph-nightly-x86_64-unknown-linux-gnu.tar.gz"
  * New exe download url: "https://api.github.com/repos/reactive-graph/reactive-graph/releases/assets/202709875"

The new release will be downloaded/extracted and the existing binary will be replaced.
Do you want to continue? [Y/n] Y
Downloading...
[00:00:02] [====================>-------------------] 19.41 MiB/37.41 MiB (3s)  
Extracting archive... Done
Replacing binary file... Done
Successfully updated to version: nightly

You can use the --no-confirm option to ensure that the update is carried out without query.

Specify the version to update to

OptionDescription
--latestUpdates to the latest release. Currently, the latest release is the nightly release. This will change in the future.
--nightlyUpdates to the nightly release
--version 0.10.0-alpha-2Updates to a specific version

List of releases

You can find out which releases are available from the shell. These version numbers can be used with the --version option to install a specific version of Reactive Graph.

$ reactive-graph update list
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| Release Name    | Version        | Date       | Asset Name                               | Download URL                             |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| Nightly Build   | nightly        | 2024-10-29 | reactive-graph-nightly-x86_64-unknown-li | https://api.github.com/repos/reactive-gr |
|                 |                |            | nux-gnu.tar.gz                           | aph/reactive-graph/releases/assets/20270 |
|                 |                |            |                                          | 9875                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.10.0-alpha-2 | 0.10.0-alpha-2 | 2024-10-27 | reactive-graph-v0.10.0-alpha-2-x86_64-un | https://api.github.com/repos/reactive-gr |
|                 |                |            | known-linux-gnu.tar.gz                   | aph/reactive-graph/releases/assets/20211 |
|                 |                |            |                                          | 3533                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.10.0-alpha-1 | 0.10.0-alpha-1 | 2024-10-20 | reactive-graph-v0.10.0-alpha-1-x86_64-un | https://api.github.com/repos/reactive-gr |
|                 |                |            | known-linux-gnu.tar.gz                   | aph/reactive-graph/releases/assets/20031 |
|                 |                |            |                                          | 6307                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.9.1-25       | 0.9.1-25       | 2023-07-20 | inexor-rgf-rt-standalone-x86_64-unknown- | https://api.github.com/repos/reactive-gr |
|                 |                |            | linux-gnu.tar.gz                         | aph/reactive-graph/releases/assets/11789 |
|                 |                |            |                                          | 6809                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.9.1-22       | 0.9.1-22       | 2023-05-12 | inexor-rgf-rt-standalone-x86_64-unknown- | https://api.github.com/repos/reactive-gr |
|                 |                |            | linux-gnu.tar.gz                         | aph/reactive-graph/releases/assets/10790 |
|                 |                |            |                                          | 4471                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
|                 | 0.9.1-3        | 2023-05-07 | Not available                            |                                          |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.9.1          | 0.9.1          | 2023-05-01 | inexor-rgf-rt-standalone-x86_64-unknown- | https://api.github.com/repos/reactive-gr |
|                 |                |            | linux-gnu.tar.gz                         | aph/reactive-graph/releases/assets/10621 |
|                 |                |            |                                          | 6527                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.9.0-15       | 0.9.0-15       | 2023-05-01 | inexor-rgf-rt-standalone-x86_64-unknown- | https://api.github.com/repos/reactive-gr |
|                 |                |            | linux-gnu.tar.gz                         | aph/reactive-graph/releases/assets/10621 |
|                 |                |            |                                          | 3683                                     |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+
| v0.2.1-alpha    | 0.2.1-alpha    | 2021-08-29 | Not available                            |                                          |
+-----------------+----------------+------------+------------------------------------------+------------------------------------------+

Improved Release Process and Distribution Channels

In order for the self-updater to be useful, the release and distribution process needed to be improved. With the improved release process, different types of releases are now produced and distributed via a number of channels:

ChannelDescriptionStatus
SourceThe source code is available for download for each release.Done
Binary PackagesBinary packages are produced for each release. The binary distributions can be downloaded manually. See below for expanded support of supported platforms.Done
Self UpdaterThe self-updater is based on the binary distributions.Done
Debian PackagesDebian packages are produced for each release. The Debian packages can be downloaded manually.Done
DockerDocker images are produced for each release. The Docker images are uploaded to ghcr.io and can be obtained from there.Done
Website DownloadIn the future, every release should be available for download via the website.Planned
crates.ioIn the future, every regular release should be published on crates.io.Planned
APTIn the future, each release's Debian packages should be available via an APT repository.Planned

In the following graphic you can see the process of a release.

A submitted pull request can only be merged if a number of prerequisites are met:

  1. The code compiles under Rust Stable and Rust Nightly.
  2. The code compiles on Linux, Windows and MacOSx.
  3. Code Formatting is equivalent to automatic formatting.
  4. The minimum Rust compiler version has not increased.
  5. There are no warnings from the linter.

After the merge, the checks are also repeated on the main branch and if successful, release builds and Docker builds are triggered.

flowchart LR
    A@{ shape: circle, label: "Start" }
    PR[Pull Request]
    CI[CI Build an <code>main</code> Branch]
    Release[Release Build]
    DB[Docker Build]
    NBin@{ shape: doc, label: "Nightly Binary Package" }
    RBin@{ shape: doc, label: "Release Binary Package" }
    NDeb@{ shape: doc, label: "Nightly Debian Package" }
    RDeb@{ shape: doc, label: "Release Debian Package" }
    NDI@{ shape: doc, label: "Nightly Docker Image" }
    RDI@{ shape: doc, label: "Release Docker Image" }

    A-- created PR -->PR
    PR-- merge into main -->CI
    CI-- successful -->Release
    Release --> NBin
    Release-- <code>release tag</code> -->RBin
    Release --> NDeb
    Release-- <code>release tag</code> -->RDeb
    CI-- successful -->DB
    CI-- successful -->DB
    DB-->NDI
    DB-- <code>release tag</code> -->RDI

Nightly Builds

What's new is that the release process produces nightly builds. This happens with every merge to the main branch. The existing nightly release is updated, the Git tag nightly is moved to the latest commit and finally new binary packages, new Debian packages and new Docker images are produced.

We won't produce regular releases often in the near future because we can't guarantee compatibility yet. Instead, the constantly updated nightly releases are available.

Warning!

At this point, the software is not yet feature-complete and essential features are still missing, such as the flow editor, the persistence of the type system and instance system, and an authorization layer.


Platform Support

Rust is a compiled language. If the software should be able to run on different systems, we should ensure this during development. Reactive Graph has various application areas that go beyond the classic desktop system. For example, Reactive-Graph for smart home applications should run on a Raspberry Pi. This has an ARM processor.

Fortunately, Rust supports cross-compiling for other CPU and OS platforms. This month we added some new CPU architectures to continuous integration and are producing binary packages and Debian packages for all of these platforms.

This is the updated list of supported platforms:

targetNewDescriptionTier
x86_64-unknown-linux-gnu64-bit Linux (kernel 3.2+, glibc 2.17+)1
x86_64-pc-windows-msvc64-bit MSVC (Windows 10+, Windows Server 2016+)1
aarch64-apple-darwinARM64 macOS (11.0+, Big Sur+)1
x86_64-apple-darwin64-bit macOS (10.12+, Sierra+)1
universal-apple-darwin
aarch64-unknown-linux-gnuARM64 Linux (kernel 4.1, glibc 2.17+)1
aarch64-unknown-linux-muslYesARM64 Linux with musl 1.2.32
armv7-unknown-linux-gnueabihfYesArmv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)2
armv7-unknown-linux-musleabihfYesArmv7-A Linux, hardfloat (kernel 3.2, glibc 2.17)2
i686-unknown-linux-gnuYes32-bit Linux (kernel 3.2+, glibc 2.17+)1
powerpc-unknown-linux-gnuYesPowerPC Linux (kernel 3.2, glibc 2.17)2
powerpc64-unknown-linux-gnuYesPPC64 Linux (kernel 3.2, glibc 2.17)2
powerpc64le-unknown-linux-gnuYesPPC64LE Linux (kernel 3.10, glibc 2.17)2
riscv64gc-unknown-linux-gnuYesRISC-V Linux (kernel 4.20, glibc 2.29)2
x86_64-pc-windows-gnuYes64-bit MinGW (Windows 10+, Windows Server 2016+)1
x86_64-unknown-linux-muslYes64-bit Linux with musl 1.2.32

Docker

Furthermore, the first Docker images are now available for both regular releases and as nightly builds. The Docker images are available via GitHub Packages (i.e. via ghcr.io).

Run

$ docker run -d -p 31415:31415 --name reactive-graph ghcr.io/reactive-graph/reactive-graph:latest
85b3a6868f4bc91e336fb1033d349b70c48b207f0122b5284f77002bae2894c4
$ docker ps
CONTAINER ID   IMAGE                                          COMMAND              CREATED              STATUS              PORTS                                           NAMES                                                                                                                                                   │
85b3a6868f4b   ghcr.io/reactive-graph/reactive-graph:latest   "./reactive-graph"   13 seconds ago       Up 12 seconds       0.0.0.0:31415->31415/tcp, :::31415->31415/tcp   reactive-graph
$ docker stop 85b3a6868f4b
85b3a6868f4b

Multiple Instances

It is possible to run multiple instances of Reactive Graph in parallel. All you have to do is bind another port on the host system.

$ docker run -d -p 31416:31415 --name reactive-graph-2 ghcr.io/reactive-graph/reactive-graph:latest
7f689869a76df29179478d74872c6d6b4c9d144415bd3fc9d16225ecf8ae8f62
$ docker ps
CONTAINER ID   IMAGE                                          COMMAND              CREATED              STATUS              PORTS                                           NAMES
85b3a6868f4b   ghcr.io/reactive-graph/reactive-graph:latest   "./reactive-graph"   13 seconds ago       Up 12 seconds       0.0.0.0:31415->31415/tcp, :::31415->31415/tcp   reactive-graph
7f689869a76d   ghcr.io/reactive-graph/reactive-graph:latest   "./reactive-graph"   53 seconds ago       Up 52 seconds       0.0.0.0:31417->31415/tcp, :::31417->31415/tcp   reactive-graph-2

Dockerfile

FROM alpine as reactive-graph
RUN apk add zsh nano curl
WORKDIR /opt/reactive-graph
COPY --from=builder --chown=reactive-graph:reactive-graph /app/target/release/reactive-graph .
RUN addgroup --gid 1000 reactive-graph
RUN adduser -h /opt/reactive-graph -s /bin/bash -G reactive-graph -u 1000 -D reactive-graph
USER reactive-graph
RUN ./reactive-graph instances init --uid 1000 --gid 1000
RUN ./reactive-graph instances config graphql --hostname "0.0.0.0" --secure true
RUN ./reactive-graph instances config instance --instance-name "Reactive Graph" --instance-description "Docker"
ENV PATH="$PATH:/opt/reactive-graph"
EXPOSE 31415

Debian Packages

More platforms are now supported. Debian packages are also provided for regular releases and as nightly builds. The new folder structure is now taken into account.

Debian PackageDebian TargetRust Target
reactive-graph_0.10.0-nightly_amd64.debamd64x86_64-unknown-linux-gnu
reactive-graph_0.10.0-nightly_arm64.debarm64aarch64-unknown-linux-gnu
reactive-graph_0.10.0-nightly_armhf.debarmhfarmv7-unknown-linux-gnueabihf
reactive-graph_0.10.0-nightly_i386.debi386i686-unknown-linux-gnu
reactive-graph_0.10.0-nightly_powerpc.debpowerpcpowerpc-unknown-linux-gnu
reactive-graph_0.10.0-nightly_ppc64.debppc64powerpc-unknown-linux-gnu
reactive-graph_0.10.0-nightly_ppc64el.debppc64elpowerpc64le-unknown-linux-gnu
reactive-graph_0.10.0-nightly_riscv64.debriscv64riscv64gc-unknown-linux-gnu

CLI Instance Management

Instance Initialization

The Dockerfile benefits from another new feature: The Reactive Graph Binary can now initialize a folder structure for new instances.

$ reactive-graph instances init --uid 1000 --gid 1000
Created ./config
Created ./log
Created ./keys
Created ./plugins/deploy
Created ./plugins/installed
Created ./repositories
Created ./repositories/default/types/components
Created ./repositories/default/types/entities
Created ./repositories/default/types/relations
Created ./repositories/default/types/flows
Created ./repositories/default/instances/entities
Created ./repositories/default/instances/relations
Created ./repositories/default/instances/flows
Wrote file ./config/flow_locations.toml
Wrote file ./config/graphql.toml
Wrote file ./config/instance.toml
Wrote file ./config/logging.toml
Wrote file ./config/plugins.toml
Wrote file ./config/remotes.toml
Created file ./log/reactive-graph.log
Created file ./log/reactive-graph.error.log

Configure Instances via CLI

Another feature is that you can set or overwrite configurations using a command.

$ reactive-graph instances config graphql --hostname "0.0.0.0" --secure true
(no output)

Continuous Integration


Book

Redesigned the book using the design library