gwihlidal / cloudstore-rs Goto Github PK
View Code? Open in Web Editor NEWA gRPC microservice, written in rust, that marshalls objects and files to cloud storage like AWS S3, Google Cloud Storage, or other providers.
License: MIT License
A gRPC microservice, written in rust, that marshalls objects and files to cloud storage like AWS S3, Google Cloud Storage, or other providers.
License: MIT License
It is important to support paging multiple groups of keys in case the list is extremely long. This is done in AWS through "continuation tokens", and adding support for them would be a good improvement for large data sets.
References:
It would be good to implement support for Docker, so that the microservice can be more easily deployed in a variety of infrastructures/configurations. The Dockerfile should build the source tree using cargo, and use the server binary as the default entry point.
Currently there doesn't appear to be a clean way t return a gRPC error. The public GrpcStatus
enum maps the correct error code values for gRPC, but the module itself is private:
Discussions on proper gRPC error handling:
It would much better to replace code like this:
return grpc::SingleResponse::err(grpc::Error::GrpcMessage(grpc::GrpcMessageError {
grpc_status: 15,
grpc_message: "Failed to copy object data".to_string()
}));
With correct enum entries like this:
return grpc::SingleResponse::err(grpc::Error::GrpcMessage(grpc::GrpcMessageError {
grpc_status: grpc::grpc::GrpcStatus::DataLoss as i32,
grpc_message: "Failed to copy object data".to_string()
}));
Currently trying to use GrpcStatus
results in visibility errors:
error[E0603]: module `grpc` is private
--> src/bin/server.rs:187:42
|
187 | grpc_status: grpc::grpc::GrpcStatus::DataLoss as i32,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error: Could not compile `cloudstore`.
There are two areas that should be tested:
For #1, likely point of failure will be the single bytes
array definition in protobuf, as gRPC doesn't automatically chunk up that array into segments that fit within the max message transfer size. The usual approach here is to explicitly chunk up the data and send multiple messages.
For #2, likely point of failure will be login credentials expiring. This may not be an issue, but validating this is warranted:
https://medium.com/@otusweb/how-to-tame-the-aws-framework-to-upload-a-large-file-to-s3-19430d245510
There are a number of hardcoded entrypoints and settings that should be removed in favor of config and environment driven settings.
let endpoint = "http://192.168.1.69:9000".to_string();
let bucket_name = "p4content".to_string();
let credentials = rusoto_credential::StaticProvider::new_minimal(
"AJ20P3XYDOURW7WZSHJ1".to_string(),
"EVT9XzEw/77PevdntA88wjcEBF2cANl/Duc09mkl".to_string());
server.http.set_port(8080);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.