Compare commits
4 Commits
272b7b4f4d
...
d05abb4211
| Author | SHA1 | Date | |
|---|---|---|---|
| d05abb4211 | |||
| 8642711cfc | |||
| 361988c079 | |||
| d7504af42d |
File diff suppressed because one or more lines are too long
@ -85,7 +85,6 @@ class NodeManager():
|
||||
print(f"And we have load your wallet private key {WALLET_KEY} (address={self.wallet.address})")
|
||||
print()
|
||||
if self.w3.is_connected():
|
||||
'''
|
||||
print("[INFO] Connected Successfully.")
|
||||
print()
|
||||
|
||||
@ -115,19 +114,23 @@ class NodeManager():
|
||||
train_image = next_task['args']['trainImage']
|
||||
|
||||
print("\n[INFO] You Receive a new task:")
|
||||
print(f" - Task Index: {task_index}")
|
||||
print(f" - Download Image: {data_image}")
|
||||
print(f" - Training Image: {train_image}")
|
||||
'''
|
||||
|
||||
data_image = "snsd0805/cifar100-dataset:v1"
|
||||
train_image = "snsd0805/cifar100-train:v3"
|
||||
# data_image = "snsd0805/cifar100-dataset:v1"
|
||||
# train_image = "snsd0805/cifar100-train:v3"
|
||||
|
||||
# Start Downloading
|
||||
# self.cluster_communication_module.scatter_container(data_image, train=False)
|
||||
self.cluster_communication_module.scatter_container(data_image, train=False)
|
||||
|
||||
# start training
|
||||
self.cluster_communication_module.scatter_container(train_image, train=True)
|
||||
|
||||
print("Update the task's status...")
|
||||
self.scheduler.update_status(self.wallet, task_index, 4)
|
||||
print("Finished.")
|
||||
|
||||
|
||||
else:
|
||||
print("[ERROR] Connected Failed.")
|
||||
|
||||
@ -54,5 +54,10 @@ class Scheduler():
|
||||
for event in event_filter.get_new_entries():
|
||||
if event['args']['provider'] == address:
|
||||
return event
|
||||
|
||||
def update_status(self, account, task_index, new_status):
|
||||
function = self.contract.functions.updateStatus(task_index, new_status)
|
||||
return self.signed_and_send_transaction(account, function)
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user