From b49ba6fa458e9ad60115ba31791b234faa1b8664 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Fri, 1 Jul 2022 11:12:51 +0300 Subject: [PATCH 1/2] change compute assets order calls order and add a default checksum for algo --- .../Asset/AssetActions/Compute/index.tsx | 48 +++++++++---------- src/components/Publish/_constants.tsx | 2 +- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/components/Asset/AssetActions/Compute/index.tsx b/src/components/Asset/AssetActions/Compute/index.tsx index d70294c30..3c0363dd0 100644 --- a/src/components/Asset/AssetActions/Compute/index.tsx +++ b/src/components/Asset/AssetActions/Compute/index.tsx @@ -316,30 +316,6 @@ export default function Compute({ 'Data set is not orderable in combination with selected algorithm.' ) - setComputeStatusText( - getComputeFeedback( - asset.accessDetails.baseToken?.symbol, - asset.accessDetails.datatoken?.symbol, - asset.metadata.type - )[ - asset.accessDetails?.type === 'fixed' - ? 2 - : asset.accessDetails?.type === 'dynamic' - ? 1 - : 3 - ] - ) - const datasetOrderTx = await handleComputeOrder( - web3, - asset, - datasetOrderPriceAndFees, - accountId, - hasDatatoken, - initializedProviderResponse.datasets[0], - computeEnv.consumerAddress - ) - if (!datasetOrderTx) throw new Error('Failed to order dataset.') - setComputeStatusText( getComputeFeedback( selectedAlgorithmAsset.accessDetails.baseToken?.symbol, @@ -365,6 +341,30 @@ export default function Compute({ ) if (!algorithmOrderTx) throw new Error('Failed to order algorithm.') + setComputeStatusText( + getComputeFeedback( + asset.accessDetails.baseToken?.symbol, + asset.accessDetails.datatoken?.symbol, + asset.metadata.type + )[ + asset.accessDetails?.type === 'fixed' + ? 2 + : asset.accessDetails?.type === 'dynamic' + ? 1 + : 3 + ] + ) + const datasetOrderTx = await handleComputeOrder( + web3, + asset, + datasetOrderPriceAndFees, + accountId, + hasDatatoken, + initializedProviderResponse.datasets[0], + computeEnv.consumerAddress + ) + if (!datasetOrderTx) throw new Error('Failed to order dataset.') + LoggerInstance.log('[compute] Starting compute job.') const computeAsset: ComputeAsset = { documentId: asset.id, diff --git a/src/components/Publish/_constants.tsx b/src/components/Publish/_constants.tsx index 5df7852b4..e9b1e9f96 100644 --- a/src/components/Publish/_constants.tsx +++ b/src/components/Publish/_constants.tsx @@ -109,7 +109,7 @@ export const algorithmContainerPresets: MetadataAlgorithmContainer[] = [ image: 'node', tag: 'latest', entrypoint: 'node $ALGO', - checksum: '' // TODO: how to get? Most likely needs to be fetched from DockerHub. + checksum: '7fc268f502935d11ff50c54e3776dda76477648d5d83c2e3c4fdab744390ecf2' // TODO: how to get? Most likely needs to be fetched from DockerHub. }, { image: 'python', From fccf097126b9f7192b9c7fd41ed63b8701cbd059 Mon Sep 17 00:00:00 2001 From: Bogdan Fazakas Date: Tue, 5 Jul 2022 09:22:16 +0300 Subject: [PATCH 2/2] use proper docker hub images --- src/components/Publish/_constants.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Publish/_constants.tsx b/src/components/Publish/_constants.tsx index e9b1e9f96..817aa6aa1 100644 --- a/src/components/Publish/_constants.tsx +++ b/src/components/Publish/_constants.tsx @@ -109,13 +109,15 @@ export const algorithmContainerPresets: MetadataAlgorithmContainer[] = [ image: 'node', tag: 'latest', entrypoint: 'node $ALGO', - checksum: '7fc268f502935d11ff50c54e3776dda76477648d5d83c2e3c4fdab744390ecf2' // TODO: how to get? Most likely needs to be fetched from DockerHub. + checksum: + 'sha256:c60692d492dda8a432e2bb423a700fd470768eb394d182e76b5fe5f058f98cbc' // TODO: how to get? Most likely needs to be fetched from DockerHub. }, { image: 'python', tag: 'latest', entrypoint: 'python $ALGO', - checksum: '' + checksum: + 'sha256:850b7f7626e5ca9822cc9ac36ce1f712930d8c87eb31b5937dba4037fe204034' } ]