You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/11/14 12:58:11 UTC

[GitHub] [arrow-rs] sum12 opened a new pull request, #3109: object_store: add support for using proxy_url for connection testing

sum12 opened a new pull request, #3109:
URL: https://github.com/apache/arrow-rs/pull/3109

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Closes #2989 
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   # What changes are included in this PR?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] ursabot commented on pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
ursabot commented on PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#issuecomment-1330440340

   Benchmark runs are scheduled for baseline = 1d6b5ab71eec290ffd9656e15bb06aed2b820148 and contender = b2bfe9c5fb4f09ef9f7b1fd67ec767f6d42cf8d8. b2bfe9c5fb4f09ef9f7b1fd67ec767f6d42cf8d8 is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
   Conbench compare runs links:
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ec2-t3-xlarge-us-east-2] [ec2-t3-xlarge-us-east-2](https://conbench.ursa.dev/compare/runs/c18ba8c807a345a9b4cd807d09d15772...93ef16f285f74b6e956dcc3fda9033d8/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on test-mac-arm] [test-mac-arm](https://conbench.ursa.dev/compare/runs/0421fe0e0e2249de8bb8fdfe94231c72...ffd7e2533c6c400388d9825e88b3999a/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-i9-9960x] [ursa-i9-9960x](https://conbench.ursa.dev/compare/runs/77340b98ec364c298e0d52dde2197ac0...4917e89e25294c2db56486f84b228fcf/)
   [Skipped :warning: Benchmarking of arrow-rs-commits is not supported on ursa-thinkcentre-m75q] [ursa-thinkcentre-m75q](https://conbench.ursa.dev/compare/runs/45d7c71f7c6543d29c5260af2fcb33bb...009dcbf0e1da40b7975e45b4c88ffce8/)
   Buildkite builds:
   Supported benchmarks:
   ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
   test-mac-arm: Supported benchmark langs: C++, Python, R
   ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
   ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] askoa commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
askoa commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1025942341


##########
object_store/src/gcp/mod.rs:
##########
@@ -790,19 +801,38 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
 
+        let client = if let Some(url) = proxy_url {

Review Comment:
   the better coding pattern is
   
   ```
   let client = match proxy_url, client {
       Some(url), Some(client) => {}
       Some(url), None => {}
       None, _ =>
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] sum12 commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
sum12 commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1033407000


##########
object_store/src/aws/mod.rs:
##########
@@ -561,6 +571,14 @@ impl AmazonS3Builder {
         let bucket = self.bucket_name.context(MissingBucketNameSnafu)?;
         let region = self.region.context(MissingRegionSnafu)?;
 
+        let clientbuilder = match self.proxy_url {

Review Comment:
   done, thanks for the review :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] askoa commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
askoa commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1025941001


##########
object_store/src/azure/client.rs:
##########
@@ -148,13 +152,20 @@ pub(crate) struct AzureClient {
 
 impl AzureClient {
     /// create a new instance of [AzureClient]
-    pub fn new(config: AzureConfig) -> Self {
-        let client = reqwest::ClientBuilder::new()
-            .https_only(!config.allow_http)
-            .build()
-            .unwrap();
+    pub fn new(config: AzureConfig) -> Result<Self> {
+        let builder = ReqwestClient::builder();
+
+        let client = if let Some(url) = config.proxy_url.as_ref() {

Review Comment:
   Same as my previous comment on AWS builder.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
tustvold merged PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] alamb commented on pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
alamb commented on PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#issuecomment-1327797001

   Is this PR ready to go?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1021980619


##########
object_store/src/azure/client.rs:
##########
@@ -149,10 +150,16 @@ pub(crate) struct AzureClient {
 impl AzureClient {
     /// create a new instance of [AzureClient]
     pub fn new(config: AzureConfig) -> Self {
-        let client = reqwest::ClientBuilder::new()
-            .https_only(!config.allow_http)
-            .build()
-            .unwrap();
+        let builder = ReqwestClient::builder();
+        let client = if let Some(url) = config.proxy_url.as_ref() {
+            let pr: Proxy = Proxy::all(url).unwrap();

Review Comment:
   I think it would be better to make AzureClient::new return a `Result`. This won't be a breaking change as `AzureClient` is crate private



##########
object_store/src/gcp/mod.rs:
##########
@@ -790,12 +803,24 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
+        let client = client.unwrap_or(match proxy_url {

Review Comment:
   ```suggestion
           let client = client.unwrap_or_else(|| match proxy_url {
   ```
   
   It's a minor nit, but this avoids creating a client eagerly, only to just discard it



##########
object_store/src/azure/mod.rs:
##########
@@ -516,8 +526,19 @@ impl MicrosoftAzureBuilder {
             retry_config,
             allow_http,
             authority_host,
+            proxy_url,
         } = self;
 
+        // check if proxy_url is usable

Review Comment:
   See above, I think it would be cleaner to make AzureClient::new fallible



##########
object_store/src/gcp/mod.rs:
##########
@@ -782,6 +787,14 @@ impl GoogleCloudStorageBuilder {
         self
     }
 
+    /// Set proxy url used for connection
+    ///
+    /// if a pre-built client is provided with this builder then the proxy_url is just ignored

Review Comment:
   We don't appear to expose this, so I think this can be ignored



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
tustvold commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1028124654


##########
object_store/src/aws/mod.rs:
##########
@@ -561,6 +571,14 @@ impl AmazonS3Builder {
         let bucket = self.bucket_name.context(MissingBucketNameSnafu)?;
         let region = self.region.context(MissingRegionSnafu)?;
 
+        let clientbuilder = match self.proxy_url {

Review Comment:
   This currently only alters the client used to obtain credentials, it does not alter the client created in `S3Client::new` which likely needs the same treatment as `AzureClient`



##########
object_store/src/gcp/mod.rs:
##########
@@ -821,6 +847,7 @@ impl GoogleCloudStorageBuilder {
         // The cloud storage crate currently only supports authentication via
         // environment variables. Set the environment variable explicitly so
         // that we can optionally accept command line arguments instead.
+        println!("herereere");

Review Comment:
   ```suggestion
   ```



##########
object_store/src/gcp/mod.rs:
##########
@@ -790,19 +801,34 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
 
+        let client = match (proxy_url, client) {
+            (_, Some(client)) => client,
+            (Some(url), None) => {
+                let pr = Proxy::all(&url).map_err(|source| Error::ProxyUrl { source })?;
+                Client::builder()
+                    .proxy(pr)
+                    .build()
+                    .map_err(|source| Error::ProxyUrl { source })?
+            }
+            (None, None) => Client::new(),
+        };
+
+        println!("herereere");
         let credentials = reader_credentials_file(service_account_path)?;
+        println!("herereere");

Review Comment:
   ```suggestion
   ```



##########
object_store/src/gcp/mod.rs:
##########
@@ -790,19 +801,34 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
 
+        let client = match (proxy_url, client) {
+            (_, Some(client)) => client,
+            (Some(url), None) => {
+                let pr = Proxy::all(&url).map_err(|source| Error::ProxyUrl { source })?;
+                Client::builder()
+                    .proxy(pr)
+                    .build()
+                    .map_err(|source| Error::ProxyUrl { source })?
+            }
+            (None, None) => Client::new(),
+        };
+
+        println!("herereere");
         let credentials = reader_credentials_file(service_account_path)?;
+        println!("herereere");
 
         // TODO: https://cloud.google.com/storage/docs/authentication#oauth-scopes
         let scope = "https://www.googleapis.com/auth/devstorage.full_control";
         let audience = "https://www.googleapis.com/oauth2/v4/token".to_string();
 
+        println!("herereere");

Review Comment:
   ```suggestion
   ```



##########
object_store/src/gcp/mod.rs:
##########
@@ -790,19 +801,34 @@ impl GoogleCloudStorageBuilder {
             service_account_path,
             client,
             retry_config,
+            proxy_url,
         } = self;
 
         let bucket_name = bucket_name.ok_or(Error::MissingBucketName {})?;
         let service_account_path =
             service_account_path.ok_or(Error::MissingServiceAccountPath)?;
-        let client = client.unwrap_or_else(Client::new);
 
+        let client = match (proxy_url, client) {
+            (_, Some(client)) => client,
+            (Some(url), None) => {
+                let pr = Proxy::all(&url).map_err(|source| Error::ProxyUrl { source })?;
+                Client::builder()
+                    .proxy(pr)
+                    .build()
+                    .map_err(|source| Error::ProxyUrl { source })?
+            }
+            (None, None) => Client::new(),
+        };
+
+        println!("herereere");

Review Comment:
   ```suggestion
   ```



##########
object_store/src/azure/client.rs:
##########
@@ -82,6 +82,9 @@ pub(crate) enum Error {
     Authorization {
         source: crate::azure::credential::Error,
     },
+
+    #[snafu(display("Unable to use proxy url: , {}", source))]

Review Comment:
   ```suggestion
       #[snafu(display("Unable to use proxy url: {}", source))]
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] sum12 commented on pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
sum12 commented on PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#issuecomment-1319146717

   added some unit-test. tried it against a local socks5 server


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] askoa commented on a diff in pull request #3109: object_store: add support for using proxy_url for connection testing

Posted by GitBox <gi...@apache.org>.
askoa commented on code in PR #3109:
URL: https://github.com/apache/arrow-rs/pull/3109#discussion_r1025940409


##########
object_store/src/aws/mod.rs:
##########
@@ -561,6 +571,13 @@ impl AmazonS3Builder {
         let bucket = self.bucket_name.context(MissingBucketNameSnafu)?;
         let region = self.region.context(MissingRegionSnafu)?;
 
+        let clientbuilder = if let Some(url) = self.proxy_url {

Review Comment:
   The better coding pattern is 
   
   ```
   let clientbuilder = match self.proxy_url {
       Some(url) => {},
       None => {}
   }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org