Skip to content

Commit 36ed4aa

Browse files
authored
Merge pull request #240 from jumpstarter-dev/update-docs
Update Documentation to Reflect Refactoring
2 parents 1025017 + eb1e117 commit 36ed4aa

19 files changed

+508
-138
lines changed

docs/source/cli/getting-started.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,21 @@
11
# Getting Started
22

3-
Jumpstarter provides the following command line tools:
3+
To simplify the management and operation of Jumpstarter, we provide several command-line tools for different use cases. These CLI tools can also be installed together through the `jmpstarter-cli` package and accessed using the `jmp` command for simplicity.
44

5-
An **admin CLI** tool called `jmpctl`, which is useful for the administration of exporters and
6-
clients in the distributed service. Installation instructions can be found [here](../installation/service-cli.md).
5+
Each tool can also be installed separately for users who want to reduce the dependencies on their developer machine or an embedded exporter with limited available resources.
76

8-
A **client CLI** called `jmp`, you can use it to interact with your connected
9-
hardware, request leases, write tests, and develop custom drivers for your hardware.
7+
## Admin CLI `jmp-admin`
108

11-
A **exporter CLI** called `jmp-exporter`, you can use it to manage local exporter
12-
configurations, and run transient or persistent exporter instances.
9+
The `jmp-admin` or `jmp admin` CLI allows administration of exporters and clients
10+
in a Kubernetes cluster. To use this CLI, you must have a valid `kubeconfig` and
11+
access to the cluter/namespace where the Jumpstarter controller resides.
1312

14-
The `jmp` and `jmp-exporter` CLI tools are available as part of the `jumpstarter` Python package.
15-
You can learn how to install this package [here](../installation/python-package.md),
16-
but it is also available as a container image
17-
```{code-block}
18-
:substitutions:
19-
quay.io/jumpstarter-dev/jumpstarter:{{version}}
20-
```
13+
## Client CLI `jmp-client`
2114

22-
To check if you have the client CLI installed, run:
15+
The `jmp-client` or `jmp client` CLI allows interaction with Jumpstarter clients
16+
and the management of client configs.
2317

24-
```bash
25-
$ jmp version
26-
```
18+
## Exporter CLI `jmp-exporter`
19+
20+
The `jmp-exporter` or `jmp exporter` CLI allows you to run Jumpstarter exporters
21+
and management of exporter configs.

docs/source/getting-started/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This section provides getting started guide to help you set up Jumpstarter to
44
test your software on real hardware.
55

66
```{toctree}
7-
setup-local-client.md
8-
setup-exporter.md
9-
setup-controller.md
7+
setup-local-exporter.md
8+
setup-exporter-client.md
109
```

docs/source/getting-started/setup-controller.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
# Setup a Remote Exporter/Client
2+
3+
This guide walks you through the process of creating an exporter using the
4+
controller service, configuring drivers, and running the exporter.
5+
6+
## Prerequisites
7+
8+
Make sure the following packages are installed in your Python environment:
9+
- `jumpstarter-cli` - The core Jumpstarter CLI.
10+
- `jumpstarter-driver-opendal` - The OpenDAL storage driver.
11+
- `jumpstarter-driver-power` - The base power driver.
12+
13+
You should also have the [Jumpstarter Service](../introduction/service.md)
14+
running in a Kubernetes cluster you have admin access to.
15+
For instructions on how to install Jumpstarter in a cluster,
16+
refer to the [installation guide](../installation/service/index.md).
17+
18+
```{tip}
19+
Make sure you have the correct cluster in your `kubeconfig` file and the right
20+
context selected.
21+
```
22+
23+
## Create an Exporter
24+
25+
First, we must create an exporter using the controller service API.
26+
The `jmp admin` CLI provides methods to interact with the controller directly.
27+
28+
To create an exporter and save the config locally, run the following command:
29+
30+
```bash
31+
# Creates an exporter called "testing" and saves the config
32+
$ jmp admin create exporter testing --save
33+
34+
# Usage for jmp admin create exporter
35+
$ jmp admin create exporter
36+
--help
37+
Usage: jmp admin create exporter [OPTIONS] [NAME]
38+
39+
Create an exporter object in the Kubernetes cluster
40+
41+
Options:
42+
-s, --save Save the config file for the created exporter.
43+
-o, --out FILE Specify an output file for the exporter config.
44+
-n, --namespace TEXT Kubernetes namespace to use
45+
--kubeconfig FILENAME path to the kubeconfig file
46+
--context TEXT Kubernetes context to use
47+
--help Show this message and exit.
48+
```
49+
50+
### Edit the Exporter Config
51+
52+
Once the exporter has been created, a new config file will be saved to
53+
`/etc/jumpstarter/exporters/testing.yaml`.
54+
55+
To edit the config file with your default text editor, run the following command:
56+
57+
```bash
58+
# Opens the config for "testing" in your default editor
59+
$ jmp exporter edit-config testing
60+
```
61+
62+
Add the `storage` and `power` drivers under the `export` field in the config file.
63+
The finished config should look like this:
64+
65+
```yaml
66+
# /etc/jumpstarter/exporters/testing.yaml
67+
apiVersion: jumpstarter.dev/v1alpha1
68+
kind: ExporterConfig
69+
# These values are automatically filled by the controller
70+
endpoint: "..."
71+
token: "..."
72+
# Mock drivers for demo purpose
73+
export:
74+
storage:
75+
type: jumpstarter_driver_opendal.driver.MockStorageMux
76+
power:
77+
type: jumpstarter_driver_power.driver.MockPower
78+
```
79+
80+
## Run an Exporter
81+
82+
To run the exporter locally, we can use the `jmp exporter` CLI tool.
83+
84+
Run the following command to start the exporter locally using the config file:
85+
86+
```bash
87+
# Runs the exporter "testing" locally
88+
$ jmp exporter run testing
89+
```
90+
91+
The exporter will stay running until the process is exited via `^C` or the shell
92+
is closed.
93+
94+
## Create a Client
95+
96+
To connect to the new exporter, a client must be created. We can also use the
97+
`jmp admin` CLI tool to create a client using the controller.
98+
99+
```bash
100+
# This will create a client called "hello", allow unsafe drivers, and save the config
101+
$ jmp admin create client hello --save --unsafe
102+
103+
# Usage for jmp admin create client
104+
jmp admin create client --help
105+
Usage: jmp admin create client [OPTIONS] [NAME]
106+
107+
Create a client object in the Kubernetes cluster
108+
109+
Options:
110+
-s, --save Save the config file for the created client.
111+
-a, --allow TEXT A comma-separated list of driver client packages to
112+
load.
113+
--unsafe Should all driver client packages be allowed to load
114+
(UNSAFE!).
115+
-o, --out FILE Specify an output file for the client config.
116+
-n, --namespace TEXT Kubernetes namespace to use
117+
--kubeconfig FILENAME path to the kubeconfig file
118+
--context TEXT Kubernetes context to use
119+
--help Show this message and exit.
120+
```
121+
122+
## Connect to the Exporter
123+
124+
To interact with the exporter we created above, we can use the
125+
"client shell" functionality within the `jmp` CLI. When a shell is spawned,
126+
the client attempts to acquire a lease on an exporter. Once the lease is acquired,
127+
the client can be interacted with through the magic `j` command or via the
128+
Python API.
129+
130+
```bash
131+
# Spawn a shell using the "hello" client
132+
$ jmp client shell hello
133+
134+
# Usage for jmp client shell
135+
$ jmp client shell --help
136+
Usage: jmp client shell [OPTIONS] [NAME]
137+
138+
Spawns a shell connecting to a leased remote exporter
139+
140+
Options:
141+
-l, --label <TEXT TEXT>...
142+
-n, --lease TEXT
143+
--help Show this message and exit.
144+
```
145+
146+
Once a lease is acquired, we can interact with the drivers hosted by the exporter
147+
within the shell instance.
148+
149+
```bash
150+
# Spawn a shell using the "hello" client
151+
$ jmp client shell hello
152+
153+
# Running inside client shell
154+
$ j
155+
Usage: j [OPTIONS] COMMAND [ARGS]...
156+
157+
Generic composite device
158+
159+
Options:
160+
--help Show this message and exit.
161+
162+
Commands:
163+
power Generic power
164+
storage Generic storage mux
165+
166+
# Simulate turning on the power
167+
$ j power on
168+
ok
169+
170+
# Exit the shell
171+
$ exit
172+
```

docs/source/getting-started/setup-exporter.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/source/getting-started/setup-local-client.md

Lines changed: 0 additions & 65 deletions
This file was deleted.

0 commit comments

Comments
 (0)