Jefffrey commented on code in PR #19863: URL: https://github.com/apache/datafusion/pull/19863#discussion_r2701129730
########## docs/Dockerfile: ########## @@ -0,0 +1,74 @@ +# 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. + +FROM python:3.11-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + build-essential \ + graphviz \ + && rm -rf /var/lib/apt/lists/* + +# Install Rust 1.92.0 +ENV RUST_VERSION=1.92.0 +ENV RUSTUP_VERSION=1.27.1 +RUN set -eux; \ + arch="$(uname -m)"; \ + case "${arch}" in \ + x86_64) rustup_arch="x86_64-unknown-linux-gnu" ;; \ + aarch64) rustup_arch="aarch64-unknown-linux-gnu" ;; \ + *) echo "Unsupported architecture: ${arch}" >&2; exit 1 ;; \ + esac; \ + curl --proto '=https' --tlsv1.2 -sSf \ + "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustup_arch}/rustup-init" \ + -o rustup-init; \ + chmod +x rustup-init; \ + ./rustup-init \ + --default-toolchain "${RUST_VERSION}" \ + --component rustfmt \ + --profile minimal \ + -y; \ + rm rustup-init + +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install cargo-depgraph Review Comment: Please remove these LLM comments they are not useful ########## docs/entrypoint.sh: ########## @@ -0,0 +1,30 @@ +#!/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 -euo pipefail + +# Fix line endings when running (for volume-mounted files from Windows) only if needed +if find /work -name '*.sh' -type f -print0 | xargs -0 grep -Il $'\r' >/dev/null 2>&1; then + echo "Converting CRLF to LF in shell scripts..." + find /work -name '*.sh' -type f -exec sh -c 'tr -d "\r" < "$1" > "$1.tmp" && mv "$1.tmp" "$1"' _ {} \; Review Comment: I question the need for this logic; why exactly do we need it in the entrypoint script and in the build stage? ########## docs/Dockerfile: ########## @@ -0,0 +1,74 @@ +# 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. + +FROM python:3.11-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + build-essential \ + graphviz \ + && rm -rf /var/lib/apt/lists/* + +# Install Rust 1.92.0 +ENV RUST_VERSION=1.92.0 +ENV RUSTUP_VERSION=1.27.1 +RUN set -eux; \ Review Comment: We're probably better off using a Rust image and installing Python as likely it'd be simpler ########## docker-compose.yml: ########## @@ -0,0 +1,25 @@ +# 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. + +services: Review Comment: Why do we need a docker-compose? ########## docs/Dockerfile: ########## @@ -0,0 +1,74 @@ +# 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. + +FROM python:3.11-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y --no-install-recommends \ + curl \ + build-essential \ + graphviz \ + && rm -rf /var/lib/apt/lists/* + +# Install Rust 1.92.0 +ENV RUST_VERSION=1.92.0 +ENV RUSTUP_VERSION=1.27.1 +RUN set -eux; \ + arch="$(uname -m)"; \ + case "${arch}" in \ + x86_64) rustup_arch="x86_64-unknown-linux-gnu" ;; \ + aarch64) rustup_arch="aarch64-unknown-linux-gnu" ;; \ + *) echo "Unsupported architecture: ${arch}" >&2; exit 1 ;; \ + esac; \ + curl --proto '=https' --tlsv1.2 -sSf \ + "https://static.rust-lang.org/rustup/archive/${RUSTUP_VERSION}/${rustup_arch}/rustup-init" \ + -o rustup-init; \ + chmod +x rustup-init; \ + ./rustup-init \ + --default-toolchain "${RUST_VERSION}" \ + --component rustfmt \ + --profile minimal \ + -y; \ + rm rustup-init + +ENV PATH="/root/.cargo/bin:${PATH}" + +# Install cargo-depgraph +RUN cargo install cargo-depgraph --version ^1.6 --locked + +# Set working directory +WORKDIR /work + +# Copy Python requirements and install them +COPY docs/requirements.txt /work/docs/requirements.txt +RUN pip install --no-cache-dir -r /work/docs/requirements.txt + +# Copy the entire repository +COPY . /work Review Comment: Copying the entire repository into the docker container does not seem correct -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
