|
| 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 transparently manages Python versions and virtualenvs for each tool. |
| 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 | +---- |
0 commit comments