Skip to content

Commit 16fe7a4

Browse files
authored
Merge pull request #2781 from rhatdan/fix/issue-2731-tempdir-config
Add ramalama.conf tempdir setting for TMPDIR selection
2 parents d1ba994 + a416bd8 commit 16fe7a4

38 files changed

Lines changed: 113 additions & 38 deletions

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ uv.lock
2929
!.pixi/config.toml
3030
*~
3131
*#
32+
.mypy_cache

bin/ramalama

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
#!/usr/bin/env python3
22

3-
import os
43
import sys
54

5+
from ramalama.config import ActiveConfig, ensure_tmpdir
6+
67

78
def main():
89
if not sys.stdout.isatty():
910
sys.stdout.reconfigure(line_buffering=True)
1011

11-
if sys.platform != 'win32':
12-
# default TMPDIR environment to /var/tmp on non Windows platforms
13-
os.environ["TMPDIR"] = os.getenv("TMPDIR", "/var/tmp")
14-
1512
sys.path.insert(0, './')
1613
try:
1714
import ramalama
1815
except Exception:
1916
print(f"ramalama module not found in sys.path: {sys.path}", file=sys.stderr)
2017
raise
2118

19+
ensure_tmpdir(ActiveConfig())
2220
ramalama.cli.main()
2321

2422

docs/options/authfile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--authfile**=*path*

docs/options/backend.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--backend**=*auto* | vulkan | rocm | cuda | sycl | openvino | cann | musa

docs/options/cache-reuse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--cache-reuse**=*BYTES*

docs/options/ctx-size.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--ctx-size**, **-c**

docs/options/device.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--device**

docs/options/env.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--env**=

docs/options/help.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama bench, ramalama perplexity, ramalama run, ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--help**, **-h**

docs/options/host.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
####> This option file is used in:
2-
####> ramalama sandbox goose, ramalama sandbox opencode, ramalama serve
2+
####> ramalama sandbox goose, ramalama sandbox opencode, ramalama sandbox pi, ramalama serve
33
####> If this file is edited, make sure the changes
44
####> are applicable to all of those.
55
#### **--host**="::"

0 commit comments

Comments
 (0)