Skip to content

Documentation site, build scripts, and release workflows#329

Draft
begna112 wants to merge 3 commits intovast-ai:masterfrom
begna112:pr/docs-build
Draft

Documentation site, build scripts, and release workflows#329
begna112 wants to merge 3 commits intovast-ai:masterfrom
begna112:pr/docs-build

Conversation

@begna112
Copy link

Summary

Adds a full MkDocs Material documentation site, CLI/SDK doc generation scripts, release workflows, and build infrastructure.

Depends on: #328 (SDK wrapper) ← #327 (CLI fixes) — please merge in order.

Documentation (docs/)

  • Complete documentation site with MkDocs Material theme
  • CLI reference (auto-generated from --help output)
  • SDK reference and usage guide
  • Serverless framework guide (client/server)
  • Getting started, installation, and migration guides
  • API key management and configuration docs

Build Scripts (scripts/)

  • generate_cli_docs.py - Generates docs/cli/commands.md from CLI help output
  • generate_detailed_cli_docs.py - Generates detailed per-command docs
  • mkdocs_hooks.py - MkDocs pre-build hook for auto-generating CLI reference

Workflows

  • .github/workflows/docs.yml - Auto-deploy docs to GitHub Pages on push to master
  • .github/workflows/release.yml - Release workflow (PyPI publish disabled pending config)

Other

  • mkdocs.yml - MkDocs Material theme configuration
  • .pre-commit-config.yaml - Ruff linter and formatter pre-commit hooks
  • CHANGELOG.md - Version history
  • pyproject.toml - Added docs optional dependency group, vast_pdf.py package include

Stats

  • 35 files changed, +11,489 lines
  • All 546 existing tests still pass

Test plan

  • pip install -e ".[docs]" installs doc dependencies
  • mkdocs build succeeds without errors
  • mkdocs serve renders documentation correctly
  • All prior CLI and SDK tests still pass
  • Pre-commit hooks run successfully (pre-commit run --all-files)

Bug fixes:
- Fix mutable default arguments in http_put/post/del
- Add missing exception handling in http_request
- Fix timezone handling with UTC-aware timestamps
- Fix show_instances row rebinding bug
- Fix show_machine dict response handling
- Fix parse_query field alias data loss
- Remove hardcoded if True anti-patterns
- Fix raw mode to return parsed JSON consistently
- Fix namespace attribute typo
- Replace bare except clauses with specific exceptions
- Remove shell=True from subprocess calls
- Fix self-test instance creation type handling and error messages

Infrastructure improvements:
- Add request timeout support with configurable defaults
- Expand retry logic to cover 502/503/504 and connection errors
- Add JSONDecodeError protection to high-risk .json() sites
- Consolidate direct requests calls through http_* helpers
- Add structured JSON error output for --raw mode
- Add raw mode return handling to all command functions
- Remove unreachable code after raise_for_status()
- Add api_call/output_result/error_output DRY helpers
- Add 2FA session expiry handling with automatic key fallback
- Filter sensitive fields from show endpoints output

CLI improvements:
- Improve help text and descriptions for 130+ commands
- Add named flags for transfer credit (--sender, --recipient)
- Fix argument mismatches in usage strings
- Standardize show maints to use --ids instead of -ids
- Remove Python 2 compatibility code

Test infrastructure:
- Add pytest with regression, smoke, and unit test suites
- Add CI workflow with lint, test, and smoke-test jobs
- Add ruff configuration for code quality
- Add dev dependencies to pyproject.toml
Introduce the vastai Python package providing programmatic SDK access
to the Vast.ai API, plus a serverless client/server framework for
building GPU workers.

New packages:
- vastai/ - SDK wrapper (sdk.py), base class (vastai_base.py),
  serverless client and server framework
- vastai_sdk/ - Backward-compatibility shim for old import path
- examples/ - 17 client/server example scripts
- benchmarks/ - Prometheus metrics and docker-compose

Test additions:
- 7 unit tests for serverless components and VastAIBase
- 6 regression tests for SDK integration, lazy imports,
  exception handling, naming consistency

Config updates:
- pyproject.toml: add pyparsing dep, serverless optional deps,
  vastai/vastai_sdk packages, mypy config
- ci.yml: add type-check job (mypy vastai/)
- Full MkDocs Material documentation site (26 pages)
  covering CLI commands, SDK reference, serverless guide,
  and migration guide
- CLI docs generation scripts with MkDocs pre-build hook
- GitHub Actions workflows for docs deployment and releases
- Pre-commit configuration with Ruff linter/formatter
- Changelog following Keep a Changelog format
- Add docs optional dependencies to pyproject.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant