fix: replace datetime.UTC with timezone.utc for Python 3.12+ compatibility
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 22s
Blockchain Synchronization Verification / sync-verification (push) Successful in 3s
CLI Tests / test-cli (push) Failing after 13s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Failing after 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m34s
Documentation Validation / validate-docs (push) Failing after 10s
Documentation Validation / validate-policies-strict (push) Successful in 3s
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Integration Tests / test-service-integration (push) Successful in 2m42s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 3s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 5s
P2P Network Verification / p2p-verification (push) Successful in 3s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 33s
Package Tests / Python package - aitbc-core (push) Successful in 17s
Package Tests / Python package - aitbc-crypto (push) Successful in 11s
Security Scanning / security-scan (push) Has been cancelled
Package Tests / Python package - aitbc-sdk (push) Successful in 13s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 9s
Package Tests / JavaScript package - aitbc-token (push) Successful in 17s
Staking Tests / test-staking-service (push) Failing after 6s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 22s
Blockchain Synchronization Verification / sync-verification (push) Successful in 3s
CLI Tests / test-cli (push) Failing after 13s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Failing after 3s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-bridge (push) Has been skipped
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Failing after 3s
Cross-Chain Functionality Tests / aggregate-results (push) Has been skipped
Cross-Node Transaction Testing / transaction-test (push) Successful in 2s
Deploy to Testnet / deploy-testnet (push) Successful in 1m34s
Documentation Validation / validate-docs (push) Failing after 10s
Documentation Validation / validate-policies-strict (push) Successful in 3s
Multi-Node Stress Testing / stress-test (push) Has been cancelled
Node Failover Simulation / failover-test (push) Has been cancelled
Python Tests / test-python (push) Has been cancelled
Integration Tests / test-service-integration (push) Successful in 2m42s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 3s
Multi-Node Blockchain Health Monitoring / health-check (push) Successful in 5s
P2P Network Verification / p2p-verification (push) Successful in 3s
Package Tests / Python package - aitbc-agent-sdk (push) Failing after 33s
Package Tests / Python package - aitbc-core (push) Successful in 17s
Package Tests / Python package - aitbc-crypto (push) Successful in 11s
Security Scanning / security-scan (push) Has been cancelled
Package Tests / Python package - aitbc-sdk (push) Successful in 13s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 9s
Package Tests / JavaScript package - aitbc-token (push) Successful in 17s
Staking Tests / test-staking-service (push) Failing after 6s
Staking Tests / test-staking-integration (push) Has been skipped
Staking Tests / test-staking-contract (push) Has been skipped
Staking Tests / run-staking-test-runner (push) Has been skipped
This commit is contained in:
@@ -11,7 +11,7 @@ import json
|
||||
import subprocess
|
||||
import tempfile
|
||||
import shutil
|
||||
from datetime import datetime, UTC, timezone
|
||||
from datetime import datetime, timezone, timezone
|
||||
|
||||
GITEA_TOKEN = os.getenv('GITEA_TOKEN') or 'ffce3b62d583b761238ae00839dce7718acaad85'
|
||||
REPO = 'oib/aitbc'
|
||||
@@ -80,7 +80,7 @@ def is_claim_expired(state):
|
||||
expires_at = state.get('expires_at')
|
||||
if not expires_at:
|
||||
return False
|
||||
now_ts = datetime.now(datetime.UTC).timestamp()
|
||||
now_ts = datetime.now(timezone.utc).timestamp()
|
||||
return now_ts > expires_at
|
||||
|
||||
def get_open_prs():
|
||||
@@ -135,7 +135,7 @@ def validate_pr_branch(pr):
|
||||
shutil.rmtree(tmpdir, ignore_errors=True)
|
||||
|
||||
def main():
|
||||
now = datetime.now(datetime.UTC).replace(tzinfo=timezone.utc)
|
||||
now = datetime.now(timezone.utc).replace(tzinfo=timezone.utc)
|
||||
now_iso = now.isoformat()
|
||||
now_ts = now.timestamp()
|
||||
print(f"[{now_iso}] Monitoring PRs and claim locks...")
|
||||
@@ -218,7 +218,7 @@ def main():
|
||||
def cleanup_global_expired_claims(now_ts=None):
|
||||
"""Delete remote claim branches that are older than TTL, even if state file is gone."""
|
||||
if now_ts is None:
|
||||
now_ts = datetime.now(datetime.UTC).timestamp()
|
||||
now_ts = datetime.now(timezone.utc).timestamp()
|
||||
# List all remote claim branches
|
||||
result = subprocess.run(['git', 'ls-remote', '--heads', 'origin', 'claim/*'],
|
||||
capture_output=True, text=True, cwd='/opt/aitbc')
|
||||
|
||||
@@ -9,7 +9,7 @@ import sys
|
||||
import json
|
||||
import subprocess
|
||||
import logging
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Any, Tuple
|
||||
import hashlib
|
||||
@@ -25,7 +25,7 @@ class SecurityAudit:
|
||||
def __init__(self, project_root: str = "/opt/aitbc"):
|
||||
self.project_root = Path(project_root)
|
||||
self.results = {
|
||||
"timestamp": datetime.now(datetime.UTC).isoformat(),
|
||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
||||
"audit_version": "v0.2.0",
|
||||
"findings": [],
|
||||
"score": 0,
|
||||
|
||||
@@ -10,7 +10,7 @@ import logging
|
||||
import sys
|
||||
import subprocess
|
||||
import os
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
|
||||
# Configuration
|
||||
COORDINATOR_URL = "http://127.0.0.1:8011"
|
||||
@@ -147,7 +147,7 @@ def send_heartbeat():
|
||||
heartbeat_data = {
|
||||
"status": "active",
|
||||
"current_jobs": 0,
|
||||
"last_seen": datetime.now(datetime.UTC).isoformat(),
|
||||
"last_seen": datetime.now(timezone.utc).isoformat(),
|
||||
"gpu_utilization": gpu_info["utilization"],
|
||||
"memory_used": gpu_info["memory_used"],
|
||||
"memory_total": gpu_info["memory_total"]
|
||||
@@ -156,7 +156,7 @@ def send_heartbeat():
|
||||
heartbeat_data = {
|
||||
"status": "active",
|
||||
"current_jobs": 0,
|
||||
"last_seen": datetime.now(datetime.UTC).isoformat(),
|
||||
"last_seen": datetime.now(timezone.utc).isoformat(),
|
||||
"gpu_utilization": 0,
|
||||
"memory_used": 0,
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ from fastapi import FastAPI, HTTPException
|
||||
from pydantic import BaseModel
|
||||
from typing import Dict, Any, Optional
|
||||
import uvicorn
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
|
||||
app = FastAPI(title="GPU Registry Demo")
|
||||
|
||||
@@ -37,8 +37,8 @@ async def register_gpu(miner_id: str, gpu_data: GPURegistration):
|
||||
"""Register a GPU miner"""
|
||||
registered_gpus[miner_id] = {
|
||||
"id": miner_id,
|
||||
"registered_at": datetime.now(datetime.UTC).isoformat(),
|
||||
"last_heartbeat": datetime.now(datetime.UTC).isoformat(),
|
||||
"registered_at": datetime.now(timezone.utc).isoformat(),
|
||||
"last_heartbeat": datetime.now(timezone.utc).isoformat(),
|
||||
**gpu_data.dict()
|
||||
}
|
||||
return {"status": "ok", "message": f"GPU {miner_id} registered successfully"}
|
||||
@@ -49,7 +49,7 @@ async def heartbeat(miner_id: str, heartbeat_data: Heartbeat):
|
||||
if miner_id not in registered_gpus:
|
||||
raise HTTPException(status_code=404, detail="GPU not registered")
|
||||
|
||||
registered_gpus[miner_id]["last_heartbeat"] = datetime.now(datetime.UTC).isoformat()
|
||||
registered_gpus[miner_id]["last_heartbeat"] = datetime.now(timezone.utc).isoformat()
|
||||
registered_gpus[miner_id]["status"] = heartbeat_data.status
|
||||
registered_gpus[miner_id]["metadata"] = heartbeat_data.metadata
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import sys
|
||||
import shutil
|
||||
import time
|
||||
import random
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
# Jitter: random delay up to 15 minutes (900 seconds)
|
||||
|
||||
@@ -6,7 +6,7 @@ Uses Git branch atomic creation as a distributed lock to prevent duplicate work.
|
||||
import os
|
||||
import json
|
||||
import subprocess
|
||||
from datetime import datetime, UTC, timedelta
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
REPO_DIR = '/opt/aitbc'
|
||||
STATE_FILE = '/opt/aitbc/.claim-state.json'
|
||||
@@ -106,7 +106,7 @@ def create_work_branch(issue_number, title):
|
||||
return branch_name
|
||||
|
||||
def main():
|
||||
now = datetime.now(datetime.UTC)
|
||||
now = datetime.now(timezone.utc)
|
||||
print(f"[{now.isoformat()}Z] Claim task cycle starting...")
|
||||
|
||||
state = load_state()
|
||||
@@ -155,7 +155,7 @@ def main():
|
||||
'current_claim': num,
|
||||
'claim_branch': f'claim/{num}',
|
||||
'work_branch': work_branch,
|
||||
'claimed_at': datetime.now(datetime.UTC).isoformat() + 'Z',
|
||||
'claimed_at': datetime.now(timezone.utc).isoformat() + 'Z',
|
||||
'issue_title': title,
|
||||
'labels': labels
|
||||
})
|
||||
|
||||
@@ -10,7 +10,7 @@ sys.path.insert(0, '/home/oib/windsurf/aitbc/apps/coordinator-api/src')
|
||||
from sqlmodel import Session, select
|
||||
from app.database import engine, create_db_and_tables
|
||||
from app.domain.gpu_marketplace import GPURegistry, GPUBooking
|
||||
from datetime import datetime, UTC, timedelta
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
def fix_gpu_release():
|
||||
"""Fix GPU release issue by ensuring proper booking records exist"""
|
||||
@@ -40,7 +40,7 @@ def fix_gpu_release():
|
||||
print("❌ No active booking found, creating one...")
|
||||
|
||||
# Create a booking record
|
||||
now = datetime.now(datetime.UTC)
|
||||
now = datetime.now(timezone.utc)
|
||||
booking = GPUBooking(
|
||||
gpu_id=gpu_id,
|
||||
client_id="localhost-user",
|
||||
|
||||
@@ -8,7 +8,7 @@ Generates cryptographically secure API keys for testing CLI commands
|
||||
import secrets
|
||||
import json
|
||||
import sys
|
||||
from datetime import datetime, UTC, timedelta
|
||||
from datetime import datetime, timezone, timedelta
|
||||
|
||||
def generate_api_key(length=32):
|
||||
"""Generate a cryptographically secure API key"""
|
||||
@@ -23,8 +23,8 @@ def create_api_key_entry(name, permissions="client", environment="default"):
|
||||
"api_key": api_key, # Stored in memory only, masked when printed
|
||||
"permissions": permissions.split(",") if isinstance(permissions, str) else permissions,
|
||||
"environment": environment,
|
||||
"created_at": datetime.now(datetime.UTC).isoformat(),
|
||||
"expires_at": (datetime.now(datetime.UTC) + timedelta(days=365)).isoformat(),
|
||||
"created_at": datetime.now(timezone.utc).isoformat(),
|
||||
"expires_at": (datetime.now(timezone.utc) + timedelta(days=365)).isoformat(),
|
||||
"status": "active"
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import hashlib
|
||||
import json
|
||||
import os
|
||||
import secrets
|
||||
from datetime import datetime, UTC
|
||||
from datetime import datetime, timezone
|
||||
from pathlib import Path
|
||||
|
||||
from cryptography.fernet import Fernet
|
||||
@@ -55,7 +55,7 @@ def create_keystore(address: str, password: str, keystore_dir: Path | str = "/va
|
||||
keystore = {
|
||||
"address": address,
|
||||
"crypto": encrypted,
|
||||
"created_at": datetime.now(datetime.UTC).isoformat() + "Z",
|
||||
"created_at": datetime.now(timezone.utc).isoformat() + "Z",
|
||||
}
|
||||
|
||||
out_file.write_text(json.dumps(keystore, indent=2))
|
||||
@@ -100,7 +100,7 @@ def main() -> None:
|
||||
keystore = {
|
||||
"address": args.address,
|
||||
"crypto": encrypted,
|
||||
"created_at": datetime.now(datetime.UTC).isoformat() + "Z",
|
||||
"created_at": datetime.now(timezone.utc).isoformat() + "Z",
|
||||
}
|
||||
|
||||
out_file.write_text(json.dumps(keystore, indent=2))
|
||||
|
||||
Reference in New Issue
Block a user