pitrou commented on a change in pull request #11136:
URL: https://github.com/apache/arrow/pull/11136#discussion_r710159406



##########
File path: ci/scripts/integration_minio.py
##########
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This file is called from the integration_minio crossbow job
+
+import pyarrow.fs as fs
+
+def test_can_create_bucket():
+    filesystem = fs.S3FileSystem(access_key='limited', 
secret_key='limited123', endpoint_override='http://127.0.0.1:9000')
+    filesystem.create_dir('existing-bucket/foo') # This line fails without the 
change

Review comment:
       Also, note the comment is a bit cryptic (what is "the change"? there 
should be probably be a JIRA reference here)

##########
File path: ci/scripts/integration_minio.py
##########
@@ -0,0 +1,24 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# This file is called from the integration_minio crossbow job
+
+import pyarrow.fs as fs
+
+def test_can_create_bucket():
+    filesystem = fs.S3FileSystem(access_key='limited', 
secret_key='limited123', endpoint_override='http://127.0.0.1:9000')
+    filesystem.create_dir('existing-bucket/foo') # This line fails without the 
change

Review comment:
       These files are probably not linted by `archery lint`, but can you 
ensure line length doesn't go over 80-85 characters?

##########
File path: ci/scripts/integration_minio.sh
##########
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -e
+
+source_dir=${1}
+build_dir=${2}
+
+mkdir ./minio_integration
+
+# Not ideal but need to run minio server in the background
+# and ensure it is up and running.
+minio server ./minio_integration --address 127.0.0.1:9000 &
+sleep 30
+
+echo '{
+  "Version": "2012-10-17",
+  "Statement": [
+    {
+      "Effect": "Allow",
+      "Action": [
+          "s3:ListAllMyBuckets",
+         "s3:PutObject",
+         "s3:GetObject",
+         "s3:ListBucket",
+         "s3:PutObjectTagging",
+         "s3:DeleteObject",
+         "s3:GetObjectVersion"
+      ],
+      "Resource": [
+        "arn:aws:s3:::*"
+      ]
+    }
+  ]
+}' > ./limited_policy.json
+
+# Create a user with limited permissions
+mc alias set myminio http://127.0.0.1:9000 minioadmin minioadmin
+mc admin policy add myminio/ no-create-buckets ./limited_policy.json
+mc admin user add myminio/ limited limited123
+mc admin policy set myminio no-create-buckets user=limited
+# Create a bucket
+mc mb myminio/existing-bucket
+
+# Run Arrow tests relying on limited permissions user
+
+python -mpytest ${source_dir}/ci/scripts/integration_minio.py

Review comment:
       I am not entirely sure an integration is deserved for this (after all 
we're just checking a single regression), though I have no strong opinion. 
@jorisvandenbossche What do you think?

##########
File path: ci/docker/conda-python-minio.dockerfile
##########
@@ -0,0 +1,22 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+ARG repo
+ARG arch=amd64
+ARG python=3.6
+FROM ${repo}:${arch}-conda-python-${python}

Review comment:
       Is this file useful, since it doesn't seem to add anything to 
`conda-python.dockerfile`?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to