See upstream's README.
This fork of rcloud provides an updated and reproducible build system targeted to Debian 12 Bookworm with tools to make it easier to develop and test enhancements to rcloud as well as to deploy it.
First, install Zig version 0.14.0 or later and all system requirements needed to build.
Alternatively, if you have the Nix package manager installed:
nix develop
Then:
zig build
The build will complete in about 3 minutes. Then:
cd zig-out
conf/start2
# to stop the servers:
conf/stop
NOTE: this step can be skipped if you use the Docker Compose build instead.
The build system requires Zig version 0.14.0 or later. You can download it from Ziglang or use the provided download script which is used to build our Docker container. The script must be run from the project root directory, because the download script expects a zig/ subdirectory to already exist from your current working directory:
zig/download.sh 0.14.0
This will download and extract the latest 0.14.0 pre-release build and install it in the zig/ directory. You can add that directory to your path, or simply run the zig executable by specifying its full path. Zig will find its library based on the executable's location, not your path.
A multi-container version of RCloud incorporating all the key components can be built and run using docker compose. This is currently the preferred way to test RCloud.
Build the images:
docker compose build
Run the images:
docker compose up
To stop the containers, send a Control-C. To edit code and see the
effects, save the edits, then perform docker compose build
and
docker compose up
again. To clean up images (but not data), perform
docker compose down
.
Data is persisted between sessions within Docker volumes. The docker compose configuration can be examined at compose.yaml.
- Complete a
zig build
as usual. This step will add anassets
directory tozig-out
. - Run
zig build dist-fat -Dassets=zig-out/assets
. This will generate a tarballrcloud-full-{version}.tar.gz
inzig-out
. - Transfer the file to another machine and extract it there.
- Run
zig build -Dassets=zig-out/assets
to build without a network.
Note that you will need Zig (as well as all system requirements) on the offline machine since you are still building from source. Simply packing the zig/ directory and unpacking it on the other machine is sufficient to have a working Zig installation.
zig build dist
This will create zig-out/rcloud-{version}.tar.gz
.
The build system automatically discovers new R package dependencies by recursively walking the top-level package directories and examining the DESCRIPTION files. It then queries the configured package repositories for the latest versions available which satisfy any version constraints expressed in the package definitions.
zig build update
will perform this process and rewrite build-aux/config.json
. If any
package has been updated or added, its hash will initially be set to
the empty string. The first time zig build
is run, a warning will be
echoed to the console to indicate that the hash is being updated.