add checksum log to s3 piptar pull

This commit is contained in:
Ruben Fiszel
2024-04-02 20:55:31 +02:00
parent ff26c8e42d
commit 5594afd0a2
3 changed files with 9 additions and 5 deletions
+1
View File
@@ -9981,6 +9981,7 @@ dependencies = [
"bytes",
"chrono",
"const_format",
"crc",
"deno_ast",
"deno_console",
"deno_core",
+2 -1
View File
@@ -14,7 +14,7 @@ prometheus = ["dep:prometheus", "windmill-common/prometheus"]
enterprise = ["windmill-queue/enterprise", "windmill-git-sync/enterprise", "windmill-common/enterprise", "dep:gcp_auth", "dep:jsonwebtoken", "dep:pem", "dep:sha2", "dep:tiberius", "dep:tokio-util", "dep:openidconnect"]
benchmark = ["windmill-queue/benchmark"]
flamegraph = []
parquet = ["windmill-common/parquet", "dep:object_store", "dep:tar"]
parquet = ["windmill-common/parquet", "dep:object_store", "dep:tar", "dep:crc"]
flow_testing = []
[dependencies]
@@ -80,6 +80,7 @@ tokio-util = { workspace = true, optional = true }
openidconnect = { workspace = true, optional = true}
tar = { workspace = true, optional = true}
object_store = { workspace = true, optional = true}
crc = { workspace = true, optional = true}
[build-dependencies]
deno_fetch.workspace = true
+6 -4
View File
@@ -71,6 +71,9 @@ pub async fn build_tar_and_push(
Ok(())
}
#[cfg(all(feature = "enterprise", feature = "parquet"))]
pub const X25: crc::Crc<u16> = crc::Crc::<u16>::new(&crc::CRC_16_IBM_SDLC);
#[cfg(all(feature = "enterprise", feature = "parquet"))]
pub async fn pull_from_tar(client: Arc<dyn ObjectStore>, folder: String) -> error::Result<()> {
use object_store::path::Path;
@@ -100,10 +103,9 @@ pub async fn pull_from_tar(client: Arc<dyn ObjectStore>, folder: String) -> erro
.open(&target)
.await
.unwrap();
file.write_all(&object.unwrap().bytes().await.unwrap())
.await
.unwrap();
let bytes = object.unwrap().bytes().await.unwrap();
tracing::info!("{tar_path} checksum: {}", X25.checksum(&bytes));
file.write_all(&bytes).await.unwrap();
if metadata(&target).await.is_err() {
tracing::info!(