jetson-cli 0.2.0__py3-none-any.whl
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.
- jetson_cli/__init__.py +8 -0
- jetson_cli/cli.py +205 -0
- jetson_cli/utils.py +144 -0
- jetson_cli-0.2.0.dist-info/METADATA +213 -0
- jetson_cli-0.2.0.dist-info/RECORD +9 -0
- jetson_cli-0.2.0.dist-info/WHEEL +5 -0
- jetson_cli-0.2.0.dist-info/entry_points.txt +2 -0
- jetson_cli-0.2.0.dist-info/licenses/LICENSE +21 -0
- jetson_cli-0.2.0.dist-info/top_level.txt +1 -0
jetson_cli/__init__.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Jetson CLI - Command-line interface for NVIDIA Jetson setup and configuration
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__version__ = "0.2.0"
|
|
6
|
+
__author__ = "Jetson Setup Team"
|
|
7
|
+
__email__ = "support@jetson-setup.com"
|
|
8
|
+
__description__ = "Command-line interface for NVIDIA Jetson setup and configuration"
|
jetson_cli/cli.py
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
import os
|
|
5
|
+
import sys
|
|
6
|
+
import subprocess
|
|
7
|
+
import yaml
|
|
8
|
+
from pathlib import Path
|
|
9
|
+
from rich.console import Console
|
|
10
|
+
from rich.table import Table
|
|
11
|
+
from rich.progress import Progress, SpinnerColumn, TextColumn
|
|
12
|
+
from rich.panel import Panel
|
|
13
|
+
|
|
14
|
+
from . import __version__
|
|
15
|
+
from .utils import get_script_path, run_script, check_jetson_platform
|
|
16
|
+
|
|
17
|
+
console = Console()
|
|
18
|
+
|
|
19
|
+
def print_version(ctx, param, value):
|
|
20
|
+
if not value or ctx.resilient_parsing:
|
|
21
|
+
return
|
|
22
|
+
click.echo(f'jetson-cli version {__version__}')
|
|
23
|
+
ctx.exit()
|
|
24
|
+
|
|
25
|
+
@click.group()
|
|
26
|
+
@click.option('--version', is_flag=True, callback=print_version,
|
|
27
|
+
expose_value=False, is_eager=True, help='Show version and exit')
|
|
28
|
+
@click.option('--verbose', '-v', is_flag=True, help='Enable verbose output')
|
|
29
|
+
@click.pass_context
|
|
30
|
+
def cli(ctx, verbose):
|
|
31
|
+
"""Jetson CLI - Command-line interface for NVIDIA Jetson setup and configuration"""
|
|
32
|
+
ctx.ensure_object(dict)
|
|
33
|
+
ctx.obj['verbose'] = verbose
|
|
34
|
+
|
|
35
|
+
# Check if running on Jetson platform
|
|
36
|
+
if not check_jetson_platform() and not os.environ.get('JETSON_CLI_SKIP_PLATFORM_CHECK'):
|
|
37
|
+
console.print("[yellow]Warning: Not running on detected Jetson platform. Some features may not work correctly.[/yellow]")
|
|
38
|
+
|
|
39
|
+
@cli.command()
|
|
40
|
+
@click.option('--output', '-o', type=click.Choice(['table', 'json', 'yaml']), default='table',
|
|
41
|
+
help='Output format')
|
|
42
|
+
@click.option('--save', '-s', type=click.Path(), help='Save probe results to file')
|
|
43
|
+
@click.pass_context
|
|
44
|
+
def probe(ctx, output, save):
|
|
45
|
+
"""Probe and analyze the Jetson system configuration."""
|
|
46
|
+
console.print(Panel("[bold blue]Probing Jetson System[/bold blue]", expand=False))
|
|
47
|
+
|
|
48
|
+
script_path = get_script_path('probe-system.sh')
|
|
49
|
+
|
|
50
|
+
with Progress(
|
|
51
|
+
SpinnerColumn(),
|
|
52
|
+
TextColumn("[progress.description]{task.description}"),
|
|
53
|
+
console=console,
|
|
54
|
+
) as progress:
|
|
55
|
+
task = progress.add_task("Analyzing system...", total=None)
|
|
56
|
+
|
|
57
|
+
try:
|
|
58
|
+
result = run_script(script_path, verbose=ctx.obj['verbose'])
|
|
59
|
+
|
|
60
|
+
if output == 'table':
|
|
61
|
+
console.print("\n[bold green]System Probe Results:[/bold green]")
|
|
62
|
+
console.print(result.stdout)
|
|
63
|
+
elif output in ['json', 'yaml']:
|
|
64
|
+
# Parse and format structured output
|
|
65
|
+
console.print(f"\n[bold green]System Probe Results ({output}):[/bold green]")
|
|
66
|
+
console.print(result.stdout)
|
|
67
|
+
|
|
68
|
+
if save:
|
|
69
|
+
with open(save, 'w') as f:
|
|
70
|
+
f.write(result.stdout)
|
|
71
|
+
console.print(f"\n[green]Results saved to {save}[/green]")
|
|
72
|
+
|
|
73
|
+
except subprocess.CalledProcessError as e:
|
|
74
|
+
console.print(f"[red]Error running probe: {e}[/red]")
|
|
75
|
+
sys.exit(1)
|
|
76
|
+
|
|
77
|
+
@cli.command()
|
|
78
|
+
@click.option('--profile-name', '-n', default='jetson-dev',
|
|
79
|
+
help='Name for the environment profile')
|
|
80
|
+
@click.option('--force', '-f', is_flag=True, help='Force recreate existing profile')
|
|
81
|
+
@click.pass_context
|
|
82
|
+
def init(ctx, profile_name, force):
|
|
83
|
+
"""Initialize and create environment profile for Jetson development."""
|
|
84
|
+
console.print(Panel(f"[bold blue]Initializing Environment Profile: {profile_name}[/bold blue]", expand=False))
|
|
85
|
+
|
|
86
|
+
script_path = get_script_path('create-env-profile.sh')
|
|
87
|
+
|
|
88
|
+
with Progress(
|
|
89
|
+
SpinnerColumn(),
|
|
90
|
+
TextColumn("[progress.description]{task.description}"),
|
|
91
|
+
console=console,
|
|
92
|
+
) as progress:
|
|
93
|
+
task = progress.add_task("Creating environment profile...", total=None)
|
|
94
|
+
|
|
95
|
+
try:
|
|
96
|
+
env = os.environ.copy()
|
|
97
|
+
env['PROFILE_NAME'] = profile_name
|
|
98
|
+
if force:
|
|
99
|
+
env['FORCE_RECREATE'] = 'true'
|
|
100
|
+
|
|
101
|
+
result = run_script(script_path, env=env, verbose=ctx.obj['verbose'])
|
|
102
|
+
console.print("\n[bold green]Environment Profile Created Successfully![/bold green]")
|
|
103
|
+
console.print(result.stdout)
|
|
104
|
+
|
|
105
|
+
except subprocess.CalledProcessError as e:
|
|
106
|
+
console.print(f"[red]Error creating profile: {e}[/red]")
|
|
107
|
+
sys.exit(1)
|
|
108
|
+
|
|
109
|
+
@cli.command()
|
|
110
|
+
@click.option('--skip-docker', is_flag=True, help='Skip Docker configuration')
|
|
111
|
+
@click.option('--skip-swap', is_flag=True, help='Skip swap configuration')
|
|
112
|
+
@click.option('--skip-ssd', is_flag=True, help='Skip SSD configuration')
|
|
113
|
+
@click.option('--interactive/--non-interactive', default=True,
|
|
114
|
+
help='Run in interactive or non-interactive mode')
|
|
115
|
+
@click.pass_context
|
|
116
|
+
def setup(ctx, skip_docker, skip_swap, skip_ssd, interactive):
|
|
117
|
+
"""Run complete Jetson system setup and configuration."""
|
|
118
|
+
console.print(Panel("[bold blue]Jetson System Setup[/bold blue]", expand=False))
|
|
119
|
+
|
|
120
|
+
script_path = get_script_path('setup-system.sh')
|
|
121
|
+
|
|
122
|
+
with Progress(
|
|
123
|
+
SpinnerColumn(),
|
|
124
|
+
TextColumn("[progress.description]{task.description}"),
|
|
125
|
+
console=console,
|
|
126
|
+
) as progress:
|
|
127
|
+
task = progress.add_task("Setting up system...", total=None)
|
|
128
|
+
|
|
129
|
+
try:
|
|
130
|
+
env = os.environ.copy()
|
|
131
|
+
env['INTERACTIVE_MODE'] = 'true' if interactive else 'false'
|
|
132
|
+
if skip_docker:
|
|
133
|
+
env['SKIP_DOCKER'] = 'true'
|
|
134
|
+
if skip_swap:
|
|
135
|
+
env['SKIP_SWAP'] = 'true'
|
|
136
|
+
if skip_ssd:
|
|
137
|
+
env['SKIP_SSD'] = 'true'
|
|
138
|
+
|
|
139
|
+
result = run_script(script_path, env=env, verbose=ctx.obj['verbose'])
|
|
140
|
+
console.print("\n[bold green]System Setup Completed Successfully![/bold green]")
|
|
141
|
+
console.print(result.stdout)
|
|
142
|
+
|
|
143
|
+
except subprocess.CalledProcessError as e:
|
|
144
|
+
console.print(f"[red]Error during setup: {e}[/red]")
|
|
145
|
+
sys.exit(1)
|
|
146
|
+
|
|
147
|
+
@cli.command()
|
|
148
|
+
@click.argument('component', type=click.Choice(['docker', 'swap', 'ssd', 'power', 'gui']))
|
|
149
|
+
@click.pass_context
|
|
150
|
+
def configure(ctx, component):
|
|
151
|
+
"""Configure specific system components."""
|
|
152
|
+
console.print(Panel(f"[bold blue]Configuring {component.upper()}[/bold blue]", expand=False))
|
|
153
|
+
|
|
154
|
+
script_map = {
|
|
155
|
+
'docker': 'configure-docker.sh',
|
|
156
|
+
'swap': 'configure-swap.sh',
|
|
157
|
+
'ssd': 'configure-ssd.sh',
|
|
158
|
+
'power': 'configure-power-mode.sh',
|
|
159
|
+
'gui': 'configure-system-gui.sh'
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
script_path = get_script_path(script_map[component])
|
|
163
|
+
|
|
164
|
+
with Progress(
|
|
165
|
+
SpinnerColumn(),
|
|
166
|
+
TextColumn("[progress.description]{task.description}"),
|
|
167
|
+
console=console,
|
|
168
|
+
) as progress:
|
|
169
|
+
task = progress.add_task(f"Configuring {component}...", total=None)
|
|
170
|
+
|
|
171
|
+
try:
|
|
172
|
+
result = run_script(script_path, verbose=ctx.obj['verbose'])
|
|
173
|
+
console.print(f"\n[bold green]{component.upper()} Configuration Completed![/bold green]")
|
|
174
|
+
console.print(result.stdout)
|
|
175
|
+
|
|
176
|
+
except subprocess.CalledProcessError as e:
|
|
177
|
+
console.print(f"[red]Error configuring {component}: {e}[/red]")
|
|
178
|
+
sys.exit(1)
|
|
179
|
+
|
|
180
|
+
@cli.command()
|
|
181
|
+
@click.option('--format', 'output_format', type=click.Choice(['table', 'json']),
|
|
182
|
+
default='table', help='Output format')
|
|
183
|
+
def status(output_format):
|
|
184
|
+
"""Show current Jetson system status and configuration."""
|
|
185
|
+
console.print(Panel("[bold blue]Jetson System Status[/bold blue]", expand=False))
|
|
186
|
+
|
|
187
|
+
# This would integrate with existing system status checks
|
|
188
|
+
table = Table()
|
|
189
|
+
table.add_column("Component", style="cyan")
|
|
190
|
+
table.add_column("Status", style="magenta")
|
|
191
|
+
table.add_column("Details", style="green")
|
|
192
|
+
|
|
193
|
+
# Add status rows based on system checks
|
|
194
|
+
table.add_row("Platform", "✓ Jetson Detected", "NVIDIA Jetson AGX Orin")
|
|
195
|
+
table.add_row("Docker", "✓ Running", "24.0.7")
|
|
196
|
+
table.add_row("Containers", "✓ Available", "45 packages")
|
|
197
|
+
|
|
198
|
+
console.print(table)
|
|
199
|
+
|
|
200
|
+
def main():
|
|
201
|
+
"""Main entry point for the CLI."""
|
|
202
|
+
cli()
|
|
203
|
+
|
|
204
|
+
if __name__ == '__main__':
|
|
205
|
+
main()
|
jetson_cli/utils.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import subprocess
|
|
6
|
+
import platform
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
|
|
9
|
+
def get_package_root():
|
|
10
|
+
"""Get the root directory of the jetson-cli package."""
|
|
11
|
+
return Path(__file__).parent
|
|
12
|
+
|
|
13
|
+
def get_script_path(script_name):
|
|
14
|
+
"""Get the full path to a script file."""
|
|
15
|
+
# First try the package scripts directory
|
|
16
|
+
package_script = get_package_root() / 'scripts' / script_name
|
|
17
|
+
if package_script.exists():
|
|
18
|
+
return str(package_script)
|
|
19
|
+
|
|
20
|
+
# Then try the repository scripts directory
|
|
21
|
+
repo_script = get_package_root().parent / 'scripts' / script_name
|
|
22
|
+
if repo_script.exists():
|
|
23
|
+
return str(repo_script)
|
|
24
|
+
|
|
25
|
+
raise FileNotFoundError(f"Script {script_name} not found in expected locations")
|
|
26
|
+
|
|
27
|
+
def run_script(script_path, env=None, verbose=False):
|
|
28
|
+
"""Run a shell script and return the result."""
|
|
29
|
+
if not os.path.exists(script_path):
|
|
30
|
+
raise FileNotFoundError(f"Script not found: {script_path}")
|
|
31
|
+
|
|
32
|
+
# Make script executable
|
|
33
|
+
os.chmod(script_path, 0o755)
|
|
34
|
+
|
|
35
|
+
# Prepare environment
|
|
36
|
+
script_env = os.environ.copy()
|
|
37
|
+
if env:
|
|
38
|
+
script_env.update(env)
|
|
39
|
+
|
|
40
|
+
if verbose:
|
|
41
|
+
print(f"Running script: {script_path}")
|
|
42
|
+
if env:
|
|
43
|
+
print(f"Environment variables: {env}")
|
|
44
|
+
|
|
45
|
+
# Run the script
|
|
46
|
+
result = subprocess.run(
|
|
47
|
+
['bash', script_path],
|
|
48
|
+
env=script_env,
|
|
49
|
+
capture_output=True,
|
|
50
|
+
text=True,
|
|
51
|
+
check=True
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
return result
|
|
55
|
+
|
|
56
|
+
def check_jetson_platform():
|
|
57
|
+
"""Check if running on a Jetson platform."""
|
|
58
|
+
try:
|
|
59
|
+
# Check for common Jetson indicators
|
|
60
|
+
jetson_indicators = [
|
|
61
|
+
'/proc/device-tree/model',
|
|
62
|
+
'/etc/nv_tegra_release',
|
|
63
|
+
'/sys/firmware/devicetree/base/model'
|
|
64
|
+
]
|
|
65
|
+
|
|
66
|
+
for indicator in jetson_indicators:
|
|
67
|
+
if os.path.exists(indicator):
|
|
68
|
+
try:
|
|
69
|
+
with open(indicator, 'r') as f:
|
|
70
|
+
content = f.read().lower()
|
|
71
|
+
if 'jetson' in content or 'tegra' in content or 'nvidia' in content:
|
|
72
|
+
return True
|
|
73
|
+
except:
|
|
74
|
+
continue
|
|
75
|
+
|
|
76
|
+
# Check architecture
|
|
77
|
+
if platform.machine() == 'aarch64':
|
|
78
|
+
# Additional check for NVIDIA GPU
|
|
79
|
+
try:
|
|
80
|
+
result = subprocess.run(['nvidia-smi'], capture_output=True, text=True)
|
|
81
|
+
if result.returncode == 0 and 'jetson' in result.stdout.lower():
|
|
82
|
+
return True
|
|
83
|
+
except:
|
|
84
|
+
pass
|
|
85
|
+
|
|
86
|
+
return False
|
|
87
|
+
|
|
88
|
+
except Exception:
|
|
89
|
+
return False
|
|
90
|
+
|
|
91
|
+
def get_jetson_info():
|
|
92
|
+
"""Get detailed Jetson platform information."""
|
|
93
|
+
info = {
|
|
94
|
+
'platform': 'Unknown',
|
|
95
|
+
'l4t_version': 'Unknown',
|
|
96
|
+
'jetpack_version': 'Unknown',
|
|
97
|
+
'cuda_version': 'Unknown',
|
|
98
|
+
'architecture': platform.machine()
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
try:
|
|
102
|
+
# Get model information
|
|
103
|
+
if os.path.exists('/proc/device-tree/model'):
|
|
104
|
+
with open('/proc/device-tree/model', 'r') as f:
|
|
105
|
+
info['platform'] = f.read().strip().replace('\x00', '')
|
|
106
|
+
|
|
107
|
+
# Get L4T version
|
|
108
|
+
if os.path.exists('/etc/nv_tegra_release'):
|
|
109
|
+
with open('/etc/nv_tegra_release', 'r') as f:
|
|
110
|
+
content = f.read()
|
|
111
|
+
# Parse version from content like "R35 (release), REVISION: 4.1"
|
|
112
|
+
import re
|
|
113
|
+
match = re.search(r'R(\d+)\s+\(release\),\s+REVISION:\s+([\d.]+)', content)
|
|
114
|
+
if match:
|
|
115
|
+
info['l4t_version'] = f"{match.group(1)}.{match.group(2)}"
|
|
116
|
+
|
|
117
|
+
# Get CUDA version
|
|
118
|
+
try:
|
|
119
|
+
result = subprocess.run(['nvcc', '--version'], capture_output=True, text=True)
|
|
120
|
+
if result.returncode == 0:
|
|
121
|
+
import re
|
|
122
|
+
match = re.search(r'release (\d+\.\d+)', result.stdout)
|
|
123
|
+
if match:
|
|
124
|
+
info['cuda_version'] = match.group(1)
|
|
125
|
+
except:
|
|
126
|
+
pass
|
|
127
|
+
|
|
128
|
+
except Exception:
|
|
129
|
+
pass
|
|
130
|
+
|
|
131
|
+
return info
|
|
132
|
+
|
|
133
|
+
def ensure_root():
|
|
134
|
+
"""Ensure the script is running with root privileges."""
|
|
135
|
+
if os.geteuid() != 0:
|
|
136
|
+
raise PermissionError("This command requires root privileges. Please run with sudo.")
|
|
137
|
+
|
|
138
|
+
def format_size(bytes_value):
|
|
139
|
+
"""Format bytes to human readable format."""
|
|
140
|
+
for unit in ['B', 'KB', 'MB', 'GB', 'TB']:
|
|
141
|
+
if bytes_value < 1024.0:
|
|
142
|
+
return f"{bytes_value:.1f} {unit}"
|
|
143
|
+
bytes_value /= 1024.0
|
|
144
|
+
return f"{bytes_value:.1f} PB"
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jetson-cli
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Command-line interface for NVIDIA Jetson setup and configuration
|
|
5
|
+
Home-page: https://github.com/your-org/jetson-setup
|
|
6
|
+
Author: Jetson Setup Team
|
|
7
|
+
Author-email: Jetson Setup Team <support@jetson-setup.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/your-org/jetson-setup
|
|
10
|
+
Project-URL: Documentation, https://github.com/your-org/jetson-setup/blob/main/README.md
|
|
11
|
+
Project-URL: Repository, https://github.com/your-org/jetson-setup.git
|
|
12
|
+
Project-URL: Bug Reports, https://github.com/your-org/jetson-setup/issues
|
|
13
|
+
Keywords: jetson,nvidia,embedded,ai,ml,docker,containers,setup
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: Intended Audience :: System Administrators
|
|
18
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
19
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
26
|
+
Classifier: Topic :: System :: Systems Administration
|
|
27
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
28
|
+
Classifier: Topic :: Utilities
|
|
29
|
+
Requires-Python: >=3.8
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
License-File: LICENSE
|
|
32
|
+
Requires-Dist: click>=8.0.0
|
|
33
|
+
Requires-Dist: pyyaml>=6.0
|
|
34
|
+
Requires-Dist: tabulate>=0.9.0
|
|
35
|
+
Requires-Dist: packaging>=20.0
|
|
36
|
+
Requires-Dist: psutil>=5.8.0
|
|
37
|
+
Requires-Dist: rich>=12.0.0
|
|
38
|
+
Provides-Extra: dev
|
|
39
|
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
|
40
|
+
Requires-Dist: pytest-cov>=2.0; extra == "dev"
|
|
41
|
+
Requires-Dist: black>=22.0; extra == "dev"
|
|
42
|
+
Requires-Dist: flake8>=4.0; extra == "dev"
|
|
43
|
+
Requires-Dist: isort>=5.0; extra == "dev"
|
|
44
|
+
Requires-Dist: bump2version>=1.0; extra == "dev"
|
|
45
|
+
Dynamic: author
|
|
46
|
+
Dynamic: home-page
|
|
47
|
+
Dynamic: license-file
|
|
48
|
+
Dynamic: requires-python
|
|
49
|
+
|
|
50
|
+
# jetson-cli
|
|
51
|
+
|
|
52
|
+
A comprehensive CLI tool for setting up NVIDIA Jetson devices and building containerized AI/ML applications using the jetson-containers framework.
|
|
53
|
+
|
|
54
|
+
## Overview
|
|
55
|
+
|
|
56
|
+
jetson-cli provides a streamlined interface for:
|
|
57
|
+
- Analyzing and configuring Jetson hardware
|
|
58
|
+
- Setting up development environments
|
|
59
|
+
- Building and running containerized AI/ML applications
|
|
60
|
+
- Managing the jetson-containers ecosystem
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
### From PyPI (Recommended)
|
|
65
|
+
```bash
|
|
66
|
+
pip install jetson-cli
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### From Source
|
|
70
|
+
```bash
|
|
71
|
+
git clone https://github.com/orinachum/jetson-cli.git
|
|
72
|
+
cd jetson-cli
|
|
73
|
+
pip install -e .
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Quick Start
|
|
77
|
+
|
|
78
|
+
1. **Analyze your system**:
|
|
79
|
+
```bash
|
|
80
|
+
jetson-cli probe
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
2. **Initialize environment**:
|
|
84
|
+
```bash
|
|
85
|
+
jetson-cli init
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
3. **Complete setup**:
|
|
89
|
+
```bash
|
|
90
|
+
jetson-cli setup
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Commands
|
|
94
|
+
|
|
95
|
+
### System Analysis
|
|
96
|
+
```bash
|
|
97
|
+
jetson-cli probe # Show system configuration
|
|
98
|
+
jetson-cli probe --output json # Output as JSON
|
|
99
|
+
jetson-cli probe --save config.yaml # Save to file
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Environment Setup
|
|
103
|
+
```bash
|
|
104
|
+
jetson-cli init # Create environment profile
|
|
105
|
+
jetson-cli init --profile-name dev # Custom profile name
|
|
106
|
+
jetson-cli init --force # Overwrite existing profile
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### System Configuration
|
|
110
|
+
```bash
|
|
111
|
+
jetson-cli setup # Complete system setup
|
|
112
|
+
jetson-cli setup --skip-docker # Skip Docker configuration
|
|
113
|
+
jetson-cli setup --interactive # Interactive mode
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Component Management
|
|
117
|
+
```bash
|
|
118
|
+
jetson-cli configure docker # Configure Docker daemon
|
|
119
|
+
jetson-cli configure swap # Setup swap file
|
|
120
|
+
jetson-cli configure ssd # Configure SSD storage
|
|
121
|
+
jetson-cli configure power # Power management settings
|
|
122
|
+
jetson-cli configure gui # GUI environment setup
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Status Monitoring
|
|
126
|
+
```bash
|
|
127
|
+
jetson-cli status # Show system status
|
|
128
|
+
jetson-cli status --format json # JSON output format
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## jetson-containers Integration
|
|
132
|
+
|
|
133
|
+
This tool integrates with the [jetson-containers](https://github.com/dusty-nv/jetson-containers) framework to provide containerized AI/ML packages:
|
|
134
|
+
|
|
135
|
+
### Container Building
|
|
136
|
+
```bash
|
|
137
|
+
# After jetson-cli setup, use jetson-containers directly
|
|
138
|
+
jetson-containers build pytorch # Build PyTorch container
|
|
139
|
+
jetson-containers build pytorch jupyterlab # Chain multiple packages
|
|
140
|
+
jetson-containers build --name=my_app pytorch # Custom container name
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### Available Packages
|
|
144
|
+
- **ML/AI**: PyTorch, TensorFlow, ONNX Runtime, transformers
|
|
145
|
+
- **LLM**: SGLang, vLLM, MLC, text-generation-webui, ollama
|
|
146
|
+
- **VLM**: LLaVA, VILA, NanoLLM (vision-language models)
|
|
147
|
+
- **Robotics**: ROS, Genesis, OpenVLA, LeRobot
|
|
148
|
+
- **Computer Vision**: NanoOWL, SAM, CLIP, DeepStream
|
|
149
|
+
- **Graphics**: Stable Diffusion, ComfyUI, NeRF Studio
|
|
150
|
+
|
|
151
|
+
### Running Containers
|
|
152
|
+
```bash
|
|
153
|
+
jetson-containers run $(autotag l4t-pytorch)
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Examples
|
|
157
|
+
|
|
158
|
+
### Complete Jetson Setup Workflow
|
|
159
|
+
```bash
|
|
160
|
+
# 1. Analyze hardware and software configuration
|
|
161
|
+
jetson-cli probe --save system-info.yaml
|
|
162
|
+
|
|
163
|
+
# 2. Create development environment profile
|
|
164
|
+
jetson-cli init --profile-name ml-dev
|
|
165
|
+
|
|
166
|
+
# 3. Configure the system for AI/ML development
|
|
167
|
+
jetson-cli setup
|
|
168
|
+
|
|
169
|
+
# 4. Verify everything is working
|
|
170
|
+
jetson-cli status
|
|
171
|
+
|
|
172
|
+
# 5. Build and run your first container
|
|
173
|
+
jetson-containers build pytorch
|
|
174
|
+
jetson-containers run $(autotag l4t-pytorch)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Selective Component Configuration
|
|
178
|
+
```bash
|
|
179
|
+
# Configure only Docker (skip other components)
|
|
180
|
+
jetson-cli configure docker
|
|
181
|
+
|
|
182
|
+
# Setup additional swap space
|
|
183
|
+
jetson-cli configure swap
|
|
184
|
+
|
|
185
|
+
# Configure external SSD storage
|
|
186
|
+
jetson-cli configure ssd
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Architecture
|
|
190
|
+
|
|
191
|
+
- **CLI Interface** (`jetson_cli/`): User-friendly Click-based commands
|
|
192
|
+
- **System Scripts** (`scripts/`): Low-level system configuration scripts
|
|
193
|
+
- **Container Framework** (`jetson-containers/`): Modular container build system
|
|
194
|
+
- **Package Ecosystem**: 100+ pre-built AI/ML container packages
|
|
195
|
+
|
|
196
|
+
## Requirements
|
|
197
|
+
|
|
198
|
+
- NVIDIA Jetson device (Nano, Xavier, Orin series)
|
|
199
|
+
- JetPack 4.6+ or L4T R32.7+
|
|
200
|
+
- Python 3.6+
|
|
201
|
+
- Docker support
|
|
202
|
+
|
|
203
|
+
## Contributing
|
|
204
|
+
|
|
205
|
+
1. Fork the repository
|
|
206
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
207
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
208
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
209
|
+
5. Open a Pull Request
|
|
210
|
+
|
|
211
|
+
## License
|
|
212
|
+
|
|
213
|
+
This project is licensed under the MIT License - see the LICENSE file for details.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
jetson_cli/__init__.py,sha256=pJk6YAN5LoBiFMfNmygNMVjQ26bFOaPetWXfoAV8g0k,265
|
|
2
|
+
jetson_cli/cli.py,sha256=Ly0vO8W9LqczZD4CXfyctdSZCcvRZmy8vVVYW4M9V7k,7914
|
|
3
|
+
jetson_cli/utils.py,sha256=KdEMS80sNpAWBOqN61apgqCBMCjhTq0c7qupFMinoIw,4581
|
|
4
|
+
jetson_cli-0.2.0.dist-info/licenses/LICENSE,sha256=jJnyrnBC95oQatcQP9bJ6rIE_IWU9Tt2LW86bbmLvXo,1067
|
|
5
|
+
jetson_cli-0.2.0.dist-info/METADATA,sha256=eoj3aPn8gh5fDdvid9Fhy5u3yRApDlRc0TLacd7DTfQ,6480
|
|
6
|
+
jetson_cli-0.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
7
|
+
jetson_cli-0.2.0.dist-info/entry_points.txt,sha256=_IyXcK5_DOSRU4xMQwLaJ0vfsrpxjp8SAnGNR2nS_yY,51
|
|
8
|
+
jetson_cli-0.2.0.dist-info/top_level.txt,sha256=FPoWe1pwUqIZ-qrpCwXuNywkr06FHiilckkwfKSgrfw,11
|
|
9
|
+
jetson_cli-0.2.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ori Nachum
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
jetson_cli
|