-
Notifications
You must be signed in to change notification settings - Fork 173
ci: verify source using OS-installed dependencies #2718
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,10 @@ defaults: | |
| # 'bash' will expand to -eo pipefail | ||
| shell: bash | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| source: | ||
| # For cron: only run on the main repo, not forks | ||
|
|
@@ -201,3 +205,31 @@ jobs: | |
| run: | | ||
| pushd arrow-adbc | ||
| docker compose run -e PYTHON=3.12 --rm python-debug | ||
|
|
||
| source-verify-docker: | ||
| name: "Verify Source (OS)/${{ matrix.os }} ${{ matrix.version }}" | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| max-parallel: 2 | ||
| matrix: | ||
| include: | ||
| - os: ubuntu | ||
| version: "22.04" | ||
| - os: ubuntu | ||
| version: "24.04" | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| path: arrow-adbc | ||
| persist-credentials: false | ||
| submodules: recursive | ||
|
|
||
| - name: Verify | ||
| env: | ||
| OS: ${{ matrix.os }} | ||
| OS_VERSION: ${{ matrix.version }} | ||
| run: | | ||
| # Hmm, -e doesn't work? | ||
| pushd arrow-adbc | ||
| env ${OS@U}=${OS_VERSION} docker compose run --rm verify-all-${OS} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow! I didn't know |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| #!/bin/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. | ||
| # | ||
|
|
||
| # Test the validation script using system dependencies instead of Conda. This | ||
| # script is meant for automation (e.g. Docker), not a local/developer machine | ||
| # (except via Docker). | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| main() { | ||
| local -r source_dir="${1}" | ||
|
|
||
| # Install all the dependencies we need for all the subprojects | ||
|
|
||
| # When installing tzdata, don't block and wait for user input | ||
| export DEBIAN_FRONTEND=noninteractive | ||
| export TZ=Etc/UTC | ||
|
|
||
| apt update | ||
| apt install -y \ | ||
| apt-transport-https \ | ||
| build-essential \ | ||
| ca-certificates \ | ||
| cmake \ | ||
| curl \ | ||
| dirmngr \ | ||
| git \ | ||
| gobject-introspection \ | ||
| gpg \ | ||
| libgirepository1.0-dev \ | ||
| libglib2.0-dev \ | ||
| libgmock-dev \ | ||
| libgtest-dev \ | ||
| libpq-dev \ | ||
| libsqlite3-dev \ | ||
| lsb-release \ | ||
| ninja-build \ | ||
| pkg-config \ | ||
| python3 \ | ||
| python3-dev \ | ||
| python3-pip \ | ||
| python3-venv \ | ||
| ruby-full \ | ||
| software-properties-common \ | ||
| wget | ||
|
|
||
| # Install Java | ||
|
|
||
| wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | \ | ||
| gpg --dearmor | \ | ||
| tee /etc/apt/trusted.gpg.d/adoptium.gpg > /dev/null | ||
|
|
||
| echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | \ | ||
| tee /etc/apt/sources.list.d/adoptium.list | ||
|
|
||
| # Install R | ||
| # https://cloud.r-project.org/bin/linux/ubuntu/ | ||
|
|
||
| wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | \ | ||
| tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc | ||
|
|
||
| add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/" | ||
|
||
|
|
||
| # Install Arrow GLib | ||
| wget https://repo1.maven.org/maven2/org/apache/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | ||
lidavidm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| apt install -y -V ./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | ||
|
|
||
| apt update | ||
| apt install -y \ | ||
| libarrow-dev \ | ||
| libarrow-glib-dev \ | ||
| r-base \ | ||
| temurin-21-jdk | ||
|
|
||
| # Install Maven | ||
| wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz | ||
| mkdir -p /opt/maven | ||
| tar -C /opt/maven -xzvf apache-maven-3.9.9-bin.tar.gz --strip-components=1 | ||
| export PATH=/opt/maven/bin:$PATH | ||
|
|
||
| # We run under Docker and this is necessary since the source dir is mounted in | ||
lidavidm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| git config --global --add safe.directory "${source_dir}" | ||
|
|
||
| "${source_dir}/dev/release/verify-release-candidate.sh" | ||
| } | ||
|
|
||
| main "$@" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,38 +246,42 @@ install_dotnet() { | |
| return 0 | ||
| fi | ||
|
|
||
| show_info "Ensuring that .NET is installed..." | ||
|
|
||
| if dotnet --version | grep 8\.0 > /dev/null 2>&1; then | ||
| local csharp_bin=$(dirname $(which dotnet)) | ||
| show_info "Found C# at $(which csharp) (.NET $(dotnet --version))" | ||
| else | ||
| if which dotnet > /dev/null 2>&1; then | ||
| show_info "dotnet found but it is the wrong version and will be ignored." | ||
| if command -v dotnet; then | ||
| show_info "Found $(dotnet --version) at $(which dotnet)" | ||
|
|
||
| if dotnet --version | grep 8\.0 > /dev/null 2>&1; then | ||
lidavidm marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| local csharp_bin=$(dirname $(which dotnet)) | ||
| show_info "Found C# at $(which csharp) (.NET $(dotnet --version))" | ||
| DOTNET_ALREADY_INSTALLED=1 | ||
| return 0 | ||
| fi | ||
| local csharp_bin=${ARROW_TMPDIR}/csharp/bin | ||
| local dotnet_version=8.0.204 | ||
| local dotnet_platform= | ||
| case "$(uname)" in | ||
| fi | ||
|
|
||
| show_info "dotnet found but it is the wrong version or dotnet not found" | ||
|
|
||
| local csharp_bin=${ARROW_TMPDIR}/csharp/bin | ||
| local dotnet_version=8.0.204 | ||
| local dotnet_platform= | ||
| case "$(uname)" in | ||
| Linux) | ||
| dotnet_platform=linux | ||
| ;; | ||
| dotnet_platform=linux | ||
| ;; | ||
| Darwin) | ||
| dotnet_platform=macos | ||
| ;; | ||
| esac | ||
| local dotnet_download_thank_you_url=https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-${dotnet_version}-${dotnet_platform}-x64-binaries | ||
| local dotnet_download_url=$( \ | ||
| curl -sL ${dotnet_download_thank_you_url} | \ | ||
| grep 'directLink' | \ | ||
| grep -E -o 'https://download[^"]+' | \ | ||
| sed -n 2p) | ||
| mkdir -p ${csharp_bin} | ||
| curl -sL ${dotnet_download_url} | \ | ||
| dotnet_platform=macos | ||
| ;; | ||
| esac | ||
| local dotnet_download_thank_you_url=https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-${dotnet_version}-${dotnet_platform}-x64-binaries | ||
| show_info "Getting .NET download URL from ${dotnet_download_thank_you_url}" | ||
|
Comment on lines
+273
to
+274
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I appreciate the politeness exuded by dotnet's download URL 🙂 |
||
| local dotnet_download_url=$(curl -sL ${dotnet_download_thank_you_url} | \ | ||
| grep 'directLink' | \ | ||
| grep -E -o 'https://download[^"]+' | \ | ||
| sed -n 2p) | ||
| show_info "Downloading .NET from ${dotnet_download_url}" | ||
| mkdir -p ${csharp_bin} | ||
| curl -sL ${dotnet_download_url} | \ | ||
| tar xzf - -C ${csharp_bin} | ||
| PATH=${csharp_bin}:${PATH} | ||
| show_info "Installed C# at $(which csharp) (.NET $(dotnet --version))" | ||
| fi | ||
| PATH=${csharp_bin}:${PATH} | ||
| show_info "Installed C# at $(which csharp) (.NET $(dotnet --version))" | ||
|
|
||
| DOTNET_ALREADY_INSTALLED=1 | ||
| } | ||
|
|
@@ -296,6 +300,18 @@ install_go() { | |
| return 0 | ||
| fi | ||
|
|
||
| local prefix=${ARROW_TMPDIR}/go | ||
| mkdir -p $prefix | ||
|
|
||
| if [ -f "${prefix}/go/bin/go" ]; then | ||
| export GOROOT=${prefix}/go | ||
| export GOPATH=${prefix}/gopath | ||
| export PATH=$GOROOT/bin:$GOPATH/bin:$PATH | ||
| show_info "Found $(go version) at ${prefix}/go/bin/go" | ||
| GO_ALREADY_INSTALLED=1 | ||
| return 0 | ||
| fi | ||
|
|
||
| local version=1.24.2 | ||
| show_info "Installing go version ${version}..." | ||
|
|
||
|
|
@@ -315,8 +331,6 @@ install_go() { | |
| local archive="go${version}.${os}-${arch}.tar.gz" | ||
| curl -sLO https://go.dev/dl/$archive | ||
|
|
||
| local prefix=${ARROW_TMPDIR}/go | ||
| mkdir -p $prefix | ||
| tar -xzf $archive -C $prefix | ||
| rm -f $archive | ||
|
|
||
|
|
@@ -549,7 +563,7 @@ test_python() { | |
| show_header "Build and test Python libraries" | ||
|
|
||
| # Build and test Python | ||
| maybe_setup_virtualenv cython duckdb pandas protobuf pyarrow pytest setuptools_scm setuptools importlib_resources || exit 1 | ||
| maybe_setup_virtualenv cython duckdb pandas polars protobuf pyarrow pytest setuptools_scm setuptools importlib_resources || exit 1 | ||
| # XXX: pin Python for now since various other packages haven't caught up | ||
| maybe_setup_conda --file "${ADBC_DIR}/ci/conda_env_python.txt" python=3.12 || exit 1 | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't get it to work - I'll just remove the comment but I'm not quite sure what's going on here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean that this step isn't failed when
docker compose runis failed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh - no, the step works. What I mean is that I expected
docker compose run -e UBUNTU=22.04 ...to also work, but it seems that docker ignores the-eswitch.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I understand.
env UBUNTU=22.04 ...is used in${UBUNTU}incompose.yamland... -e UBUNTU=22.04 ...is used in a container created bydocker compose run. In this case, we want to use${UBUNTU}incompose.yaml. So we need to useenv UBUNTU=22.04 ...not... -e UBUNTU=22.04 ...here.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's expected. Because we use
${UBUNTU}at https://github.com/apache/arrow-adbc/pull/2718/files#diff-facaded51b7d1c9656ae43b449b69aa398fee9129321a0001d97048c00c8cc1cR282 .It's in
compose.yaml. It's referred BEFOREdocker compose runcreates a container.docker compose run -esets an environment variable for container.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I didn't see your first comment somehow. I suppose I misunderstood how they work together then, or maybe it's archery that uses
-eto set variables for the container?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both of Archery and
docker compose runuse-eto set environment variables for the container. (archery docker runis a wrapper ofdocker compose run.)FYI: We need to use
UBUNTU=24.04 archery docker run ubuntu-cppto use Ubuntu 24.04 forubuntu-cppservice. We can't use-efor it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, then I just misunderstood how it works in the first place, sorry 🙁