Spaces:
Sleeping
Sleeping
Commit ·
876cca8
1
Parent(s): 7c83d76
Make session storage container-friendly
Browse filesFiles changed (4)
7 unmodified lines89101112137 unmodified lines# Expect the build artifact layout: dist\birdnet-uploader\* (exe + _internal)COPY dist\birdnet-uploader\ C:\app\ENV HF_TOKEN=""EXPOSE 07 unmodified lines89101112131415167 unmodified lines# Expect the build artifact layout: dist\birdnet-uploader\* (exe + _internal)COPY dist\birdnet-uploader\ C:\app\VOLUME ["C:\\data"]ENV BIRDNET_UPLOADER_DATA_DIR="C:\\data"ENV HF_TOKEN=""EXPOSE 0
12345672 unmodified lines101112131415Param([string]$RepoId = "owner/dataset",[string]$Segments = "C:\data\segments",[string]$Token = $env:HF_TOKEN)if (-not $Token) {2 unmodified lines}Write-Host "Running smoke test upload against $RepoId using segments at $Segments"# Dry run first& .\birdnet-uploader.exe upload --repo-id $RepoId --segments $Segments --token $Token --dry-run123456782 unmodified lines111213141516171819Param([string]$RepoId = "owner/dataset",[string]$Segments = "C:\data\segments",[string]$Token = $env:HF_TOKEN,[string]$SessionDir = $env:BIRDNET_UPLOADER_SESSION_DIR)if (-not $Token) {2 unmodified lines}Write-Host "Running smoke test upload against $RepoId using segments at $Segments"if ($SessionDir) {Write-Host "Session checkpoints will persist under $SessionDir"}# Dry run first& .\birdnet-uploader.exe upload --repo-id $RepoId --segments $Segments --token $Token --dry-run
27 unmodified lines28293031323327 unmodified linesdef get_session_root() -> Path:"""Resolve and create the session storage root directory."""return _resolve_path_from_env("BIRDNET_UPLOADER_SESSION_DIR",Path.home() / ".birdnet-uploader" / "sessions",27 unmodified lines28293031323334353627 unmodified linesdef get_session_root() -> Path:"""Resolve and create the session storage root directory."""data_root = os.getenv("BIRDNET_UPLOADER_DATA_DIR")if data_root:return _resolve_path_from_env("BIRDNET_UPLOADER_SESSION_DIR", Path(data_root).expanduser() / "sessions")return _resolve_path_from_env("BIRDNET_UPLOADER_SESSION_DIR",Path.home() / ".birdnet-uploader" / "sessions",
13 unmodified lines14151617181913 unmodified linesassert resolved.is_dir()def test_get_runtime_config_contains_expected_keys() -> None:config = get_runtime_config()13 unmodified lines14151617181920212223242526272829303113 unmodified linesassert resolved.is_dir()def test_get_session_root_prefers_data_dir_when_session_dir_missing(tmp_path: Path, monkeypatch) -> None:data_root = tmp_path / "container-data"monkeypatch.delenv("BIRDNET_UPLOADER_SESSION_DIR", raising=False)monkeypatch.setenv("BIRDNET_UPLOADER_DATA_DIR", str(data_root))resolved = get_session_root()assert resolved == data_root / "sessions"assert resolved.exists()assert resolved.is_dir()def test_get_runtime_config_contains_expected_keys() -> None:config = get_runtime_config()
Dockerfile.windows+3
scripts/smoke_test_upload.ps1+5-1
src/uploader_cli/config.py+3
tests/unit/test_uploader_cli_config.py+12