Skip to content

Commit

Permalink
feat(python): make S3 cache arch specific (#5196)
Browse files Browse the repository at this point in the history
* add .minio-data to .gitignore

* feat(python): make S3 cache arch specific

Current schema:

S3-Bucket
├── python_311
│   ├── wheel==1.0
│   └── wheel2==1.0
└── python_312
    ├── wheel==1.0
    └── wheel2==1.0

New schema:

S3-Bucket
├── linux_aarch64
│   └── ...
└── linux_x86_64
    ├── python_311
    │   ├── wheel==1.0
    │   └── wheel2==1.0
    └── python_312
        ├── wheel==1.0
        └── wheel2==1.0

* remove .minio-data from .gitignore

* remove unneeded tracing::error
  • Loading branch information
pyranota authored Feb 3, 2025
1 parent fd0cd58 commit 0e80775
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ CaddyfileRemoteMalo
*.swp
**/.idea/
.direnv
.vscode
.vscode
7 changes: 5 additions & 2 deletions backend/windmill-worker/src/global_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use windmill_common::error;
#[cfg(all(feature = "enterprise", feature = "parquet", unix))]
use std::sync::Arc;

#[cfg(all(feature = "enterprise", feature = "parquet"))]
pub const TARGET: &str = const_format::concatcp!(std::env::consts::OS, "_", std::env::consts::ARCH);

#[cfg(all(feature = "enterprise", feature = "parquet", unix))]
pub async fn build_tar_and_push(
s3_client: Arc<dyn ObjectStore>,
Expand Down Expand Up @@ -57,7 +60,7 @@ pub async fn build_tar_and_push(
if let Err(e) = s3_client
.put(
&Path::from(format!(
"/tar/{}/{folder_name}.tar",
"/tar/{TARGET}/{}/{folder_name}.tar",
if no_uv { "pip" } else { &python_xyz }
)),
std::fs::read(&tar_path)?.into(),
Expand Down Expand Up @@ -100,7 +103,7 @@ pub async fn pull_from_tar(
let start = Instant::now();

let tar_path = format!(
"tar/{}/{folder_name}.tar",
"tar/{TARGET}/{}/{folder_name}.tar",
if no_uv { "pip".to_owned() } else { python_xyz }
);
let bytes = attempt_fetch_bytes(client, &tar_path).await?;
Expand Down
2 changes: 1 addition & 1 deletion backend/windmill-worker/src/python_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ pub async fn uv_pip_compile(
if *NATIVE_CERT {
args.extend(["--native-tls"]);
}
tracing::error!("uv args: {:?}", args);
tracing::debug!("uv args: {:?}", args);

#[cfg(windows)]
let uv_cmd = "uv";
Expand Down

0 comments on commit 0e80775

Please sign in to comment.