From 4ba0c8cfdca335a9cdcc7403adf3a00bae8b5a10 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Fri, 26 Feb 2021 01:09:39 +0300 Subject: [PATCH 1/2] add url-downloader-new --- .gitignore | 6 +- url-downloader-new/Config.toml | 21 ++ .../artifacts/curl_adapter.json | 7 + url-downloader-new/artifacts/facade.json | 1 + .../artifacts/local_storage.json | 1 + url-downloader-new/build.sh | 24 +++ url-downloader-new/curl_adapter/Cargo.lock | 178 +++++++++++++++++ url-downloader-new/curl_adapter/Cargo.toml | 14 ++ url-downloader-new/curl_adapter/src/main.rs | 48 +++++ url-downloader-new/deploy.sh | 12 ++ url-downloader-new/download.clj | 7 + url-downloader-new/facade/Cargo.lock | 185 ++++++++++++++++++ url-downloader-new/facade/Cargo.toml | 15 ++ url-downloader-new/facade/src/main.rs | 63 ++++++ url-downloader-new/local_storage/Cargo.lock | 178 +++++++++++++++++ url-downloader-new/local_storage/Cargo.toml | 14 ++ url-downloader-new/local_storage/src/main.rs | 51 +++++ 17 files changed, 824 insertions(+), 1 deletion(-) create mode 100644 url-downloader-new/Config.toml create mode 100644 url-downloader-new/artifacts/curl_adapter.json create mode 100644 url-downloader-new/artifacts/facade.json create mode 100644 url-downloader-new/artifacts/local_storage.json create mode 100755 url-downloader-new/build.sh create mode 100644 url-downloader-new/curl_adapter/Cargo.lock create mode 100644 url-downloader-new/curl_adapter/Cargo.toml create mode 100644 url-downloader-new/curl_adapter/src/main.rs create mode 100755 url-downloader-new/deploy.sh create mode 100644 url-downloader-new/download.clj create mode 100644 url-downloader-new/facade/Cargo.lock create mode 100644 url-downloader-new/facade/Cargo.toml create mode 100644 url-downloader-new/facade/src/main.rs create mode 100644 url-downloader-new/local_storage/Cargo.lock create mode 100644 url-downloader-new/local_storage/Cargo.toml create mode 100644 url-downloader-new/local_storage/src/main.rs diff --git a/.gitignore b/.gitignore index b9c2132..78cab4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,12 @@ +target +node_modules +.idea .DS_Store +.vscode .repl_history /target **/**.bak **/**.bk /artifacts keypair.json - +*.wasm diff --git a/url-downloader-new/Config.toml b/url-downloader-new/Config.toml new file mode 100644 index 0000000..d22508b --- /dev/null +++ b/url-downloader-new/Config.toml @@ -0,0 +1,21 @@ +modules_dir = "artifacts/" + +[[module]] + name = "local_storage" + logger_enabled = true + + [module.wasi] + preopened_files = ["./sites"] + # this is where files will be stored + mapped_dirs = { "sites" = "./sites" } + +[[module]] + name = "curl_adapter" + logger_enabled = true + + [module.mounted_binaries] + curl = "/usr/bin/curl" + +[[module]] + name = "facade" + logger_enabled = true diff --git a/url-downloader-new/artifacts/curl_adapter.json b/url-downloader-new/artifacts/curl_adapter.json new file mode 100644 index 0000000..9de081f --- /dev/null +++ b/url-downloader-new/artifacts/curl_adapter.json @@ -0,0 +1,7 @@ +{ + "name": "curl_adapter", + "mountedBinaries": + { + "curl": "/usr/bin/curl" + } +} diff --git a/url-downloader-new/artifacts/facade.json b/url-downloader-new/artifacts/facade.json new file mode 100644 index 0000000..180ed7e --- /dev/null +++ b/url-downloader-new/artifacts/facade.json @@ -0,0 +1 @@ +{"name": "facade"} diff --git a/url-downloader-new/artifacts/local_storage.json b/url-downloader-new/artifacts/local_storage.json new file mode 100644 index 0000000..abc5f5f --- /dev/null +++ b/url-downloader-new/artifacts/local_storage.json @@ -0,0 +1 @@ +{"name": "local_storage"} diff --git a/url-downloader-new/build.sh b/url-downloader-new/build.sh new file mode 100755 index 0000000..fba8560 --- /dev/null +++ b/url-downloader-new/build.sh @@ -0,0 +1,24 @@ +#!/bin/sh -euo pipefail + +# This script builds all subprojects and puts all created Wasm modules in one dir +( + cd local_storage + cargo update + fce build --release +) +( + cd curl_adapter + cargo update + fce build --release +) +( + cd facade + cargo update + fce build --release +) + +mkdir -p artifacts +rm -f artifacts/*.wasm +cp local_storage/target/wasm32-wasi/release/local_storage.wasm artifacts/ +cp curl_adapter/target/wasm32-wasi/release/curl_adapter.wasm artifacts/ +cp facade/target/wasm32-wasi/release/facade.wasm artifacts/ diff --git a/url-downloader-new/curl_adapter/Cargo.lock b/url-downloader-new/curl_adapter/Cargo.lock new file mode 100644 index 0000000..01f50e5 --- /dev/null +++ b/url-downloader-new/curl_adapter/Cargo.lock @@ -0,0 +1,178 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "curl_adapter" +version = "0.1.0" +dependencies = [ + "fluence", + "log", +] + +[[package]] +name = "fluence" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c621ecf5ba628a3a66c4571cb63b9e57de5b8e1ffbb4636873349d04ed9c4c" +dependencies = [ + "fluence-sdk-macro", + "fluence-sdk-main", +] + +[[package]] +name = "fluence-sdk-macro" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3ed152de2a9f59c5494a5ead9d85b40cc1588696d10bb69129addebf0239efb" +dependencies = [ + "fluence-sdk-wit", +] + +[[package]] +name = "fluence-sdk-main" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed74c32aded592c2a4c2d11a4586369e2d9f793e6c7b500a2a22f4a61769784" +dependencies = [ + "fluence-sdk-macro", + "log", + "serde", +] + +[[package]] +name = "fluence-sdk-wit" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65bb11a2ebb063b8809e43c1837d32e44c12ba3c281e55f2fcf5c5819a6a9ad" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "uuid", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43535db9747a4ba938c0ce0a98cc631a46ebf943c9e1d604e091df6007620bf6" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/url-downloader-new/curl_adapter/Cargo.toml b/url-downloader-new/curl_adapter/Cargo.toml new file mode 100644 index 0000000..14f91b9 --- /dev/null +++ b/url-downloader-new/curl_adapter/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "curl_adapter" +version = "0.1.0" +authors = ["Fluence Labs"] +edition = "2018" +publish = false + +[[bin]] +path = "src/main.rs" +name = "curl_adapter" + +[dependencies] +fluence = { version = "=0.3.3", features = ["logger"] } +log = "0.4.8" diff --git a/url-downloader-new/curl_adapter/src/main.rs b/url-downloader-new/curl_adapter/src/main.rs new file mode 100644 index 0000000..5903153 --- /dev/null +++ b/url-downloader-new/curl_adapter/src/main.rs @@ -0,0 +1,48 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#![allow(improper_ctypes)] + +use fluence::fce; + +use fluence::WasmLoggerBuilder; +use fluence::MountedBinaryResult as Result; +use fluence::MountedBinaryStringResult as StringResult; + +/// Log level can be changed by `RUST_LOG` env as well. +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +#[fce] +pub fn request(url: String) -> StringResult { + unsafe { curl(vec![url]) }.stringify().unwrap() +} + +#[fce] +pub fn download(url: String) -> Result { + log::info!("download called with url {}", url); + + unsafe { curl(vec![url]) } +} + + +/// Permissions in `Config.toml` should exist to use host functions. +#[fce] +#[link(wasm_import_module = "host")] +extern "C" { + fn curl(cmd: Vec) -> Result; +} diff --git a/url-downloader-new/deploy.sh b/url-downloader-new/deploy.sh new file mode 100755 index 0000000..6df7021 --- /dev/null +++ b/url-downloader-new/deploy.sh @@ -0,0 +1,12 @@ +#!/bin/sh -euo pipefail + +# build wasms +sh build.sh + +( + cd artifacts + fldist new_service --name "url_downloader" --modules \ + curl_adapter.wasm:curl_adapter.json \ + local_storage.wasm:local_storage.json \ + facade.wasm:facade.json +) diff --git a/url-downloader-new/download.clj b/url-downloader-new/download.clj new file mode 100644 index 0000000..1ec37b1 --- /dev/null +++ b/url-downloader-new/download.clj @@ -0,0 +1,7 @@ +(xor + (seq + (call relay (service "request") ["https://api.duckduckgo.com/?q=homotopy&format=json"] result) + (call %init_peer_id% (returnService "run") [result]) + ) + (call %init_peer_id% (returnService "run") [%last_error%]) +) diff --git a/url-downloader-new/facade/Cargo.lock b/url-downloader-new/facade/Cargo.lock new file mode 100644 index 0000000..e1ed34b --- /dev/null +++ b/url-downloader-new/facade/Cargo.lock @@ -0,0 +1,185 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "facade" +version = "0.1.0" +dependencies = [ + "base64", + "fluence", + "log", +] + +[[package]] +name = "fluence" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c621ecf5ba628a3a66c4571cb63b9e57de5b8e1ffbb4636873349d04ed9c4c" +dependencies = [ + "fluence-sdk-macro", + "fluence-sdk-main", +] + +[[package]] +name = "fluence-sdk-macro" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3ed152de2a9f59c5494a5ead9d85b40cc1588696d10bb69129addebf0239efb" +dependencies = [ + "fluence-sdk-wit", +] + +[[package]] +name = "fluence-sdk-main" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed74c32aded592c2a4c2d11a4586369e2d9f793e6c7b500a2a22f4a61769784" +dependencies = [ + "fluence-sdk-macro", + "log", + "serde", +] + +[[package]] +name = "fluence-sdk-wit" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65bb11a2ebb063b8809e43c1837d32e44c12ba3c281e55f2fcf5c5819a6a9ad" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "uuid", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43535db9747a4ba938c0ce0a98cc631a46ebf943c9e1d604e091df6007620bf6" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/url-downloader-new/facade/Cargo.toml b/url-downloader-new/facade/Cargo.toml new file mode 100644 index 0000000..3f10a66 --- /dev/null +++ b/url-downloader-new/facade/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "facade" +version = "0.1.0" +authors = ["Fluence Labs"] +edition = "2018" +publish = false + +[[bin]] +name = "facade" +path = "src/main.rs" + +[dependencies] +fluence = { version = "=0.3.3", features = ["logger"]} +log = "0.4.8" +base64 = "0.13.0" diff --git a/url-downloader-new/facade/src/main.rs b/url-downloader-new/facade/src/main.rs new file mode 100644 index 0000000..1a5e04c --- /dev/null +++ b/url-downloader-new/facade/src/main.rs @@ -0,0 +1,63 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#![allow(improper_ctypes)] + +use fluence::fce; +use fluence::MountedBinaryResult as Result; +use fluence::WasmLoggerBuilder; + +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +/// Combining of modules: `curl` and `local_storage`. +/// Calls `curl` and stores returned result into a file. +#[fce] +pub fn get_n_save(url: String, file_name: String) -> i32 { + let result = unsafe { download(url) }; + if result.is_success() { + log::info!("saving file {}", file_name); + unsafe { file_put(file_name, result.stdout) }; + } else { + log::error!("download failed: {:#?}", result.as_std()) + } + + result.ret_code +} + +#[fce] +pub fn load_file(file_name: String) -> String { + let bytes = unsafe { file_get(file_name) }; + base64::encode(bytes) +} + +/// Import `curl_adapter` module +#[fce] +#[link(wasm_import_module = "curl_adapter")] +extern "C" { + pub fn download(url: String) -> Result; +} + +/// Import `local_storage` module +#[fce] +#[link(wasm_import_module = "local_storage")] +extern "C" { + #[link_name = "get"] + pub fn file_get(file_name: String) -> Vec; + + #[link_name = "put"] + pub fn file_put(name: String, file_content: Vec) -> String; +} diff --git a/url-downloader-new/local_storage/Cargo.lock b/url-downloader-new/local_storage/Cargo.lock new file mode 100644 index 0000000..4388517 --- /dev/null +++ b/url-downloader-new/local_storage/Cargo.lock @@ -0,0 +1,178 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "fluence" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c621ecf5ba628a3a66c4571cb63b9e57de5b8e1ffbb4636873349d04ed9c4c" +dependencies = [ + "fluence-sdk-macro", + "fluence-sdk-main", +] + +[[package]] +name = "fluence-sdk-macro" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3ed152de2a9f59c5494a5ead9d85b40cc1588696d10bb69129addebf0239efb" +dependencies = [ + "fluence-sdk-wit", +] + +[[package]] +name = "fluence-sdk-main" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed74c32aded592c2a4c2d11a4586369e2d9f793e6c7b500a2a22f4a61769784" +dependencies = [ + "fluence-sdk-macro", + "log", + "serde", +] + +[[package]] +name = "fluence-sdk-wit" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a65bb11a2ebb063b8809e43c1837d32e44c12ba3c281e55f2fcf5c5819a6a9ad" +dependencies = [ + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn", + "uuid", +] + +[[package]] +name = "getrandom" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "itoa" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" + +[[package]] +name = "libc" +version = "0.2.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7282d924be3275cec7f6756ff4121987bc6481325397dde6ba3e7802b1a8b1c" + +[[package]] +name = "local_storage" +version = "0.1.0" +dependencies = [ + "fluence", + "log", +] + +[[package]] +name = "log" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "proc-macro2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +dependencies = [ + "unicode-xid", +] + +[[package]] +name = "quote" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "ryu" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" + +[[package]] +name = "serde" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.118" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43535db9747a4ba938c0ce0a98cc631a46ebf943c9e1d604e091df6007620bf6" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "1.0.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + +[[package]] +name = "unicode-xid" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" diff --git a/url-downloader-new/local_storage/Cargo.toml b/url-downloader-new/local_storage/Cargo.toml new file mode 100644 index 0000000..0a0a5ea --- /dev/null +++ b/url-downloader-new/local_storage/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "local_storage" +version = "0.1.0" +authors = ["Fluence Labs"] +edition = "2018" +publish = false + +[[bin]] +name = "local_storage" +path = "src/main.rs" + +[dependencies] +fluence = { version = "=0.3.3", features = ["logger"]} +log = "0.4.8" diff --git a/url-downloader-new/local_storage/src/main.rs b/url-downloader-new/local_storage/src/main.rs new file mode 100644 index 0000000..015ddc9 --- /dev/null +++ b/url-downloader-new/local_storage/src/main.rs @@ -0,0 +1,51 @@ +/* + * Copyright 2020 Fluence Labs Limited + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +use std::fs; +use fluence::fce; +use fluence::WasmLoggerBuilder; +use std::path::PathBuf; + +const SITES_DIR: &str = "/sites/"; + +/// Log level can be changed by `RUST_LOG` env as well. +pub fn main() { + WasmLoggerBuilder::new().build().unwrap(); +} + +/// You can read or write files from the file system if there is permission to use directories described in `Config.toml`. +#[fce] +pub fn put(name: String, file_content: Vec) -> String { + log::info!("put called with file name {}", name); + + let rpc_tmp_filepath = format!("{}{}", SITES_DIR, name); + + let result = fs::write(PathBuf::from(rpc_tmp_filepath.clone()), file_content); + if let Err(e) = result { + return format!("file can't be written: {}", e); + } + + String::from("Ok") +} + +#[fce] +pub fn get(file_name: String) -> Vec { + log::info!("get called with file name: {}", file_name); + + let tmp_filepath = format!("{}{}", SITES_DIR, file_name); + + fs::read(tmp_filepath).unwrap_or_else(|_| b"error while reading file".to_vec()) +} From 2814b0e190fa68c7099a55aac7bcfa64b50bcb43 Mon Sep 17 00:00:00 2001 From: folex <0xdxdy@gmail.com> Date: Fri, 26 Feb 2021 01:13:05 +0300 Subject: [PATCH 2/2] replace url-downloader with a new one --- url-downloader-new/Config.toml | 21 ------- url-downloader-new/build.sh | 24 ------- url-downloader-new/curl_adapter/Cargo.toml | 14 ----- url-downloader-new/curl_adapter/src/main.rs | 48 -------------- url-downloader-new/facade/Cargo.toml | 15 ----- url-downloader-new/facade/src/main.rs | 63 ------------------- url-downloader-new/local_storage/Cargo.toml | 14 ----- url-downloader-new/local_storage/src/main.rs | 51 --------------- .../artifacts/curl_adapter.json | 0 .../artifacts/facade.json | 0 .../artifacts/local_storage.json | 0 url-downloader/build.sh | 36 ++++++----- .../curl_adapter/Cargo.lock | 0 url-downloader/curl_adapter/Cargo.toml | 2 +- url-downloader/curl_adapter/src/main.rs | 20 +++--- .../deploy.sh | 0 .../download.clj | 0 .../facade/Cargo.lock | 0 url-downloader/facade/Cargo.toml | 4 +- url-downloader/facade/src/main.rs | 24 +++++-- .../local_storage/Cargo.lock | 0 url-downloader/local_storage/Cargo.toml | 2 +- 22 files changed, 56 insertions(+), 282 deletions(-) delete mode 100644 url-downloader-new/Config.toml delete mode 100755 url-downloader-new/build.sh delete mode 100644 url-downloader-new/curl_adapter/Cargo.toml delete mode 100644 url-downloader-new/curl_adapter/src/main.rs delete mode 100644 url-downloader-new/facade/Cargo.toml delete mode 100644 url-downloader-new/facade/src/main.rs delete mode 100644 url-downloader-new/local_storage/Cargo.toml delete mode 100644 url-downloader-new/local_storage/src/main.rs rename {url-downloader-new => url-downloader}/artifacts/curl_adapter.json (100%) rename {url-downloader-new => url-downloader}/artifacts/facade.json (100%) rename {url-downloader-new => url-downloader}/artifacts/local_storage.json (100%) rename {url-downloader-new => url-downloader}/curl_adapter/Cargo.lock (100%) rename {url-downloader-new => url-downloader}/deploy.sh (100%) rename {url-downloader-new => url-downloader}/download.clj (100%) rename {url-downloader-new => url-downloader}/facade/Cargo.lock (100%) rename {url-downloader-new => url-downloader}/local_storage/Cargo.lock (100%) diff --git a/url-downloader-new/Config.toml b/url-downloader-new/Config.toml deleted file mode 100644 index d22508b..0000000 --- a/url-downloader-new/Config.toml +++ /dev/null @@ -1,21 +0,0 @@ -modules_dir = "artifacts/" - -[[module]] - name = "local_storage" - logger_enabled = true - - [module.wasi] - preopened_files = ["./sites"] - # this is where files will be stored - mapped_dirs = { "sites" = "./sites" } - -[[module]] - name = "curl_adapter" - logger_enabled = true - - [module.mounted_binaries] - curl = "/usr/bin/curl" - -[[module]] - name = "facade" - logger_enabled = true diff --git a/url-downloader-new/build.sh b/url-downloader-new/build.sh deleted file mode 100755 index fba8560..0000000 --- a/url-downloader-new/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh -euo pipefail - -# This script builds all subprojects and puts all created Wasm modules in one dir -( - cd local_storage - cargo update - fce build --release -) -( - cd curl_adapter - cargo update - fce build --release -) -( - cd facade - cargo update - fce build --release -) - -mkdir -p artifacts -rm -f artifacts/*.wasm -cp local_storage/target/wasm32-wasi/release/local_storage.wasm artifacts/ -cp curl_adapter/target/wasm32-wasi/release/curl_adapter.wasm artifacts/ -cp facade/target/wasm32-wasi/release/facade.wasm artifacts/ diff --git a/url-downloader-new/curl_adapter/Cargo.toml b/url-downloader-new/curl_adapter/Cargo.toml deleted file mode 100644 index 14f91b9..0000000 --- a/url-downloader-new/curl_adapter/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "curl_adapter" -version = "0.1.0" -authors = ["Fluence Labs"] -edition = "2018" -publish = false - -[[bin]] -path = "src/main.rs" -name = "curl_adapter" - -[dependencies] -fluence = { version = "=0.3.3", features = ["logger"] } -log = "0.4.8" diff --git a/url-downloader-new/curl_adapter/src/main.rs b/url-downloader-new/curl_adapter/src/main.rs deleted file mode 100644 index 5903153..0000000 --- a/url-downloader-new/curl_adapter/src/main.rs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#![allow(improper_ctypes)] - -use fluence::fce; - -use fluence::WasmLoggerBuilder; -use fluence::MountedBinaryResult as Result; -use fluence::MountedBinaryStringResult as StringResult; - -/// Log level can be changed by `RUST_LOG` env as well. -pub fn main() { - WasmLoggerBuilder::new().build().unwrap(); -} - -#[fce] -pub fn request(url: String) -> StringResult { - unsafe { curl(vec![url]) }.stringify().unwrap() -} - -#[fce] -pub fn download(url: String) -> Result { - log::info!("download called with url {}", url); - - unsafe { curl(vec![url]) } -} - - -/// Permissions in `Config.toml` should exist to use host functions. -#[fce] -#[link(wasm_import_module = "host")] -extern "C" { - fn curl(cmd: Vec) -> Result; -} diff --git a/url-downloader-new/facade/Cargo.toml b/url-downloader-new/facade/Cargo.toml deleted file mode 100644 index 3f10a66..0000000 --- a/url-downloader-new/facade/Cargo.toml +++ /dev/null @@ -1,15 +0,0 @@ -[package] -name = "facade" -version = "0.1.0" -authors = ["Fluence Labs"] -edition = "2018" -publish = false - -[[bin]] -name = "facade" -path = "src/main.rs" - -[dependencies] -fluence = { version = "=0.3.3", features = ["logger"]} -log = "0.4.8" -base64 = "0.13.0" diff --git a/url-downloader-new/facade/src/main.rs b/url-downloader-new/facade/src/main.rs deleted file mode 100644 index 1a5e04c..0000000 --- a/url-downloader-new/facade/src/main.rs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#![allow(improper_ctypes)] - -use fluence::fce; -use fluence::MountedBinaryResult as Result; -use fluence::WasmLoggerBuilder; - -pub fn main() { - WasmLoggerBuilder::new().build().unwrap(); -} - -/// Combining of modules: `curl` and `local_storage`. -/// Calls `curl` and stores returned result into a file. -#[fce] -pub fn get_n_save(url: String, file_name: String) -> i32 { - let result = unsafe { download(url) }; - if result.is_success() { - log::info!("saving file {}", file_name); - unsafe { file_put(file_name, result.stdout) }; - } else { - log::error!("download failed: {:#?}", result.as_std()) - } - - result.ret_code -} - -#[fce] -pub fn load_file(file_name: String) -> String { - let bytes = unsafe { file_get(file_name) }; - base64::encode(bytes) -} - -/// Import `curl_adapter` module -#[fce] -#[link(wasm_import_module = "curl_adapter")] -extern "C" { - pub fn download(url: String) -> Result; -} - -/// Import `local_storage` module -#[fce] -#[link(wasm_import_module = "local_storage")] -extern "C" { - #[link_name = "get"] - pub fn file_get(file_name: String) -> Vec; - - #[link_name = "put"] - pub fn file_put(name: String, file_content: Vec) -> String; -} diff --git a/url-downloader-new/local_storage/Cargo.toml b/url-downloader-new/local_storage/Cargo.toml deleted file mode 100644 index 0a0a5ea..0000000 --- a/url-downloader-new/local_storage/Cargo.toml +++ /dev/null @@ -1,14 +0,0 @@ -[package] -name = "local_storage" -version = "0.1.0" -authors = ["Fluence Labs"] -edition = "2018" -publish = false - -[[bin]] -name = "local_storage" -path = "src/main.rs" - -[dependencies] -fluence = { version = "=0.3.3", features = ["logger"]} -log = "0.4.8" diff --git a/url-downloader-new/local_storage/src/main.rs b/url-downloader-new/local_storage/src/main.rs deleted file mode 100644 index 015ddc9..0000000 --- a/url-downloader-new/local_storage/src/main.rs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2020 Fluence Labs Limited - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -use std::fs; -use fluence::fce; -use fluence::WasmLoggerBuilder; -use std::path::PathBuf; - -const SITES_DIR: &str = "/sites/"; - -/// Log level can be changed by `RUST_LOG` env as well. -pub fn main() { - WasmLoggerBuilder::new().build().unwrap(); -} - -/// You can read or write files from the file system if there is permission to use directories described in `Config.toml`. -#[fce] -pub fn put(name: String, file_content: Vec) -> String { - log::info!("put called with file name {}", name); - - let rpc_tmp_filepath = format!("{}{}", SITES_DIR, name); - - let result = fs::write(PathBuf::from(rpc_tmp_filepath.clone()), file_content); - if let Err(e) = result { - return format!("file can't be written: {}", e); - } - - String::from("Ok") -} - -#[fce] -pub fn get(file_name: String) -> Vec { - log::info!("get called with file name: {}", file_name); - - let tmp_filepath = format!("{}{}", SITES_DIR, file_name); - - fs::read(tmp_filepath).unwrap_or_else(|_| b"error while reading file".to_vec()) -} diff --git a/url-downloader-new/artifacts/curl_adapter.json b/url-downloader/artifacts/curl_adapter.json similarity index 100% rename from url-downloader-new/artifacts/curl_adapter.json rename to url-downloader/artifacts/curl_adapter.json diff --git a/url-downloader-new/artifacts/facade.json b/url-downloader/artifacts/facade.json similarity index 100% rename from url-downloader-new/artifacts/facade.json rename to url-downloader/artifacts/facade.json diff --git a/url-downloader-new/artifacts/local_storage.json b/url-downloader/artifacts/local_storage.json similarity index 100% rename from url-downloader-new/artifacts/local_storage.json rename to url-downloader/artifacts/local_storage.json diff --git a/url-downloader/build.sh b/url-downloader/build.sh index bacc9ad..fba8560 100755 --- a/url-downloader/build.sh +++ b/url-downloader/build.sh @@ -1,18 +1,24 @@ -#!/bin/sh +#!/bin/sh -euo pipefail # This script builds all subprojects and puts all created Wasm modules in one dir -cd local_storage -cargo update -fce build --release -cd ../curl_adapter -cargo update -fce build --release -cd ../facade -cargo update -fce build --release +( + cd local_storage + cargo update + fce build --release +) +( + cd curl_adapter + cargo update + fce build --release +) +( + cd facade + cargo update + fce build --release +) -cd .. -rm -f artifacts/* -cp ../../target/wasm32-wasi/release/local_storage.wasm artifacts/ -cp ../../target/wasm32-wasi/release/curl_adapter.wasm artifacts/ -cp ../../target/wasm32-wasi/release/facade.wasm artifacts/ +mkdir -p artifacts +rm -f artifacts/*.wasm +cp local_storage/target/wasm32-wasi/release/local_storage.wasm artifacts/ +cp curl_adapter/target/wasm32-wasi/release/curl_adapter.wasm artifacts/ +cp facade/target/wasm32-wasi/release/facade.wasm artifacts/ diff --git a/url-downloader-new/curl_adapter/Cargo.lock b/url-downloader/curl_adapter/Cargo.lock similarity index 100% rename from url-downloader-new/curl_adapter/Cargo.lock rename to url-downloader/curl_adapter/Cargo.lock diff --git a/url-downloader/curl_adapter/Cargo.toml b/url-downloader/curl_adapter/Cargo.toml index bb85e9b..14f91b9 100644 --- a/url-downloader/curl_adapter/Cargo.toml +++ b/url-downloader/curl_adapter/Cargo.toml @@ -10,5 +10,5 @@ path = "src/main.rs" name = "curl_adapter" [dependencies] -fluence = { version = "=0.3.2", features = ["logger"] } +fluence = { version = "=0.3.3", features = ["logger"] } log = "0.4.8" diff --git a/url-downloader/curl_adapter/src/main.rs b/url-downloader/curl_adapter/src/main.rs index 66df238..5903153 100644 --- a/url-downloader/curl_adapter/src/main.rs +++ b/url-downloader/curl_adapter/src/main.rs @@ -19,7 +19,8 @@ use fluence::fce; use fluence::WasmLoggerBuilder; -use fluence::MountedBinaryResult; +use fluence::MountedBinaryResult as Result; +use fluence::MountedBinaryStringResult as StringResult; /// Log level can be changed by `RUST_LOG` env as well. pub fn main() { @@ -27,16 +28,21 @@ pub fn main() { } #[fce] -pub fn download(url: String) -> String { - log::info!("get called with url {}", url); - - let result = unsafe { curl(vec![url]) }; - String::from_utf8(result.stdout).unwrap() +pub fn request(url: String) -> StringResult { + unsafe { curl(vec![url]) }.stringify().unwrap() } +#[fce] +pub fn download(url: String) -> Result { + log::info!("download called with url {}", url); + + unsafe { curl(vec![url]) } +} + + /// Permissions in `Config.toml` should exist to use host functions. #[fce] #[link(wasm_import_module = "host")] extern "C" { - fn curl(cmd: Vec) -> MountedBinaryResult; + fn curl(cmd: Vec) -> Result; } diff --git a/url-downloader-new/deploy.sh b/url-downloader/deploy.sh similarity index 100% rename from url-downloader-new/deploy.sh rename to url-downloader/deploy.sh diff --git a/url-downloader-new/download.clj b/url-downloader/download.clj similarity index 100% rename from url-downloader-new/download.clj rename to url-downloader/download.clj diff --git a/url-downloader-new/facade/Cargo.lock b/url-downloader/facade/Cargo.lock similarity index 100% rename from url-downloader-new/facade/Cargo.lock rename to url-downloader/facade/Cargo.lock diff --git a/url-downloader/facade/Cargo.toml b/url-downloader/facade/Cargo.toml index e6de140..3f10a66 100644 --- a/url-downloader/facade/Cargo.toml +++ b/url-downloader/facade/Cargo.toml @@ -10,6 +10,6 @@ name = "facade" path = "src/main.rs" [dependencies] -fluence = { version = "=0.3.2", features = ["logger"]} -anyhow = "1.0.31" +fluence = { version = "=0.3.3", features = ["logger"]} log = "0.4.8" +base64 = "0.13.0" diff --git a/url-downloader/facade/src/main.rs b/url-downloader/facade/src/main.rs index 3b2fedc..1a5e04c 100644 --- a/url-downloader/facade/src/main.rs +++ b/url-downloader/facade/src/main.rs @@ -16,6 +16,7 @@ #![allow(improper_ctypes)] use fluence::fce; +use fluence::MountedBinaryResult as Result; use fluence::WasmLoggerBuilder; pub fn main() { @@ -25,21 +26,32 @@ pub fn main() { /// Combining of modules: `curl` and `local_storage`. /// Calls `curl` and stores returned result into a file. #[fce] -pub fn get_n_save(url: String, file_name: String) -> String { +pub fn get_n_save(url: String, file_name: String) -> i32 { let result = unsafe { download(url) }; - unsafe { file_put(file_name, result.into_bytes()) }; + if result.is_success() { + log::info!("saving file {}", file_name); + unsafe { file_put(file_name, result.stdout) }; + } else { + log::error!("download failed: {:#?}", result.as_std()) + } - String::from("Ok") + result.ret_code } -/// Importing `curl` module +#[fce] +pub fn load_file(file_name: String) -> String { + let bytes = unsafe { file_get(file_name) }; + base64::encode(bytes) +} + +/// Import `curl_adapter` module #[fce] #[link(wasm_import_module = "curl_adapter")] extern "C" { - pub fn download(url: String) -> String; + pub fn download(url: String) -> Result; } -/// Importing `local_storage` module +/// Import `local_storage` module #[fce] #[link(wasm_import_module = "local_storage")] extern "C" { diff --git a/url-downloader-new/local_storage/Cargo.lock b/url-downloader/local_storage/Cargo.lock similarity index 100% rename from url-downloader-new/local_storage/Cargo.lock rename to url-downloader/local_storage/Cargo.lock diff --git a/url-downloader/local_storage/Cargo.toml b/url-downloader/local_storage/Cargo.toml index 95e5307..0a0a5ea 100644 --- a/url-downloader/local_storage/Cargo.toml +++ b/url-downloader/local_storage/Cargo.toml @@ -10,5 +10,5 @@ name = "local_storage" path = "src/main.rs" [dependencies] -fluence = { version = "=0.3.2", features = ["logger"]} +fluence = { version = "=0.3.3", features = ["logger"]} log = "0.4.8"