Ok builds again going to run unit tests.

This commit is contained in:
Michael Chung committed 2023-12-21 02:25:20 -05:00
1 parent 6b2d4ffdce
commit ed97cdbb0d
5 files changed
+25 -18

No files matched your search

Generated
+5 -2
View File
@@ -620,9 +620,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.74"
version = "0.1.75"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9"
checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98"
dependencies = [
"proc-macro2",
"quote",
@@ -1124,9 +1124,11 @@ name = "cloud_storage"
version = "0.0.1"
dependencies = [
"anyhow",
"async-trait",
"buckets",
"crockford",
"easyenv",
"env_logger",
"errors",
"filesys",
"hashing",
@@ -1134,6 +1136,7 @@ dependencies = [
"mimetypes",
"my-workspace-hack",
"rust-s3",
"storyteller_root",
"tokio",
]
@@ -30,8 +30,7 @@ my-workspace-hack = { version = "0.1", path = "../../../my-workspace-hack" }
anyhow = "1.0.75"
log = "0.4.14"
env_logger = "0.10.1"
async-trait = "0.1.58"
async-trait = "0.1.75"
# The "never-encode-slash" feature seems to have been removed:
# https://github.com/durch/rust-s3/pull/254
rust-s3 = { version = "0.33.0" }
@@ -39,3 +38,4 @@ rust-s3 = { version = "0.33.0" }
# Runtime
# NB: We switched to Tokio from `async-std` for broader ecosystem support.
tokio = { version = "1.34.0", features = ["macros"] }
@@ -1,9 +1,11 @@
use errors::AnyhowResult;
use crate::bucket_client::BucketClient;
use tokio::time::Duration;
use log::info;
use crate::remote_file_manager_mock::bucket_orchestration_mock;
use tokio::time::Duration;
use async_trait::async_trait;
use errors::AnyhowResult;
use crate::bucket_client::BucketClient;
#[async_trait]
pub trait BucketOrchestrationDownload {
async fn download_file_to_disk(
@@ -16,14 +18,12 @@ pub trait BucketOrchestrationDownload {
#[async_trait]
pub trait BucketOrchestrationUpload {
async fn upload_file_with_content_type_process(&self,object_name: &str,
async fn upload_file_with_content_type_process(&self,object_name: &str,
bytes: &[u8],
content_type: &str,
is_public:bool) -> AnyhowResult<()>;
}
pub struct BucketOrchestration {
access_key: String,
secret_key: String,
@@ -32,9 +32,10 @@ pub struct BucketOrchestration {
private_bucket_name: String,
}
#[async_trait]
impl BucketOrchestrationDownload for BucketOrchestration {
#[async_trait]
async fn download_file_to_disk(
async fn download_file_to_disk(
&self,
object_path: String,
filesystem_path: String,
@@ -42,13 +43,13 @@ impl BucketOrchestrationDownload for BucketOrchestration {
) -> AnyhowResult<()> {
let bucket_client = self.get_bucket_with_visbility(is_public).await?;
bucket_client.download_file_to_disk(object_path, filesystem_path).await
}
}
impl BucketOrchestrationUpload for BucketOrchestration {
#[async_trait]
async fn upload_file_with_content_type_process(&self,object_name: &str,
#[async_trait]
impl BucketOrchestrationUpload for BucketOrchestration {
async fn upload_file_with_content_type_process(&self,object_name: &str,
bytes: &[u8],
content_type: &str,
is_public:bool) -> AnyhowResult<()> {
@@ -25,6 +25,8 @@ use storyteller_root::get_seed_tool_data_root;
use std::path::Path;
use bucket_orchestration::BucketOrchestration;
use crate::remote_file_manager::bucket_orchestration::{BucketOrchestrationDownload, BucketOrchestrationUpload};
struct RemoteCloudFileClient {
bucket_orchestration_client: BucketOrchestration
}
@@ -42,6 +44,7 @@ impl RemoteCloudFileClient {
let full_remote_cloud_file_path = file_bucket_directory.get_full_remote_cloud_file_path().to_string();
let is_public = file_descriptor.is_public().clone();
self.bucket_orchestration_client.download_file_to_disk(full_remote_cloud_file_path, to_system_file_path, is_public).await?;
Ok(())
}
@@ -125,7 +125,7 @@ impl FileDescriptor for crate::remote_file_manager::weights_descriptor::WeightsR
pub struct WeightsRVCIndexDescriptor {}
impl FileDescriptor for crate::remote_file_manager::weights_descriptor::WeightsRVCDescriptor {
impl FileDescriptor for crate::remote_file_manager::weights_descriptor::WeightsRVCIndexDescriptor {
fn remote_directory_path(&self) -> &str {
return REMOTE_FILE_DIRECTORY;
}