fix: sort blueprint dependencies in aqua deploy (#578)

* fix: sort blueprint dependencies

* chore:  use rust-peer minimal_nightly in playground tests

* chore: fix rust peer image
This commit is contained in:
folex 2022-10-18 16:23:20 +04:00 committed by GitHub
parent 31b16a6bc5
commit 644d8c496e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View File

@ -38,3 +38,4 @@ jobs:
uses: fluencelabs/aqua-playground/.github/workflows/tests.yml@master
with:
aqua-version: "${{ needs.snapshot.outputs.aqua-version }}"
rust-peer-image: fluencelabs/fluence:minimal_nightly

View File

@ -48,28 +48,33 @@ func deploy(serviceName: string, serviceConf: ServiceConf) -> DeployResult:
on ON_PEER:
multiaddr <- Ipfs.get_external_api_multiaddr()
mod_hashes: *string
mod_hashes: *[]string
for m <- serviceConf.modules par:
-- TODO check for cache
Console.print(Op.concat_strings("Going to upload a module: ", m.name))
Console.print(Op.concat_strings("Going to upload module: ", m.name))
uploadRes <- LocalIpfs.uploadFile(m.path, multiaddr)
cid = uploadRes.cid
Console.print(Op.concat_strings(Op.concat_strings("Module '", m.name), "' was uploaded"))
on ON_PEER:
hostRes <- Ipfs.get(cid)
conf <- Dist.make_module_config(m.name, m.mem_pages_count, m.max_heap_size, m.logger_enabled, m.preopened_files, m.envs, m.mapped_dirs, m.mounted_binaries, m.logging_mask)
mod <- Dist.add_module_from_vault(hostRes.path, conf)
mod_hashes <- Op.concat_strings("hash:", mod)
mod_hash <- Op.concat_strings("hash:", mod)
mod_hashes <<- [mod_hash, m.name]
join mod_hashes[OpC.array_length(serviceConf.modules) - 1]
Console.print("Now time to make a blueprint...")
-- sort hashes to the same order as was in serviceConf.modules
sorted_hashes: *string
for m <- serviceConf.modules:
for hash_name <- mod_hashes:
if m.name == hash_name[1]:
sorted_hashes <<- hash_name[0]
Console.print("Now time to make the blueprint...")
on ON_PEER:
blueprint <- Dist.make_blueprint(serviceName, mod_hashes)
blueprint <- Dist.make_blueprint(serviceName, sorted_hashes)
blueprint_id <- Dist.add_blueprint(blueprint)
service_id <- Srv.create(blueprint_id)