mirror of
https://github.com/oceanprotocol/market.git
synced 2024-12-02 05:57:29 +01:00
container fixes
This commit is contained in:
parent
cf3d268bef
commit
7902e13e59
@ -347,23 +347,34 @@ export async function createTrustedAlgorithmList(
|
||||
if (!selectedAssets || selectedAssets.length === 0) return []
|
||||
|
||||
for (const selectedAlgorithm of selectedAssets) {
|
||||
const sanitizedAlgorithmContainer = {
|
||||
entrypoint: selectedAlgorithm.metadata.algorithm.container.entrypoint,
|
||||
image: selectedAlgorithm.metadata.algorithm.container.image,
|
||||
tag: selectedAlgorithm.metadata.algorithm.container.tag,
|
||||
checksum: selectedAlgorithm.metadata.algorithm.container.checksum
|
||||
}
|
||||
// const sanitizedAlgorithmContainer = {
|
||||
// entrypoint: selectedAlgorithm.metadata.algorithm.container.entrypoint,
|
||||
// image: selectedAlgorithm.metadata.algorithm.container.image,
|
||||
// tag: selectedAlgorithm.metadata.algorithm.container.tag,
|
||||
// checksum: selectedAlgorithm.metadata.algorithm.container.checksum
|
||||
// }
|
||||
const filesChecksum = await getFileDidInfo(
|
||||
selectedAlgorithm?.id,
|
||||
selectedAlgorithm?.services?.[0].id,
|
||||
selectedAlgorithm?.services?.[0]?.serviceEndpoint,
|
||||
true
|
||||
)
|
||||
const containerChecksum =
|
||||
selectedAlgorithm.metadata.algorithm.container.entrypoint +
|
||||
selectedAlgorithm.metadata.algorithm.container.checksum
|
||||
console.log('containerChecksum ==', containerChecksum)
|
||||
console.log(
|
||||
'containerChecksum stringify ==',
|
||||
JSON.stringify(containerChecksum)
|
||||
)
|
||||
console.log('containerChecksum hash ==', getHash(containerChecksum))
|
||||
console.log(
|
||||
'containerChecksum stringify hash ==',
|
||||
getHash(JSON.stringify(containerChecksum))
|
||||
)
|
||||
const trustedAlgorithm = {
|
||||
did: selectedAlgorithm.id,
|
||||
containerSectionChecksum: getHash(
|
||||
JSON.stringify(sanitizedAlgorithmContainer)
|
||||
),
|
||||
containerSectionChecksum: getHash(containerChecksum),
|
||||
filesChecksum: filesChecksum?.[0]?.checksum
|
||||
}
|
||||
trustedAlgorithms.push(trustedAlgorithm)
|
||||
|
@ -104,13 +104,15 @@ 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:
|
||||
'sha256:c60726646352202d95de70d9e8393c15f382f8c6074afc5748b7e570ccd5995f' // TODO: how to get? Most likely needs to be fetched from DockerHub.
|
||||
},
|
||||
{
|
||||
image: 'python',
|
||||
tag: 'latest',
|
||||
entrypoint: 'python $ALGO',
|
||||
checksum: ''
|
||||
checksum:
|
||||
'sha256:607635763e54907fd75397fedfeb83890e62a0f9b54a1d99d27d748c5d269be4'
|
||||
}
|
||||
]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user