You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "felipepessoto (via GitHub)" <gi...@apache.org> on 2026/08/22 02:54:06 UTC
[PR] [GLUTEN-12850][VL] Support multiple Dev Container configurations [gluten]
felipepessoto opened a new pull request, #12853:
URL: https://github.com/apache/gluten/pull/12853
## What changes are proposed in this pull request?
Fixes #12850.
Follow-up to #12778, which made the dynamic-link image the default development environment.
- Keep `.devcontainer/devcontainer.json` as the default dynamic-link configuration for daily Velox development and Spark unit tests.
- Add `.devcontainer/velox-static/devcontainer.json` for portable jar packaging and vcpkg issue reproduction.
- Share the post-create setup while printing build instructions for the selected configuration.
- Keep dynamic and static ccache/Maven state separate, and persist the static image's `/var/cache/vcpkg` binary cache.
- Keep cloud-filesystem dependencies and native tests disabled in the static packaging workflow unless explicitly requested.
- Select the arm64 vcpkg triplet automatically when the static configuration runs on arm64.
- Document configuration selection in VS Code and Codespaces, image limitations, resource requirements and safe switching.
The Spark 4.1 instructions now explicitly switch the dynamic environment from its default JDK 8 to JDK 17:
```bash
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk
export PATH="$JAVA_HOME/bin:$PATH"
java -version # must report 17
```
`buildbundle-veloxbe.sh` adds the Java 17 Maven profile and release target for Spark 4.x, but a Maven profile cannot switch the JDK that is already running. Without this step Scala fails with `'17' is not a valid choice for '-release'`.
## How was this patch tested?
- Parsed both configurations with `@devcontainers/cli 0.88.0 read-configuration`.
- Ran both post-create variants and verified the dynamic Spark 4.1 instructions, static packaging instructions, unknown-variant failure and idempotent arm64 environment setup.
- Built Spark 4.1 under OpenJDK 17 with the same Maven command used by `buildbundle-veloxbe.sh`: `BUILD SUCCESS` in 4:23, producing `gluten-package-1.8.0-SNAPSHOT-4.1.jar`.
- Validated the final static command end to end on CentOS 9/GCC 12/JDK 17 using the Maven repository and vcpkg binary cache extracted from `apache/gluten:vcpkg-centos-9`:
```bash
./dev/buildbundle-veloxbe.sh --enable_vcpkg=ON --build_arrow=OFF \
--spark_version=3.5
```
The build processed 124 vcpkg packages, completed in 24:55 and produced `cpp/build/releases/libgluten.so` plus the 88 MB `gluten-velox-bundle-spark3.5_2.12-linux_amd64-1.8.0-SNAPSHOT.jar`.
- Ran `bash -n`, the license-header check, `git diff --check` and VS Code diagnostics with no errors.
## Was this patch authored or co-authored using generative AI tooling?
Generated-by: GitHub Copilot CLI gpt-5.6-sol
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-12850][VL] Support multiple Dev Container configurations [gluten]
Posted by "philo-he (via GitHub)" <gi...@apache.org>.
philo-he merged PR #12853:
URL: https://github.com/apache/gluten/pull/12853
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-12850][VL] Support multiple Dev Container configurations [gluten]
Posted by "felipepessoto (via GitHub)" <gi...@apache.org>.
felipepessoto commented on PR #12853:
URL: https://github.com/apache/gluten/pull/12853#issuecomment-5434494644
@zhouyuan @philo-he @FelixYBW, when you have a chance, could you please review? It implements the multiple Dev Container configurations discussed in #12778.
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-12850][VL] Support multiple Dev Container configurations [gluten]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #12853:
URL: https://github.com/apache/gluten/pull/12853#discussion_r3837997596
##########
.devcontainer/post-create.sh:
##########
@@ -26,13 +26,65 @@
set -uo pipefail
NUM_THREADS_MARKER='# >>> gluten dev container num_threads >>>'
+STATIC_ARM_MARKER='# >>> gluten static dev container arm64 >>>'
+DEV_CONTAINER_VARIANT=${GLUTEN_DEV_CONTAINER_VARIANT:-velox-dynamic}
-warn() { echo "WARNING: $*" >&2; }
+WARNINGS=()
+warn() {
+ echo "WARNING: $*" >&2
+ WARNINGS+=("$*")
+}
echo "Preparing the Gluten dev container..."
-# Spark 4.0/4.1 and the UDF tests need JDK 17, which this JDK 8 image lacks.
-# Both JDKs can coexist: JAVA_HOME still points at JDK 8 for the default build.
+# The container runs as root while the bind-mounted workspace retains the host
+# user's ownership. Register only this repository so Git accepts that mismatch.
+WORKSPACE_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)
+if ! git config --global --get-all safe.directory 2>/dev/null |
+ grep -Fqx "$WORKSPACE_DIR"; then
+ git config --global --add safe.directory "$WORKSPACE_DIR" ||
+ warn "could not mark $WORKSPACE_DIR as a safe Git directory."
+fi
+
+# /workspaces persists across "Reopen in Container"/"Rebuild Container" and
+# across switching between the velox-dynamic and velox-static configs, but
+# ep/build-velox/build/velox_ep/_build and cpp/build bake in the vcpkg
+# toolchain choice (or its absence) at first CMake configure and CMake never
+# re-evaluates it. Reusing a build tree from the other variant does not error
+# clearly -- it silently resolves dependencies like zlib/zstd from the wrong
+# place and fails much later, e.g. "could not find SnappyConfig.cmake", deep
+# into a build that can take hours. Catch the mismatch up front instead.
+check_stale_build_tree() {
+ local cache="$1"
+ [ -f "$cache" ] || return 0
+ local has_toolchain=false
+ grep -q '^CMAKE_TOOLCHAIN_FILE:' "$cache" 2>/dev/null && has_toolchain=true
+
+ if [ "$DEV_CONTAINER_VARIANT" = "velox-static" ] && [ "$has_toolchain" = false ]; then
+ warn "$cache was configured without the vcpkg toolchain (looks like it came from the velox-dynamic container, or a build before --enable_vcpkg=ON). Remove stale build trees before building here: rm -rf ep/build-velox/build/velox_ep/_build cpp/build"
+ elif [ "$DEV_CONTAINER_VARIANT" = "velox-dynamic" ] && [ "$has_toolchain" = true ]; then
+ warn "$cache was configured with the vcpkg toolchain (looks like it came from the velox-static container). Remove stale build trees before building here: rm -rf ep/build-velox/build/velox_ep/_build cpp/build"
Review Comment:
This warning text implies the build tree necessarily came from the velox-static container, but it can also be created in the dynamic container by running a build with `--enable_vcpkg=ON`. Mentioning that case should reduce confusion when users intentionally enable vcpkg outside the static config.
--
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: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org