Rust-powered message forwarder for inter-process communication.
Set the build profile you prefer. Available options:
- debug
- release
PROFILE=release
# PROFILE=debug
task data-plane:build PROFILE=${PROFILE}This will build a local binary of SLIM.
To run a multiarch image of SLIM (linux/arm64 & linux/amd64):
REPO_ROOT="$(git rev-parse --show-toplevel)"
docker build -t slim -f "${REPO_ROOT}/data-plane/Dockerfile" --platform linux/amd64,linux/arm64 "${REPO_ROOT}"Or alternatively, with docker buildx bake:
pushd $(git rev-parse --show-toplevel) && IMAGE_REPO=slim IMAGE_TAG=latest docker buildx bake slim && popdThe container image build process was tested on:
- Windows 10 + Hyper-V
- windows 11 + WSL 2
The instructions below assume Powershell 7 environment.
$env:REPO_ROOT = "<path-to-repo>"Example:
$env:REPO_ROOT = "C:\Users\<dummy>\slim"To convert line endings in VSCode from CRLF (Windows-style) to LF (Unix-style), follow these steps:
- Open the Dockerfile (or any file you want to convert) in VSCode.
- Look at the bottom-right corner of the VSCode window.
- You should see something like
CRLF(Carriage Return + Line Feed). - Click on
CRLF, and a small menu will appear. - Select LF (Line Feed) from the menu.
- Save the file (
Ctrl + SorCmd + Son Mac).
Notice that there is no arm64 on the command below, otherwise it will fail even if using buildx.
docker buildx build `
-t slim `
-f "$env:REPO_ROOT\data-plane\Dockerfile" `
--platform linux/amd64 `
"$env:REPO_ROOT"If everything goes well you should see an output similar to:
...
=> => naming to docker.io/library/slim:latest 0.0s
=> => unpacking to docker.io/library/slim:latestSLIM can be run in 2 main ways:
- directly as binary (preferred way when deployed as workload in k8s)
- via the bindings APIs
SLIM can run in server mode, in client mode or both (i.e. spawning a server and connecting to another SLIM instance at the same time).
To run SLIM binary as server, a configuration file is needed to setup the basic runtime options. Some basic examples are provided in the config folder:
- reference is a reference configuration, with comments explaining all the available options.
- base is a base configuration for a server without encryption and authentication.
- tls is a configuration for a server with encryption enabled, with no authentication.
- basic-auth is a configuration for a server with encryption and basic auth enabled.
- mtls is a configuration for a server expecting clients to authenticate with a trusted certificate.
To run SLIM as server:
MODE=base
# MODE=tls
# MODE=basic-auth; export PASSWORD=12345 # Unix/Linux/macOS
# MODE=basic-auth; $env:PASSWORD = "12345" # Windows PowerShell
# MODE=mtls
cargo run --bin slim -- --config ./config/${MODE}/server-config.yamlOr, using the container image (assuming the image name is
slim):
docker run -it \
-e PASSWORD=${PASSWORD} \
-v ./config/base/server-config.yaml:/config.yaml \
slim /slim --config /config.yamlTo run the SLIM binary as client, you will need to configure it to start one (or more) clients at startup, and you will need to provide the address of a remote SLIM server. As usually, some configuration examples are available in the config folder:
- reference is a reference configuration, with comments explaining all the available options.
- base is a base configuration for a client without encryption and authentication.
- tls is a configuration for a client with encryption enabled, with no authentication.
- basic-auth is a configuration for a client with encryption and basic auth enabled.
- mtls is a configuration for a client connecting to a server with a trusted certificate.
To run SLIM as client:
MODE=base
# MODE=tls
# MODE=basic-auth; export PASSWORD=12345 # Unix/Linux/macOS
# MODE=basic-auth; $env:PASSWORD = "12345" # Windows PowerShell
# MODE=mtls
cargo run --bin slim -- --config ./config/${MODE}/client-config.yamlOr, using the container image (assuming the image name is
slim):
docker run -it \
-e PASSWORD=${PASSWORD} \
-v ./config/base/client-config.yaml:/config.yaml \
slim /slim --config /config.yamlRun the core Rust tests:
task data-plane:testRun the linter for Rust code:
task data-plane:lintThis will run linting on both the Rust workspace and language bindings.