Some checks failed
CLI Tests / test-cli (push) Failing after 4s
Deploy to Testnet / deploy-testnet (push) Successful in 1m40s
Documentation Validation / validate-docs (push) Failing after 12s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Successful in 2m42s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 34s
Package Tests / Python package - aitbc-core (push) Successful in 27s
Package Tests / Python package - aitbc-crypto (push) Successful in 13s
Package Tests / Python package - aitbc-sdk (push) Successful in 16s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 8s
Package Tests / JavaScript package - aitbc-token (push) Successful in 18s
Python Tests / test-python (push) Failing after 50s
Security Scanning / security-scan (push) Failing after 43s
Multi-Node Stress Testing / stress-test (push) Successful in 12s
Cross-Node Transaction Testing / transaction-test (push) Successful in 9s
- Created aitbc/_version.py with centralized version definition - Updated aitbc/__init__.py to import __version__ from _version module - Updated constants.py to use __version__ for PACKAGE_VERSION - Replaced print() calls with logger in decorators.py, events.py, queue_manager.py, and state.py - Added logger initialization using get_logger(__name__) in config.py, decorators.py, events.py, queue_manager.py, and state.py - Added cli/commands
74 lines
2.1 KiB
Python
74 lines
2.1 KiB
Python
"""
|
|
Workflow commands for AITBC CLI
|
|
"""
|
|
|
|
import json
|
|
import time
|
|
from typing import Optional
|
|
|
|
import click
|
|
|
|
from ..utils import error, success
|
|
|
|
|
|
@click.group()
|
|
def workflow():
|
|
"""Workflow management commands"""
|
|
pass
|
|
|
|
|
|
@workflow.command()
|
|
@click.argument('workflow_name')
|
|
@click.option('--config', help='Workflow configuration file')
|
|
@click.option('--dry-run', is_flag=True, help='Dry run without executing')
|
|
def run(workflow_name: str, config: Optional[str], dry_run: bool):
|
|
"""Run a workflow"""
|
|
if dry_run:
|
|
success(f"Dry run for workflow {workflow_name}")
|
|
click.echo("Would execute workflow without making changes")
|
|
return
|
|
|
|
success(f"Run workflow {workflow_name}")
|
|
if config:
|
|
click.echo(f"Using config: {config}")
|
|
|
|
# TODO: Implement actual workflow execution logic
|
|
click.echo(f"Execution ID: wf_exec_{int(time.time())}")
|
|
click.echo("Status: Running")
|
|
|
|
|
|
@workflow.command()
|
|
@click.option('--format', type=click.Choice(['table', 'json']), default='table', help='Output format')
|
|
def list(format: str):
|
|
"""List available workflows"""
|
|
success("Available workflows:")
|
|
workflows = [
|
|
{"name": "gpu-marketplace", "status": "active", "steps": 5},
|
|
{"name": "ai-job-processing", "status": "active", "steps": 3},
|
|
{"name": "mining-optimization", "status": "inactive", "steps": 4}
|
|
]
|
|
|
|
if format == 'json':
|
|
click.echo(json.dumps(workflows, indent=2))
|
|
else:
|
|
for wf in workflows:
|
|
click.echo(f" - {wf['name']}: {wf['status']} ({wf['steps']} steps)")
|
|
|
|
|
|
@workflow.command()
|
|
@click.argument('workflow_name')
|
|
def status(workflow_name: str):
|
|
"""Get workflow status"""
|
|
success(f"Get status for workflow {workflow_name}")
|
|
# TODO: Implement actual status check from workflow engine
|
|
click.echo("Status: Not running")
|
|
click.echo("Last execution: Never")
|
|
|
|
|
|
@workflow.command()
|
|
@click.argument('workflow_name')
|
|
def stop(workflow_name: str):
|
|
"""Stop a running workflow"""
|
|
success(f"Stop workflow {workflow_name}")
|
|
# TODO: Implement actual stop command via workflow engine
|