vantage-cli 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/.github/workflows/pages.yml +22 -0
  2. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/PKG-INFO +31 -3
  3. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/README.md +29 -1
  4. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/pyproject.toml +2 -2
  5. vantage_cli-0.1.4/scripts/README.md +55 -0
  6. vantage_cli-0.1.4/scripts/update_docs_version.py +150 -0
  7. vantage_cli-0.1.4/scripts/update_docs_version.sh +44 -0
  8. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/uv.lock +251 -3
  9. vantage_cli-0.1.4/vantage_cli/apps/__init__.py +19 -0
  10. vantage_cli-0.1.4/vantage_cli/apps/slurm_juju_localhost/__init__.py +5 -0
  11. vantage_cli-0.1.4/vantage_cli/apps/slurm_microk8s_localhost/__init__.py +16 -0
  12. vantage_cli-0.1.4/vantage_cli/apps/slurm_multipass_localhost/__init__.py +5 -0
  13. vantage_cli-0.1.4/vantage_cli/commands/apps/__init__.py +22 -0
  14. vantage_cli-0.1.4/vantage_cli/commands/apps/deploy.py +72 -0
  15. vantage_cli-0.1.4/vantage_cli/commands/apps/list.py +97 -0
  16. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/__init__.py +2 -5
  17. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/profile/__init__.py +0 -5
  18. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/main.py +1 -7
  19. vantage_cli-0.1.2/vantage_cli/apps/__init__.py +0 -22
  20. vantage_cli-0.1.2/vantage_cli/apps/juju_localhost/__init__.py +0 -17
  21. vantage_cli-0.1.2/vantage_cli/apps/microk8s/__init__.py +0 -3
  22. vantage_cli-0.1.2/vantage_cli/apps/multipass_singlenode/__init__.py +0 -12
  23. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/.commitlintrc.yml +0 -0
  24. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/.github/workflows/ci.yml +0 -0
  25. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/.github/workflows/publish.yml +0 -0
  26. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/.gitignore +0 -0
  27. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/__init__.py +0 -0
  28. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/apps/common.py +0 -0
  29. {vantage_cli-0.1.2/vantage_cli/apps/juju_localhost → vantage_cli-0.1.4/vantage_cli/apps/slurm_juju_localhost}/app.py +0 -0
  30. {vantage_cli-0.1.2/vantage_cli/apps/juju_localhost → vantage_cli-0.1.4/vantage_cli/apps/slurm_juju_localhost}/bundle_yaml.py +0 -0
  31. {vantage_cli-0.1.2/vantage_cli/apps/microk8s → vantage_cli-0.1.4/vantage_cli/apps/slurm_microk8s_localhost}/README.md +0 -0
  32. {vantage_cli-0.1.2/vantage_cli/apps/microk8s → vantage_cli-0.1.4/vantage_cli/apps/slurm_microk8s_localhost}/app.py +0 -0
  33. {vantage_cli-0.1.2/vantage_cli/apps/multipass_singlenode → vantage_cli-0.1.4/vantage_cli/apps/slurm_multipass_localhost}/app.py +0 -0
  34. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/apps/templates.py +0 -0
  35. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/auth.py +0 -0
  36. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/cache.py +0 -0
  37. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/client.py +0 -0
  38. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/command_base.py +0 -0
  39. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/__init__.py +0 -0
  40. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clouds/__init__.py +0 -0
  41. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clouds/add.py +0 -0
  42. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clouds/delete.py +0 -0
  43. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clouds/render.py +0 -0
  44. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clouds/update.py +0 -0
  45. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/create.py +0 -0
  46. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/delete.py +0 -0
  47. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/get.py +0 -0
  48. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/list.py +0 -0
  49. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/render.py +0 -0
  50. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/schema.py +0 -0
  51. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/clusters/utils.py +0 -0
  52. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/profile/crud.py +0 -0
  53. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/commands/profile/render.py +0 -0
  54. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/config.py +0 -0
  55. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/constants.py +0 -0
  56. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/exceptions.py +0 -0
  57. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/format.py +0 -0
  58. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/gql_client.py +0 -0
  59. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/render.py +0 -0
  60. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/schemas.py +0 -0
  61. {vantage_cli-0.1.2 → vantage_cli-0.1.4}/vantage_cli/time_loop.py +0 -0
@@ -28,6 +28,28 @@ jobs:
28
28
  steps:
29
29
  - name: Checkout
30
30
  uses: actions/checkout@v4
31
+ - name: Update documentation version
32
+ run: |
33
+ # Extract version from pyproject.toml and update docs
34
+ VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
35
+ TODAY=$(date +%Y-%m-%d)
36
+ echo "📝 Updating docs with version: $VERSION"
37
+
38
+ # Update all documentation files
39
+ sed -i "s/^version: .*/version: \"$VERSION\"/" docs/_data/project.yml
40
+ sed -i "s/^updated: .*/updated: \"$TODAY\"/" docs/_data/project.yml
41
+
42
+ if grep -q "^version:" docs/_config.yml; then
43
+ sed -i "s/^version: .*/version: \"$VERSION\"/" docs/_config.yml
44
+ else
45
+ sed -i "/^description:/a version: \"$VERSION\"" docs/_config.yml
46
+ fi
47
+
48
+ if grep -q "^version:" docs/index.md; then
49
+ sed -i "s/^version: .*/version: \"$VERSION\"/" docs/index.md
50
+ else
51
+ sed -i "/^permalink:/a version: \"$VERSION\"" docs/index.md
52
+ fi
31
53
  - name: Setup Pages
32
54
  uses: actions/configure-pages@v5
33
55
  - name: Build with Jekyll
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vantage-cli
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: The Vantage Compute CLI.
5
5
  Author-email: jamesbeedy <james@vantagecompute.ai>
6
6
  License: MIT
7
- Requires-Python: >=3.12
7
+ Requires-Python: >=3.11
8
8
  Requires-Dist: aiohttp>=3.8.0
9
9
  Requires-Dist: anyio>=3.6.0
10
10
  Requires-Dist: gql>=4.0.0
@@ -40,7 +40,7 @@ Description-Content-Type: text/markdown
40
40
  # Vantage CLI
41
41
 
42
42
  [![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](LICENSE)
43
- [![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://python.org)
43
+ [![Python](https://img.shields.io/badge/python-3.12+-blue.svg)](https://python.org)
44
44
  [![PyPI](https://img.shields.io/pypi/v/vantage-cli.svg)](https://pypi.org/project/vantage-cli/)
45
45
 
46
46
  ![Build Status](https://img.shields.io/github/actions/workflow/status/vantagecompute/vantage-cli/ci.yaml?branch=main&label=build&logo=github&style=plastic)
@@ -78,6 +78,34 @@ cd vantage-cli && uv sync
78
78
  uv run vantage login
79
79
  ```
80
80
 
81
+ ## Deploy a Slurm Cluster
82
+
83
+ ### Localhost
84
+
85
+ #### Create a Singlenode Slurm Cluster using Multipass
86
+
87
+ ```bash
88
+ vantage clusters create my-slurm-multipass-cluster \
89
+ --cloud localhost \
90
+ --deploy slurm-multipass-localhost
91
+ ```
92
+
93
+ #### Create a Slurm Cluster on LXD
94
+
95
+ ```bash
96
+ vantage clusters create my-slurm-lxd-cluster \
97
+ --cloud localhost \
98
+ --deploy slurm-juju-localhost
99
+ ```
100
+
101
+ #### Create a Slurm Cluster on MicroK8S
102
+
103
+ ```bash
104
+ vantage clusters create my-slurm-microk8s-cluster \
105
+ --cloud localhost \
106
+ --deploy slurm-microk8s-locahost
107
+ ```
108
+
81
109
  ## 📚 Documentation
82
110
 
83
111
  Visit our comprehensive documentation site:
@@ -8,7 +8,7 @@
8
8
  # Vantage CLI
9
9
 
10
10
  [![License](https://img.shields.io/badge/license-Apache%202.0-green.svg)](LICENSE)
11
- [![Python](https://img.shields.io/badge/python-3.11+-blue.svg)](https://python.org)
11
+ [![Python](https://img.shields.io/badge/python-3.12+-blue.svg)](https://python.org)
12
12
  [![PyPI](https://img.shields.io/pypi/v/vantage-cli.svg)](https://pypi.org/project/vantage-cli/)
13
13
 
14
14
  ![Build Status](https://img.shields.io/github/actions/workflow/status/vantagecompute/vantage-cli/ci.yaml?branch=main&label=build&logo=github&style=plastic)
@@ -46,6 +46,34 @@ cd vantage-cli && uv sync
46
46
  uv run vantage login
47
47
  ```
48
48
 
49
+ ## Deploy a Slurm Cluster
50
+
51
+ ### Localhost
52
+
53
+ #### Create a Singlenode Slurm Cluster using Multipass
54
+
55
+ ```bash
56
+ vantage clusters create my-slurm-multipass-cluster \
57
+ --cloud localhost \
58
+ --deploy slurm-multipass-localhost
59
+ ```
60
+
61
+ #### Create a Slurm Cluster on LXD
62
+
63
+ ```bash
64
+ vantage clusters create my-slurm-lxd-cluster \
65
+ --cloud localhost \
66
+ --deploy slurm-juju-localhost
67
+ ```
68
+
69
+ #### Create a Slurm Cluster on MicroK8S
70
+
71
+ ```bash
72
+ vantage clusters create my-slurm-microk8s-cluster \
73
+ --cloud localhost \
74
+ --deploy slurm-microk8s-locahost
75
+ ```
76
+
49
77
  ## 📚 Documentation
50
78
 
51
79
  Visit our comprehensive documentation site:
@@ -1,13 +1,13 @@
1
1
  [project]
2
2
  name = "vantage-cli"
3
- version = "0.1.2"
3
+ version = "0.1.4"
4
4
  description = "The Vantage Compute CLI."
5
5
  authors = [
6
6
  {name = "jamesbeedy", email = "james@vantagecompute.ai"}
7
7
  ]
8
8
  readme = "README.md"
9
9
  license = {text = "MIT"}
10
- requires-python = ">=3.12"
10
+ requires-python = ">=3.11"
11
11
  dependencies = [
12
12
  "juju ~= 3.6",
13
13
  "typer>=0.17.4",
@@ -0,0 +1,55 @@
1
+ # Scripts Directory
2
+
3
+ This directory contains utility scripts for the Vantage CLI project.
4
+
5
+ ## update_docs_version.py
6
+
7
+ **Purpose**: Automatically updates documentation files with the current version from `pyproject.toml`.
8
+
9
+ **Files Updated**:
10
+ - `docs/_data/project.yml` - Updates version and date fields
11
+ - `docs/_config.yml` - Adds/updates version field
12
+ - `docs/index.md` - Adds version to front matter
13
+
14
+ **Usage**:
15
+ ```bash
16
+ # Using justfile (recommended)
17
+ just update-docs-version
18
+
19
+ # Direct execution
20
+ python scripts/update_docs_version.py
21
+
22
+ # Using shell wrapper
23
+ ./scripts/update_docs_version.sh
24
+ ```
25
+
26
+ **Dependencies**:
27
+ - Python 3.7+ with `tomllib` (Python 3.11+) or `tomli` package
28
+
29
+ ## update_docs_version.sh
30
+
31
+ **Purpose**: Shell wrapper for `update_docs_version.py` that handles dependency installation.
32
+
33
+ **Usage**:
34
+ ```bash
35
+ ./scripts/update_docs_version.sh
36
+ ```
37
+
38
+ ## Integration
39
+
40
+ ### Local Development
41
+ Use `just update-docs-version` before building documentation locally.
42
+
43
+ ### CI/CD (GitHub Pages)
44
+ The version update is automatically integrated into the GitHub Pages workflow in `.github/workflows/pages.yml`.
45
+
46
+ ### Manual Execution
47
+ Both Python script and shell wrapper can be run independently for custom build processes.
48
+
49
+ ## When to Use
50
+
51
+ - **Before releasing**: Ensure documentation reflects the current version
52
+ - **Before building docs**: Keep documentation in sync with package version
53
+ - **In CI/CD**: Automatically update version during deployment
54
+
55
+ The scripts are designed to be idempotent - running them multiple times with the same version will not cause issues.
@@ -0,0 +1,150 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ Update documentation files with version from pyproject.toml
4
+
5
+ This script reads the version from pyproject.toml and updates:
6
+ 1. docs/_data/project.yml (replaces __VERSION__ placeholder)
7
+ 2. docs/_config.yml (adds version field)
8
+ 3. Any other documentation files that need version updates
9
+ """
10
+
11
+ import re
12
+ import sys
13
+ from datetime import datetime
14
+ from pathlib import Path
15
+ from typing import Any, Dict
16
+
17
+ try:
18
+ import tomllib
19
+ except ImportError:
20
+ # Python < 3.11 fallback
21
+ try:
22
+ import tomli as tomllib
23
+ except ImportError:
24
+ print("Error: tomllib (Python 3.11+) or tomli package required")
25
+ sys.exit(1)
26
+
27
+
28
+ def load_pyproject_version() -> str:
29
+ """Load version from pyproject.toml"""
30
+ pyproject_path = Path(__file__).parent.parent / "pyproject.toml"
31
+
32
+ if not pyproject_path.exists():
33
+ raise FileNotFoundError(f"pyproject.toml not found at {pyproject_path}")
34
+
35
+ with open(pyproject_path, "rb") as f:
36
+ data = tomllib.load(f)
37
+
38
+ version = data.get("project", {}).get("version")
39
+ if not version:
40
+ raise ValueError("Version not found in pyproject.toml")
41
+
42
+ return version
43
+
44
+
45
+ def update_project_yml(version: str) -> None:
46
+ """Update docs/_data/project.yml with the current version"""
47
+ project_yml_path = Path(__file__).parent.parent / "docs" / "_data" / "project.yml"
48
+
49
+ if not project_yml_path.exists():
50
+ print(f"Warning: {project_yml_path} not found, skipping")
51
+ return
52
+
53
+ content = project_yml_path.read_text(encoding="utf-8")
54
+
55
+ # Replace version placeholder
56
+ updated_content = re.sub(
57
+ r'version:\s*["\']?__VERSION__["\']?',
58
+ f'version: "{version}"',
59
+ content
60
+ )
61
+
62
+ # Update the date as well
63
+ today = datetime.now().strftime("%Y-%m-%d")
64
+ updated_content = re.sub(
65
+ r'updated:\s*["\']?[\d-]+["\']?',
66
+ f'updated: "{today}"',
67
+ updated_content
68
+ )
69
+
70
+ project_yml_path.write_text(updated_content, encoding="utf-8")
71
+ print(f"✓ Updated {project_yml_path} with version {version}")
72
+
73
+
74
+ def update_config_yml(version: str) -> None:
75
+ """Update docs/_config.yml with the current version"""
76
+ config_yml_path = Path(__file__).parent.parent / "docs" / "_config.yml"
77
+
78
+ if not config_yml_path.exists():
79
+ print(f"Warning: {config_yml_path} not found, skipping")
80
+ return
81
+
82
+ content = config_yml_path.read_text(encoding="utf-8")
83
+
84
+ # Check if version field already exists
85
+ if re.search(r'^version:\s*', content, re.MULTILINE):
86
+ # Update existing version
87
+ updated_content = re.sub(
88
+ r'^version:\s*.*$',
89
+ f'version: "{version}"',
90
+ content,
91
+ flags=re.MULTILINE
92
+ )
93
+ else:
94
+ # Add version field after description
95
+ updated_content = re.sub(
96
+ r'(description:.*?\n)',
97
+ f'\\1version: "{version}"\n',
98
+ content,
99
+ flags=re.DOTALL
100
+ )
101
+
102
+ config_yml_path.write_text(updated_content, encoding="utf-8")
103
+ print(f"✓ Updated {config_yml_path} with version {version}")
104
+
105
+
106
+ def update_index_md(version: str) -> None:
107
+ """Update docs/index.md with version information if needed"""
108
+ index_md_path = Path(__file__).parent.parent / "docs" / "index.md"
109
+
110
+ if not index_md_path.exists():
111
+ print(f"Warning: {index_md_path} not found, skipping")
112
+ return
113
+
114
+ content = index_md_path.read_text(encoding="utf-8")
115
+
116
+ # Add version to the front matter if it doesn't exist
117
+ if "version:" not in content and "---" in content:
118
+ # Insert version into front matter
119
+ updated_content = re.sub(
120
+ r'(---\n.*?)\n(---)',
121
+ f'\\1\nversion: "{version}"\n\\2',
122
+ content,
123
+ flags=re.DOTALL
124
+ )
125
+
126
+ if updated_content != content:
127
+ index_md_path.write_text(updated_content, encoding="utf-8")
128
+ print(f"✓ Updated {index_md_path} with version {version}")
129
+
130
+
131
+ def main() -> None:
132
+ """Main function to update all documentation files with version"""
133
+ try:
134
+ version = load_pyproject_version()
135
+ print(f"📝 Updating documentation with version: {version}")
136
+
137
+ # Update all documentation files
138
+ update_project_yml(version)
139
+ update_config_yml(version)
140
+ update_index_md(version)
141
+
142
+ print(f"🎉 Successfully updated documentation files with version {version}")
143
+
144
+ except Exception as e:
145
+ print(f"❌ Error updating documentation version: {e}")
146
+ sys.exit(1)
147
+
148
+
149
+ if __name__ == "__main__":
150
+ main()
@@ -0,0 +1,44 @@
1
+ #!/bin/bash
2
+ # Update documentation version from pyproject.toml
3
+ # This script can be run locally or in CI/CD
4
+
5
+ set -e
6
+
7
+ # Get the directory where this script is located
8
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
9
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
10
+
11
+ echo "🔄 Updating documentation version..."
12
+
13
+ # Check if we're in a Python environment with the required packages
14
+ if command -v python3 >/dev/null 2>&1; then
15
+ PYTHON_CMD="python3"
16
+ elif command -v python >/dev/null 2>&1; then
17
+ PYTHON_CMD="python"
18
+ else
19
+ echo "❌ Error: Python not found"
20
+ exit 1
21
+ fi
22
+
23
+ # Try to run the update script
24
+ cd "$PROJECT_ROOT"
25
+
26
+ # Check if tomli/tomllib is available
27
+ if ! $PYTHON_CMD -c "import sys; import tomllib if sys.version_info >= (3, 11) else __import__('tomli')" 2>/dev/null; then
28
+ echo "📦 Installing tomli for Python < 3.11..."
29
+ # Try different installation methods
30
+ if command -v pip >/dev/null 2>&1; then
31
+ pip install --quiet tomli
32
+ elif command -v pip3 >/dev/null 2>&1; then
33
+ pip3 install --quiet tomli
34
+ elif $PYTHON_CMD -m pip --version >/dev/null 2>&1; then
35
+ $PYTHON_CMD -m pip install --quiet tomli
36
+ else
37
+ echo "⚠️ Warning: Could not install tomli. Script may fail for Python < 3.11"
38
+ fi
39
+ fi
40
+
41
+ # Run the update script
42
+ $PYTHON_CMD scripts/update_docs_version.py
43
+
44
+ echo "✅ Documentation version update complete!"