Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Use opendal in rattler-index and add executable #1076

Merged
merged 38 commits into from
Feb 27, 2025

Conversation

delsner
Copy link
Contributor

@delsner delsner commented Feb 19, 2025

Description

Final piece of work for implementing #960.

@baszalmstra
Copy link
Collaborator

Exciting!!

@pavelzw
Copy link
Contributor

pavelzw commented Feb 20, 2025

showcase:

rattler-index.mp4

@delsner delsner marked this pull request as ready for review February 20, 2025 17:38
Comment on lines +78 to +83
access_key_id = os.environ.get("RATTLER_TEST_R2_ACCESS_KEY_ID")
if not access_key_id:
pytest.skip("RATTLER_TEST_R2_ACCESS_KEY_ID environment variable is not set")
secret_access_key = os.environ.get("RATTLER_TEST_R2_SECRET_ACCESS_KEY")
if not secret_access_key:
pytest.skip("RATTLER_TEST_R2_SECRET_ACCESS_KEY environment variable is not set")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@delsner these secrets need to be present in the github workflow as env vars, @wolfv could you add them as repo secrets?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are already set but I think they are read only. Do you want these secrets to be read-write?

Comment on lines +14 to +16
[[bin]]
name = "rattler-index"
path = "src/main.rs"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would suggest we don't publish binaries for rattler-index in this repo as this will probably complicate the release-plz workflow in this repo quite a bit. instead, we can only build binaries on conda-forge (and other package managers like brew), imo this should be enough

]
rustls-tls = [
"rattler_redaction/rustls-tls",
"rattler_package_streaming/rustls-tls",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not used in rattler_conda_types, correct?

default = ["rayon"]
default = ["rayon", "rustls-tls"]
native-tls = [
"rattler_redaction/native-tls",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really necessary?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't look like it :)

rattler_macros = { path = "../rattler_macros", version = "1.0.6", default-features = false }
rattler_redaction = { version = "0.1.6", path = "../rattler_redaction", default-features = false }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is default-features = false okay here? otherwise this will pull in reqwest stuff

@pavelzw
Copy link
Contributor

pavelzw commented Feb 26, 2025

not sure in what way the python failures are related or not, but conda-forge/rust-activation-feedstock#72 is the conda-forge update to 1.85.0

@wolfv
Copy link
Contributor

wolfv commented Feb 27, 2025

Things are fixed on main now but looks like I broke this PR. Sorry :(

use clap_verbosity_flag::Verbosity;
use rattler_conda_types::Platform;
use rattler_index::{index_fs, index_s3};
use tracing_log::AsTrace;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove thsi

let cli = Cli::parse();

tracing_subscriber::FmtSubscriber::builder()
.with_max_level(cli.verbose.log_level_filter().as_trace())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can enable the tracing feature on clap_verbose_... and then use the right function.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

console::style(filename.clone()).dim()
));
let file_path = format!("{subdir}/{filename}");
let buffer = op.read(&file_path).await?;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The returning Buffer implements bytes::Buf so we can use:

package_record_from_tar_bz2_reader(buffer.reader())

In this way, we can avoid some extra copy of data.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! implemented in #1123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants