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