raulcd commented on code in PR #14596: URL: https://github.com/apache/arrow/pull/14596#discussion_r1085138234
########## ci/docker/conda-python-substrait.dockerfile: ########## @@ -0,0 +1,49 @@ +# 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 +ARG python=3.9 + +FROM ${repo}:${arch}-conda-python-${python} + +COPY ci/conda_env_python.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_sphinx.txt \ + $([ "$python" == "3.9" ] && echo "pickle5") \ + python=${python} openjdk \ + nomkl && \ + mamba clean --all + + +ARG substrait=latest +COPY ci/scripts/install_substrait_consumer.sh /arrow/ci/scripts/ +COPY ci/scripts/integration_substrait.sh /arrow/ci/scripts/ Review Comment: Integration should be executed as part of the command. It requires pyarrow to be built. We can remove this line ```suggestion ``` ########## ci/scripts/install_substrait_consumer.sh: ########## @@ -0,0 +1,38 @@ +#!/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 + +echo "Install Substrait Consumer Test Suite"; + +git clone https://github.com/substrait-io/consumer-testing.git +cd consumer-testing +# avoid installing pyarrow +grep -v pyarrow requirements.txt | while read line Review Comment: we should also ignore `--extra-index-url https://pypi.fury.io/arrow-nightlies --prefer-binary --pre` ```suggestion grep -v 'pyarrow\|arrow-nightlies' requirements.txt | while read line ``` or just ```suggestion grep -v arrow requirements.txt | while read line ``` otherwise we get the following error when building: ``` #11 12.18 ERROR: You must give at least one requirement to install (see "pip help install") #11 ERROR: executor failed running [/bin/bash -c -l /arrow/ci/scripts/install_substrait_consumer.sh]: exit code: 1 ``` ########## ci/docker/conda-python-substrait.dockerfile: ########## @@ -0,0 +1,45 @@ +# 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 +ARG python=3.9 + +FROM ${repo}:${arch}-conda-python-${python} + +COPY ci/conda_env_python.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_sphinx.txt \ + $([ "$python" == "3.9" ] && echo "pickle5") \ + python=${python} openjdk \ + nomkl && \ + mamba clean --all + + +ARG substrait=latest +COPY ci/scripts/install_substrait_consumer.sh /arrow/ci/scripts/ + Review Comment: Thanks @vibhatha ! I've tested locally and added some comments. We can install substrait consumer on build but running the integration tests should be done as part of the command as, as you suggested, requires pyarrow to be built. As per the new dependency for `openjdk` I missed that, sounds good to me! ########## docker-compose.yml: ########## @@ -1144,6 +1145,32 @@ services: /arrow/ci/scripts/python_build.sh /arrow /build && /arrow/ci/scripts/integration_dask.sh"] + conda-python-substrait: + # Usage: + # docker-compose build conda + # docker-compose build conda-cpp + # docker-compose build conda-python + # docker-compose build conda-python-substrait + # docker-compose run --rm conda-python-substrait + image: ${REPO}:${ARCH}-conda-python-${PYTHON} + build: + context: . + dockerfile: ci/docker/conda-python-substrait.dockerfile + cache_from: + - ${REPO}:${ARCH}-conda-python-${PYTHON} + args: + repo: ${REPO} + arch: ${ARCH} + python: ${PYTHON} + shm_size: *shm-size + environment: + <<: *ccache + ARROW_SUBSTRAIT: "ON" + volumes: *conda-volumes + command: + ["/arrow/ci/scripts/cpp_build.sh /arrow /build && + /arrow/ci/scripts/python_build.sh /arrow /build"] Review Comment: This is required to be run after builing CPP and Python: ```suggestion /arrow/ci/scripts/python_build.sh /arrow /build && /arrow/ci/scripts/integration_substrait.sh"] ``` ########## ci/docker/conda-python-substrait.dockerfile: ########## @@ -0,0 +1,49 @@ +# 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 +ARG python=3.9 + +FROM ${repo}:${arch}-conda-python-${python} + +COPY ci/conda_env_python.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_sphinx.txt \ + $([ "$python" == "3.9" ] && echo "pickle5") \ + python=${python} openjdk \ + nomkl && \ + mamba clean --all + + +ARG substrait=latest +COPY ci/scripts/install_substrait_consumer.sh /arrow/ci/scripts/ +COPY ci/scripts/integration_substrait.sh /arrow/ci/scripts/ + +ENV ARROW_BUILD_TESTS=ON \ + ARROW_COMPUTE=ON \ + ARROW_CSV=ON \ + ARROW_DATASET=ON \ + ARROW_FILESYSTEM=ON \ + ARROW_JSON=ON \ + ARROW_SUBSTRAIT=ON + +RUN /arrow/ci/scripts/install_substrait_consumer.sh +RUN /arrow/ci/scripts/integration_substrait.sh Review Comment: This requires to be executed after pyarrow is built. ```suggestion ``` -- 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]
