Skip to content

Commit 8db4fc2

Browse files
authored
Merge pull request #2742 from fractal-analytics-platform/2741-add-pixi-configuration-info-to-documentation
Improve documentation for Pixi task collection
2 parents 15f4af4 + db58898 commit 8db4fc2

File tree

2 files changed

+62
-21
lines changed

2 files changed

+62
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
* Documentation:
66
* Fix `Fractal Users` documentation page (\#2738).
7+
* Improve documentation for Pixi task collection (\#2742).
78
* Internal
89
* Improve type hints (\#2739).
910

fractal_server/config.py

Lines changed: 61 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,74 @@ class MailSettings(BaseModel):
6666

6767
class PixiSettings(BaseModel):
6868
"""
69-
Configuration for Pixi task collection
70-
71-
See https://pixi.sh/latest/reference/cli/pixi/install/#config-options for
72-
`pixi install` concurrency options.
73-
See https://docs.rs/tokio/latest/tokio/#cpu-bound-tasks-and-blocking-code
74-
for `tokio` configuration.
75-
76-
versions:
77-
Available `pixi` versions and their `PIXI_HOME` folders.
78-
default_version:
79-
Default `pixi` version to use for task collection - must be one
80-
of `versions` keys.
81-
PIXI_CONCURRENT_SOLVES:
82-
Value of `--concurrent-solves` for `pixi install`.
83-
PIXI_CONCURRENT_DOWNLOADS:
84-
Value of `--concurrent-downloads for `pixi install`.
85-
TOKIO_WORKER_THREADS:
86-
From tokio docs, "The core threads are where all asynchronous code
87-
runs, and Tokio will by default spawn one for each CPU core. You can
88-
use the environment variable TOKIO_WORKER_THREADS to override the
89-
default value."
69+
Configuration for Pixi Task collection.
70+
71+
In order to use Pixi for Task collection, you must have one or more Pixi
72+
binaries in your machine
73+
(see
74+
[example/get_pixi.sh](https://github.com/fractal-analytics-platform/fractal-server/blob/main/example/get_pixi.sh)
75+
for installation example).
76+
77+
To let Fractal Server use these binaries for Task collection, a JSON file
78+
must be prepared with the data to populate `PixiSettings` (arguments with
79+
default values may be omitted).
80+
81+
The path to this JSON file must then be provided to Fractal via the
82+
environment variable `FRACTAL_PIXI_CONFIG_FILE`.
9083
"""
9184

9285
versions: DictStrStr
86+
"""
87+
A dictionary with Pixi versions as keys and paths to the corresponding
88+
folder as values.
89+
90+
E.g. let's assume that you have Pixi v0.47.0 at
91+
`/pixi-path/0.47.0/bin/pixi` and Pixi v0.48.2 at
92+
`/pixi-path/0.48.2/bin/pixi`, then
93+
```json
94+
"versions": {
95+
"0.47.0": "/pixi-path/0.47.0",
96+
"0.48.2": "/pixi-path/0.48.2"
97+
}
98+
```
99+
"""
93100
default_version: str
101+
"""
102+
Default Pixi version to be used for Task collection.
94103
104+
Must be a key of the `versions` dictionary.
105+
"""
95106
PIXI_CONCURRENT_SOLVES: int = 4
107+
"""
108+
Value of
109+
[`--concurrent-solves`](https://pixi.sh/latest/reference/cli/pixi/install/#arg---concurrent-solves)
110+
for `pixi install`.
111+
"""
96112
PIXI_CONCURRENT_DOWNLOADS: int = 4
113+
"""
114+
Value of
115+
[`--concurrent-downloads`](https://pixi.sh/latest/reference/cli/pixi/install/#arg---concurrent-downloads)
116+
for `pixi install`.
117+
"""
97118
TOKIO_WORKER_THREADS: int = 2
119+
"""
120+
From
121+
[Tokio documentation](
122+
https://docs.rs/tokio/latest/tokio/#cpu-bound-tasks-and-blocking-code
123+
)
124+
:
125+
126+
The core threads are where all asynchronous code runs,
127+
and Tokio will by default spawn one for each CPU core.
128+
You can use the environment variable `TOKIO_WORKER_THREADS` to override
129+
the default value.
130+
"""
98131
DEFAULT_ENVIRONMENT: str = "default"
132+
"""
133+
"""
99134
DEFAULT_PLATFORM: str = "linux-64"
135+
"""
136+
"""
100137

101138
@model_validator(mode="after")
102139
def check_pixi_settings(self):
@@ -578,6 +615,9 @@ def PIP_CACHE_DIR_ARG(self) -> str:
578615
"""
579616

580617
FRACTAL_PIXI_CONFIG_FILE: Path | None = None
618+
"""
619+
Path to the Pixi configuration JSON file that will populate `PixiSettings`.
620+
"""
581621

582622
pixi: PixiSettings | None = None
583623

0 commit comments

Comments
 (0)