change push_action to a_push_action in enqueue cli

pull/9/head
Konstantine Tsafatinos 2023-06-26 21:11:24 -04:00
parent c8471ff85b
commit 1b80de6228
1 changed files with 21 additions and 8 deletions

View File

@ -13,7 +13,7 @@ import asyncio
import requests import requests
from leap.cleos import CLEOS from leap.cleos import CLEOS
from leap.sugar import collect_stdout from leap.sugar import collect_stdout, Name
from leap.hyperion import HyperionAPI from leap.hyperion import HyperionAPI
from skynet.ipfs import IPFSHTTP from skynet.ipfs import IPFSHTTP
@ -100,6 +100,7 @@ def download():
'--node-url', '-n', default='https://skynet.ancap.tech') '--node-url', '-n', default='https://skynet.ancap.tech')
@click.option( @click.option(
'--reward', '-r', default='20.0000 GPU') '--reward', '-r', default='20.0000 GPU')
@click.option('--jobs', '-j', default=1)
@click.option('--algo', '-a', default='midj') @click.option('--algo', '-a', default='midj')
@click.option( @click.option(
'--prompt', '-p', default='a red old tractor in a sunny wheat field') '--prompt', '-p', default='a red old tractor in a sunny wheat field')
@ -110,14 +111,13 @@ def download():
@click.option('--step', '-s', default=26) @click.option('--step', '-s', default=26)
@click.option('--seed', '-S', default=None) @click.option('--seed', '-S', default=None)
@click.option('--upscaler', '-U', default='x4') @click.option('--upscaler', '-U', default='x4')
@click.option('--jobs', '-j', default=1)
@click.option('--min-verification', '-mv', default=1)
def enqueue( def enqueue(
account: str, account: str,
permission: str, permission: str,
key: str | None, key: str | None,
node_url: str, node_url: str,
reward: str, reward: str,
jobs: int,
**kwargs **kwargs
): ):
key, account, permission = load_account_info( key, account, permission = load_account_info(
@ -136,12 +136,25 @@ def enqueue(
}) })
binary = '' binary = ''
for i in range(kwargs['jobs']): for i in range(jobs):
ec, out = cleos.push_action( res = trio.run(cleos.a_push_action,
'telos.gpu', 'enqueue', [account, req, binary, reward, kwargs['min-verification']], f'{account}@{permission}' 'telos.gpu',
'enqueue',
{
'user': Name(account),
'request_body': req,
'binary_data': binary,
'reward': reward,
'min_verification': 1
},
# [account, req, binary, reward],
# [account, req, binary, reward, kwargs['min_verification']],
account, key, permission,
#f'{account}@{permission}'
) )
print(collect_stdout(out)) print(res)
assert ec == 0 # print(collect_stdout(out))
# assert ec == 0
@skynet.command() @skynet.command()
@click.option('--loglevel', '-l', default='INFO', help='Logging level') @click.option('--loglevel', '-l', default='INFO', help='Logging level')