Getting started
Prerequisites
Our worker component, Riklet, is currently only available for Linux systems with a x86_64 architecture.
Install packages required to build the project:
- Ubuntu:
sudo apt update && sudo apt install libssl-dev protobuf-compiler
- Fedora:
sudo dnf update && sudo dnf install openssl-devel protobuf-compiler protobuf-devel
Clone the project
Start by cloning the project using Git:
git clone https://github.com/rik-org/rik.git
Start a cluster
Using Docker
docker compose up
Build from source
Be aware that each component of the project is a separate binary, and that you need to execute them in a specific order.
Build all components of the project
cargo build --release
Start the scheduler in a terminal
cargo run --release --bin scheduler
Start the controller in a terminal
DATABASE_LOCATION=~/.rik/data cargo run --release --bin controller
Start the worker in a terminal
sudo ./target/release/riklet
If you experience any issue, please refer to the troubleshooting, if you can't find a solution, please open an issue.
Create your first workload
Create a definition of your workload
Create a workload using example in examples/workload-1.json
:
# Create an alpine container workload
RIKCONFIG=docs/src/examples/config.json cargo run \
--bin rikctl -- create workload \
--file docs/src/examples/workloads/workload-1.json
# The ID of the workload is returned, it will be useful next
# Workload alpine has been successfully created with ID : "0e4c1da4-0277-4088-9f37-8f445cbe8e46"
Deploy an instance
Based on your workload ID you can now deploy an instance:
# Please replace the following value with the ID of your workload
export WORKLOAD_ID=0e4c1da4-0277-4088-9f37-8f445cbe8e46
RIKCONFIG=docs/src/examples/config.json cargo run \
--bin rikctl -- create instance \
--workload-id ${WORKLOAD_ID}
Check your instance
You should now see your instance running:
RIKCONFIG=examples/config.json cargo run \
--bin rikctl -- get instances
Configuration
You can configure a remote cluster by setting the RIKCONFIG
environment variable
to the path of a configuration file. Here is an example of configuration:
{
"cluster": {
"name": "default",
"server": "http://127.0.0.1:5000"
}
}