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

GH-35021: [Python][CI] Use conda's gdb in test-conda-python #35024

Merged
merged 1 commit into from
Apr 11, 2023

Conversation

kou
Copy link
Member

@kou kou commented Apr 11, 2023

Rationale for this change

If we use system gdb, we can't import build-in libraries such as math:

(gdb) source /arrow/cpp/gdb_arrow.py
Traceback (most recent call last):
  File "/arrow/cpp/gdb_arrow.py", line 20, in <module>
    import datetime
  File "/usr/lib/python3.10/datetime.py", line 12, in <module>
    import math as _math
ModuleNotFoundError: No module named 'math'

Because system gdb is built with system Python not conda's Python.

What changes are included in this PR?

Use conda's gdb instead of system gdb.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

If we use system gdb, we can't import build-in libraries such as math:

    (gdb) source /arrow/cpp/gdb_arrow.py
    Traceback (most recent call last):
      File "/arrow/cpp/gdb_arrow.py", line 20, in <module>
        import datetime
      File "/usr/lib/python3.10/datetime.py", line 12, in <module>
        import math as _math
    ModuleNotFoundError: No module named 'math'

Because system gdb is built with system Python not conda's Python.
@kou
Copy link
Member Author

kou commented Apr 11, 2023

@github-actions crossbow submit test-conda-python-*

@github-actions
Copy link

@github-actions
Copy link

⚠️ GitHub issue #35021 has been automatically assigned in GitHub to PR creator.

@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Apr 11, 2023
@github-actions
Copy link

Revision: 5aa58ea

Submitted crossbow builds: ursacomputing/crossbow @ actions-7c722c7903

Task Status
test-conda-python-3.10 Github Actions
test-conda-python-3.11 Github Actions
test-conda-python-3.7 Github Actions
test-conda-python-3.7-hdfs-2.9.2 Github Actions
test-conda-python-3.7-hdfs-3.2.1 Github Actions
test-conda-python-3.7-pandas-1.0 Github Actions
test-conda-python-3.7-pandas-latest Github Actions
test-conda-python-3.7-spark-v3.1.2 Github Actions
test-conda-python-3.8 Github Actions
test-conda-python-3.8-hypothesis Github Actions
test-conda-python-3.8-pandas-latest Github Actions
test-conda-python-3.8-pandas-nightly Github Actions
test-conda-python-3.8-spark-v3.2.0 Github Actions
test-conda-python-3.9 Github Actions
test-conda-python-3.9-dask-latest Github Actions
test-conda-python-3.9-dask-upstream_devel Github Actions
test-conda-python-3.9-pandas-upstream_devel Github Actions
test-conda-python-3.9-spark-master Github Actions
test-conda-python-3.9-substrait Github Actions

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Apr 11, 2023
@kou kou merged commit 053acab into apache:main Apr 11, 2023
@kou kou deleted the ci-python-gdb branch April 11, 2023 07:24
@jorisvandenbossche
Copy link
Member

@kou unfortunately this made appveyor fail, conda fails trying to install gdb on windows (since that package doesn't exist for Windows)

@jorisvandenbossche
Copy link
Member

jorisvandenbossche commented Apr 11, 2023

Unfortunately, there doesn't seem to be an easy way to specify OS-specific packages in environment or requirement files with conda .. (see eg conda/conda#8089, conda/conda#11198)

So we probably need to remove gdb again from the file, and move its installation inside the docker setup script?

@kou
Copy link
Member Author

kou commented Apr 11, 2023

Oh...
Does this work? (I can try this tomorrow. If you can't wait, feel free to try.)

diff --git a/ci/conda_env_python.txt b/ci/conda_env_python.txt
index 254acbc684..04f985c94b 100644
--- a/ci/conda_env_python.txt
+++ b/ci/conda_env_python.txt
@@ -21,7 +21,6 @@ cffi
 cython
 cloudpickle
 fsspec
-gdb
 hypothesis
 numpy>=1.16.6
 pytest
diff --git a/ci/conda_env_python_unix.txt b/ci/conda_env_python_unix.txt
new file mode 100644
index 0000000000..fab6699797
--- /dev/null
+++ b/ci/conda_env_python_unix.txt
@@ -0,0 +1,18 @@
+# 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.
+
+gdb
diff --git a/ci/docker/conda-python.dockerfile b/ci/docker/conda-python.dockerfile
index 6a6ae73585..86d292bb67 100644
--- a/ci/docker/conda-python.dockerfile
+++ b/ci/docker/conda-python.dockerfile
@@ -22,10 +22,12 @@ FROM ${repo}:${arch}-conda-cpp
 # install python specific packages
 ARG python=3.8
 COPY ci/conda_env_python.txt \
+     ci/conda_env_python_unix.txt \
      ci/conda_env_sphinx.txt \
      /arrow/ci/
 RUN mamba install -q -y \
         --file arrow/ci/conda_env_python.txt \
+        --file arrow/ci/conda_env_python_unix.txt \
         --file arrow/ci/conda_env_sphinx.txt \
         $([ "$python" == "3.7" ] && echo "pickle5") \
         python=${python} \

@jorisvandenbossche
Copy link
Member

Yes, that should work. Or, instead of creating a new file, just add "gdb" in conda-python.dockerfile, like

diff --git a/ci/docker/conda-python.dockerfile b/ci/docker/conda-python.dockerfile
index 6a6ae7358..0b3fbdf13 100644
--- a/ci/docker/conda-python.dockerfile
+++ b/ci/docker/conda-python.dockerfile
@@ -29,6 +29,7 @@ RUN mamba install -q -y \
         --file arrow/ci/conda_env_sphinx.txt \
         $([ "$python" == "3.7" ] && echo "pickle5") \
         python=${python} \
+        gdb \
         nomkl && \
     mamba clean --all

@ursabot
Copy link

ursabot commented Apr 11, 2023

Benchmark runs are scheduled for baseline = c70c3d5 and contender = 053acab. 053acab is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Failed] test-mac-arm
[Finished ⬇️0.0% ⬆️0.0%] ursa-i9-9960x
[Finished ⬇️0.68% ⬆️0.09%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 053acabd ec2-t3-xlarge-us-east-2
[Failed] 053acabd test-mac-arm
[Finished] 053acabd ursa-i9-9960x
[Finished] 053acabd ursa-thinkcentre-m75q
[Finished] c70c3d51 ec2-t3-xlarge-us-east-2
[Finished] c70c3d51 test-mac-arm
[Finished] c70c3d51 ursa-i9-9960x
[Finished] c70c3d51 ursa-thinkcentre-m75q
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

@kou
Copy link
Member Author

kou commented Apr 11, 2023

Or, instead of creating a new file, just add "gdb" in conda-python.dockerfile

I think that the creating a new file approach is better because PyArrow developers can also use it to setup their environment.
Anyway, we can discuss it on #35057.

liujiacheng777 pushed a commit to LoongArch-Python/arrow that referenced this pull request May 11, 2023
…ache#35024)

### Rationale for this change

If we use system gdb, we can't import build-in libraries such as math:

    (gdb) source /arrow/cpp/gdb_arrow.py
    Traceback (most recent call last):
      File "/arrow/cpp/gdb_arrow.py", line 20, in <module>
        import datetime
      File "/usr/lib/python3.10/datetime.py", line 12, in <module>
        import math as _math
    ModuleNotFoundError: No module named 'math'

Because system gdb is built with system Python not conda's Python.

### What changes are included in this PR?

Use conda's gdb instead of system gdb.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#35021

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
ArgusLi pushed a commit to Bit-Quill/arrow that referenced this pull request May 15, 2023
…ache#35024)

### Rationale for this change

If we use system gdb, we can't import build-in libraries such as math:

    (gdb) source /arrow/cpp/gdb_arrow.py
    Traceback (most recent call last):
      File "/arrow/cpp/gdb_arrow.py", line 20, in <module>
        import datetime
      File "/usr/lib/python3.10/datetime.py", line 12, in <module>
        import math as _math
    ModuleNotFoundError: No module named 'math'

Because system gdb is built with system Python not conda's Python.

### What changes are included in this PR?

Use conda's gdb instead of system gdb.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#35021

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
rtpsw pushed a commit to rtpsw/arrow that referenced this pull request May 16, 2023
…ache#35024)

### Rationale for this change

If we use system gdb, we can't import build-in libraries such as math:

    (gdb) source /arrow/cpp/gdb_arrow.py
    Traceback (most recent call last):
      File "/arrow/cpp/gdb_arrow.py", line 20, in <module>
        import datetime
      File "/usr/lib/python3.10/datetime.py", line 12, in <module>
        import math as _math
    ModuleNotFoundError: No module named 'math'

Because system gdb is built with system Python not conda's Python.

### What changes are included in this PR?

Use conda's gdb instead of system gdb.

### Are these changes tested?

Yes.

### Are there any user-facing changes?

No.
* Closes: apache#35021

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting merge Awaiting merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Python][CI] gdb tests failing in test-conda-python-3.10
3 participants