Skip to content

Commit 3e9055a

Browse files
committed
Add how-to for installing Commodore with uv
1 parent ad7b3f3 commit 3e9055a

3 files changed

Lines changed: 98 additions & 3 deletions

File tree

docs/modules/ROOT/pages/explanation/running-commodore.adoc

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
= Running Commodore
22

3+
TIP: See xref:how-to/installing-commodore.adoc[] for the recommended installation with https://docs.astral.sh/uv[`uv`].
4+
35
Commodore is written in Python and it requires external dependencies.
46
We provide Commodore as a container image and a Python package on PyPI.
57

@@ -17,6 +19,7 @@ We recommend that you use the Commodore Python package provided on PyPI to make
1719

1820
=== Prerequisites
1921

22+
* `git`
2023
* A Python version between 3.10 and 3.12 as `python3` and the Python `venv` module.
2124
We recommend that you install Python and the `venv` module with your preferred package manager.
2225
* Additionally, a few of the Commodore Python package dependencies require a working C compiler, the Python 3 development package, and the FFI development package.
@@ -32,10 +35,11 @@ Please check your operating system's documentation for instructions to setup a w
3235
Versions >= 5 are recommended.
3336
https://kubectl.docs.kubernetes.io/installation/kustomize/[Installation instructions]
3437

35-
[IMPORTANT]
38+
[NOTE]
3639
====
37-
Other documentation assumes that Helm 3 is available as `helm` and `helm3`, and Helm 2 is available as `helm2` in `$PATH`.
38-
Please make sure you setup the Helm binaries accordingly on your local system.
40+
Some older documentation assumes that Helm 3 is available as `helm` and `helm3`, and Helm 2 is available as `helm2` in `$PATH`.
41+
42+
If you still need `helm2` for some reason, we recommend this approach.
3943
====
4044

4145
=== Installation
@@ -56,6 +60,13 @@ This command should report something like
5660
----
5761
Python 3.12.7
5862
----
63+
+
64+
[IMPORTANT]
65+
====
66+
Make sure that you use a Python version that's supported by Commodore for the following steps.
67+
68+
Check your system's documentation on how to install additional Python versions.
69+
====
5970

6071
. Create a virtualenv in `~/.local/commodore-venv`
6172
+
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
= Installing Commodore
2+
3+
Commodore is written in Python and requires external dependencies.
4+
We provide Commodore as a https://pypi.org/project/syn-commodore[Python package on PyPI] and as a https://hub.docker.com/r/projectsyn/commodore[container image].
5+
6+
Commodore interacts with Git repositories that might require authorization.
7+
For this to work, Commodore needs to have access to an authorized SSH key.
8+
9+
We recommend using https://docs.astral.sh/uv/[`uv`] to install the Commodore python package from PyPI.
10+
`uv tool` makes installing and updating Python tools very simple and handles managing Python versions and virtualenvs transparently.
11+
See the https://docs.astral.sh/uv/concepts/tools/[upstream documentation] for more details.
12+
13+
TIP: See the extended xref:explanation/running-commodore.adoc[Running Commodore] explanation for a generic PyPI installation in a user-managed virtualenv and for instructions on how to run the container image locally.
14+
15+
== Prerequisites
16+
17+
* `git`
18+
* `uv`.
19+
Please check the https://docs.astral.sh/uv/getting-started/installation/[uv installation instructions] for installing `uv` on your system.
20+
This installation guide uses `uv` to install a `python3` version that's supported by Commodore if your system's default Python version isn't compatible with Commodore.
21+
* A few of the Commodore Python package dependencies require a working C compiler, the Python 3 development package, and the FFI development package.
22+
On Linux distributions you'll want packages `python3-dev` or `python3-devel` and `libffi-dev` or `libffi-devel` respectively.
23+
Please refer to your operating system's documentation for instructions to setup a working C compiler.
24+
* Installing the `gojsonnet` Python package may require a working Go compiler on some operating systems.
25+
gojsonnet 0.21 and newer (Commodore v1.27.6 and newer) are available as prebuilt wheels for Linux and macOS.
26+
Please check your operating system's documentation for instructions to setup a working Go compiler.
27+
* On some Linux distributions, you may need to install the Python `wheel` package manually.
28+
29+
== Installation with `uv`
30+
31+
. Install Commodore as a tool with `uv tool`
32+
+
33+
[source,bash]
34+
----
35+
uv tool install --python=python3.12 --python-preference=system syn-commodore
36+
----
37+
+
38+
[TIP]
39+
====
40+
Commodore currently only supports Python 3.10 - Python 3.12.
41+
42+
This command will prefer using your system's version of Python 3.12.
43+
However, `uv` will download a copy of Python 3.12 if `python3.12` isn't available on your system.
44+
45+
If you'd prefer to use your system's `python3.10` or `python3.11` you can adjust the command accordingly.
46+
====
47+
+
48+
[TIP]
49+
====
50+
`uv` creates symlinks for installed tools in `~/.local/bin`.
51+
We recommend that you add that directory to your `$PATH` variable if your system doesn't do so out of the box.
52+
====
53+
54+
. Verify that `commodore` is available in your `$PATH`
55+
+
56+
[source,bash]
57+
----
58+
commodore version
59+
----
60+
61+
. Install all the required external tools (`helm`, `jb`, and `kustomize`)
62+
+
63+
[source,bash]
64+
----
65+
commodore tool install --missing
66+
----
67+
+
68+
[TIP]
69+
====
70+
This command installs the required external tools in `$XDG_CACHE_HOME/commodore/tools`.
71+
This defaults to `$HOME/.cache/commodore/tools` if you've not customized the `$XDG_CACHE_HOME` environment variable.
72+
73+
If you want, you can add that directory to your `$PATH` so that you can always use the Commodore-managed copies of `helm`, `jb` and `kustomize`.
74+
====
75+
76+
== Upgrade with `uv`
77+
78+
. Upgrade your Commodore installation to the latest published version
79+
+
80+
[source,bash]
81+
----
82+
uv tool upgrade syn-commodore
83+
----
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
* xref:commodore:ROOT:how-to/installing-commodore.adoc[]
12
* xref:commodore:ROOT:how-to/local-mode-component.adoc[]
23
* xref:commodore:ROOT:how-to/shell-completion.adoc[]

0 commit comments

Comments
 (0)