Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions fileglancer/apps/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -870,12 +870,16 @@ async def submit_job(

# Set up the script preamble:
# - FG_WORK_DIR: the job's working directory (used by subsequent variables)
# - Unset PIXI_PROJECT_MANIFEST so pixi uses the repo's own manifest
# - FG_MANIFEST_DIR: the directory containing the app's manifest (pixi.toml,
# runnables.yaml, etc.), so commands can reference it explicitly instead
# of relying on the cwd. Always points at the manifest directory, even
# when effective_working_dir is "work" (the repo stays reachable there
# via the `repo` symlink).
# - SERVICE_URL_PATH: for service-type jobs, where to write the service URL
# - cd into the repo so commands can find project files (pixi.toml, scripts, etc.)
preamble_lines = [
"unset PIXI_PROJECT_MANIFEST",
f"export FG_WORK_DIR={shlex.quote(str(work_dir))}",
f'export FG_MANIFEST_DIR="$FG_WORK_DIR"/{shlex.quote(cd_suffix)}',
# Where the script reports its startup phase (e.g. pulling a container
# image). The UI reads this to explain a wait before a service is ready.
'export FG_PHASE_PATH="$FG_WORK_DIR/phase"',
Expand Down
2 changes: 1 addition & 1 deletion fileglancer/apps/pixi.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _task_to_entry_point(name: str, task: dict) -> AppEntryPoint | None:
cmd = " ".join(cmd)

# Build the pixi run command
command = f"pixi run {name}"
command = f'pixi run --manifest-path "$FG_MANIFEST_DIR" {name}'

description = task.get("description")

Expand Down
6 changes: 4 additions & 2 deletions tests/test_apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,8 +2857,10 @@ def test_script_layout_and_parameter_quoting(self, tmp_path, monkeypatch):
)
script = self._submitted(calls)["command"]

assert script.startswith("unset PIXI_PROJECT_MANIFEST")
assert f"export FG_WORK_DIR={shlex.quote(job.work_dir)}" in script
assert script.startswith(f"export FG_WORK_DIR={shlex.quote(job.work_dir)}")
# FG_MANIFEST_DIR always points at the manifest's directory, so
# pixi-style commands can pass --manifest-path explicitly.
assert 'export FG_MANIFEST_DIR="$FG_WORK_DIR"/repo' in script
# Default working dir is the repo snapshot (no manifest subdir here).
assert 'cd "$FG_WORK_DIR"/repo' in script
assert "conda activate tools" in script
Expand Down
Loading