mirror of https://github.com/skygpu/skynet.git
Switch to gpu.scd in all relevant segments
parent
e88792c9d6
commit
7c1681f76e
|
@ -141,7 +141,7 @@ def enqueue(
|
|||
})
|
||||
|
||||
res = await cleos.a_push_action(
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'enqueue',
|
||||
{
|
||||
'user': Name(account),
|
||||
|
@ -176,7 +176,7 @@ def clean(
|
|||
trio.run(
|
||||
partial(
|
||||
cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'clean',
|
||||
{},
|
||||
account, key, permission=permission
|
||||
|
@ -191,9 +191,9 @@ def queue():
|
|||
resp = requests.post(
|
||||
f'{node_url}/v1/chain/get_table_rows',
|
||||
json={
|
||||
'code': 'telos.gpu',
|
||||
'code': 'gpu.scd',
|
||||
'table': 'queue',
|
||||
'scope': 'telos.gpu',
|
||||
'scope': 'gpu.scd',
|
||||
'json': True
|
||||
}
|
||||
)
|
||||
|
@ -208,7 +208,7 @@ def status(request_id: int):
|
|||
resp = requests.post(
|
||||
f'{node_url}/v1/chain/get_table_rows',
|
||||
json={
|
||||
'code': 'telos.gpu',
|
||||
'code': 'gpu.scd',
|
||||
'table': 'status',
|
||||
'scope': request_id,
|
||||
'json': True
|
||||
|
@ -232,7 +232,7 @@ def dequeue(request_id: int):
|
|||
res = trio.run(
|
||||
partial(
|
||||
cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'dequeue',
|
||||
{
|
||||
'user': Name(account),
|
||||
|
@ -267,7 +267,7 @@ def config(
|
|||
res = trio.run(
|
||||
partial(
|
||||
cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'config',
|
||||
{
|
||||
'token_contract': token_contract,
|
||||
|
@ -296,13 +296,13 @@ def deposit(quantity: str):
|
|||
res = trio.run(
|
||||
partial(
|
||||
cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'transfer',
|
||||
{
|
||||
'sender': Name(account),
|
||||
'recipient': Name('telos.gpu'),
|
||||
'recipient': Name('gpu.scd'),
|
||||
'amount': asset_from_str(quantity),
|
||||
'memo': f'{account} transferred {quantity} to telos.gpu'
|
||||
'memo': f'{account} transferred {quantity} to gpu.scd'
|
||||
},
|
||||
account, key, permission=permission
|
||||
)
|
||||
|
|
|
@ -72,7 +72,7 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.aget_table,
|
||||
'telos.gpu', 'telos.gpu', 'queue',
|
||||
'gpu.scd', 'gpu.scd', 'queue',
|
||||
index_position=2,
|
||||
key_type='i64',
|
||||
lower_bound=int(time.time()) - 3600
|
||||
|
@ -83,14 +83,14 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.aget_table,
|
||||
'telos.gpu', request_id, 'status'), ret_fail=[])
|
||||
'gpu.scd', request_id, 'status'), ret_fail=[])
|
||||
|
||||
async def get_global_config(self):
|
||||
logging.info('get_global_config')
|
||||
rows = await failable(
|
||||
partial(
|
||||
self.cleos.aget_table,
|
||||
'telos.gpu', 'telos.gpu', 'config'))
|
||||
'gpu.scd', 'gpu.scd', 'config'))
|
||||
|
||||
if rows:
|
||||
return rows[0]
|
||||
|
@ -102,7 +102,7 @@ class SkynetGPUConnector:
|
|||
rows = await failable(
|
||||
partial(
|
||||
self.cleos.aget_table,
|
||||
'telos.gpu', 'telos.gpu', 'users',
|
||||
'gpu.scd', 'gpu.scd', 'users',
|
||||
index_position=1,
|
||||
key_type='name',
|
||||
lower_bound=self.account,
|
||||
|
@ -149,7 +149,7 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'workbegin',
|
||||
{
|
||||
'worker': self.account,
|
||||
|
@ -166,7 +166,7 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'workcancel',
|
||||
{
|
||||
'worker': self.account,
|
||||
|
@ -189,7 +189,7 @@ class SkynetGPUConnector:
|
|||
await failable(
|
||||
partial(
|
||||
self.cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'withdraw',
|
||||
{
|
||||
'user': self.account,
|
||||
|
@ -205,7 +205,7 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.aget_table,
|
||||
'telos.gpu', 'telos.gpu', 'results',
|
||||
'gpu.scd', 'gpu.scd', 'results',
|
||||
index_position=4,
|
||||
key_type='name',
|
||||
lower_bound=self.account,
|
||||
|
@ -224,7 +224,7 @@ class SkynetGPUConnector:
|
|||
return await failable(
|
||||
partial(
|
||||
self.cleos.a_push_action,
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'submit',
|
||||
{
|
||||
'worker': self.account,
|
||||
|
|
|
@ -153,7 +153,7 @@ class SkynetDiscordFrontend:
|
|||
|
||||
reward = '20.0000 GPU'
|
||||
res = await self.cleos.a_push_action(
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'enqueue',
|
||||
{
|
||||
'user': Name(self.account),
|
||||
|
@ -200,7 +200,7 @@ class SkynetDiscordFrontend:
|
|||
try:
|
||||
submits = await self.hyperion.aget_actions(
|
||||
account=self.account,
|
||||
filter='telos.gpu:submit',
|
||||
filter='gpu.scd:submit',
|
||||
sort='desc',
|
||||
after=request_time
|
||||
)
|
||||
|
|
|
@ -305,7 +305,7 @@ def create_handler_context(frontend: 'SkynetDiscordFrontend'):
|
|||
# async def queue(message):
|
||||
# an_hour_ago = datetime.now() - timedelta(hours=1)
|
||||
# queue = await cleos.aget_table(
|
||||
# 'telos.gpu', 'telos.gpu', 'queue',
|
||||
# 'gpu.scd', 'gpu.scd', 'queue',
|
||||
# index_position=2,
|
||||
# key_type='i64',
|
||||
# sort='desc',
|
||||
|
|
|
@ -110,11 +110,11 @@ def generate_reply_caption(
|
|||
|
||||
async def get_global_config(cleos):
|
||||
return (await cleos.aget_table(
|
||||
'telos.gpu', 'telos.gpu', 'config'))[0]
|
||||
'gpu.scd', 'gpu.scd', 'config'))[0]
|
||||
|
||||
async def get_user_nonce(cleos, user: str):
|
||||
return (await cleos.aget_table(
|
||||
'telos.gpu', 'telos.gpu', 'users',
|
||||
'gpu.scd', 'gpu.scd', 'users',
|
||||
index_position=1,
|
||||
key_type='name',
|
||||
lower_bound=user,
|
||||
|
|
|
@ -143,7 +143,7 @@ class SkynetTelegramFrontend:
|
|||
|
||||
reward = '20.0000 GPU'
|
||||
res = await self.cleos.a_push_action(
|
||||
'telos.gpu',
|
||||
'gpu.scd',
|
||||
'enqueue',
|
||||
{
|
||||
'user': Name(self.account),
|
||||
|
@ -193,7 +193,7 @@ class SkynetTelegramFrontend:
|
|||
try:
|
||||
submits = await self.hyperion.aget_actions(
|
||||
account=self.account,
|
||||
filter='telos.gpu:submit',
|
||||
filter='gpu.scd:submit',
|
||||
sort='desc',
|
||||
after=request_time
|
||||
)
|
||||
|
|
|
@ -47,7 +47,7 @@ def create_handler_context(frontend: 'SkynetTelegramFrontend'):
|
|||
async def queue(message):
|
||||
an_hour_ago = datetime.now() - timedelta(hours=1)
|
||||
queue = await cleos.aget_table(
|
||||
'telos.gpu', 'telos.gpu', 'queue',
|
||||
'gpu.scd', 'gpu.scd', 'queue',
|
||||
index_position=2,
|
||||
key_type='i64',
|
||||
sort='desc',
|
||||
|
|
|
@ -95,11 +95,11 @@ def generate_reply_caption(
|
|||
|
||||
async def get_global_config(cleos):
|
||||
return (await cleos.aget_table(
|
||||
'telos.gpu', 'telos.gpu', 'config'))[0]
|
||||
'gpu.scd', 'gpu.scd', 'config'))[0]
|
||||
|
||||
async def get_user_nonce(cleos, user: str):
|
||||
return (await cleos.aget_table(
|
||||
'telos.gpu', 'telos.gpu', 'users',
|
||||
'gpu.scd', 'gpu.scd', 'users',
|
||||
index_position=1,
|
||||
key_type='name',
|
||||
lower_bound=user,
|
||||
|
|
|
@ -44,8 +44,8 @@ class SkynetPinner:
|
|||
|
||||
async def capture_enqueues(self, after: datetime):
|
||||
enqueues = await self.hyperion.aget_actions(
|
||||
account='telos.gpu',
|
||||
filter='telos.gpu:enqueue',
|
||||
account='gpu.scd',
|
||||
filter='gpu.scd:enqueue',
|
||||
sort='desc',
|
||||
after=after.isoformat(),
|
||||
limit=1000
|
||||
|
@ -63,8 +63,8 @@ class SkynetPinner:
|
|||
|
||||
async def capture_submits(self, after: datetime):
|
||||
submits = await self.hyperion.aget_actions(
|
||||
account='telos.gpu',
|
||||
filter='telos.gpu:submit',
|
||||
account='gpu.scd',
|
||||
filter='gpu.scd:submit',
|
||||
sort='desc',
|
||||
after=after.isoformat(),
|
||||
limit=1000
|
||||
|
|
Loading…
Reference in New Issue