Skip to content

Installing sconectl

sconectl is a command line utility similar to kubectl. It executes on your development machine. It executes commands like apply -f manifest inside of a container.

Note

Right now, we assume that sconectl executes on MacOs or Linux machine. For Windows, please use a Linux VM. Moreover, we assume that you have docker installed. In future, we plan to support Windows natively and replace docker by podman.

As part of our scone_mesh_tutorial, you can execute script check_prerequisites.sh to check if you have all prerequisites. It will also install sconectl if needed but only if some of the required dependencies are already installed. In case you already cloned scone_mesh_tutorial, just execute in your cloned copy:

./check_prerequisites.sh

Manual Installation

We have implemented sconectl in Rust. In case, you have Rust already installed, you can install sconectl by executing:

cargo install sconectl

In case, you have not yet installed cargo, you need to install Rust (see below).

Installing Dependencies

You could run the following script to set up / update your rust environment and to install sconectl with the help of Rust:

#! /bin/bash

set -e  -x

# ensure we have access to sconectl

if ! command -v sconectl &> /dev/null
then
    echo "No sconectl found! Installing sconectl!"

    # ensure we have access to a new Rust installation

    if ! command -v rustup &> /dev/null
    then
        echo "No Rust found! Installing Rust!"
        curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    else
        echo "Ensuring Rust is up to date"
        rustup update
    fi

    cargo install sconectl
fi

Rust Installation

In case you install manually, errors might appear since Rust is not installed or out-of-date. If cargo would fail, ensure that

  • you have Rust installed on your system. and
  • it is up-to-date (you might get syntax errors if your Rust installation is old).

If Rust is not yet installed or too old, you can use rustup to install Rust.

Checking sconectl

Depending what Manifest you apply, different command line options might be available. To get a list of options, for a given manifest, you can execute:

sconectl apply -f service.yml --help

Note that a file service.yml is available as part of scone_mesh_tutorial.

You can print which environment variables you can define and also their default values by executing:

sconectl apply -f service.yml -p

Building a Service Image

We can now apply a manifest as follows (and we do not want to push to the repo just yet):

sconectl apply -f service.yml --no-push

Displaying Environment Variables

We can show which variables must be defined in a meshfile using option -p:

sconectl apply -f mesh.yml -p