From 38755d1f36de76eb014d54d95b8e6dc0555e2461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Cumplido?= Date: Tue, 17 Sep 2024 11:30:22 +0200 Subject: [PATCH] GH-43873: [Go][CI] Remove Go related test CI --- .env | 1 - .github/workflows/go.yml | 484 ------------------------------- ci/scripts/go_bench.sh | 54 ---- ci/scripts/go_bench_adapt.py | 127 -------- ci/scripts/go_build.sh | 67 ----- ci/scripts/go_cgo_python_test.sh | 51 ---- ci/scripts/go_test.sh | 89 ------ ci/scripts/go_tinygo_example.sh | 27 -- dev/tasks/tasks.yml | 18 -- docker-compose.yml | 66 ----- 10 files changed, 984 deletions(-) delete mode 100644 .github/workflows/go.yml delete mode 100755 ci/scripts/go_bench.sh delete mode 100644 ci/scripts/go_bench_adapt.py delete mode 100755 ci/scripts/go_build.sh delete mode 100755 ci/scripts/go_cgo_python_test.sh delete mode 100755 ci/scripts/go_test.sh delete mode 100755 ci/scripts/go_tinygo_example.sh diff --git a/.env b/.env index 6accb27262eef..b0a381878436b 100644 --- a/.env +++ b/.env @@ -58,7 +58,6 @@ CUDA=11.2.2 DASK=latest DOTNET=8.0 GCC_VERSION="" -GO=1.22.6 STATICCHECK=v0.5.1 HDFS=3.2.1 JDK=11 diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml deleted file mode 100644 index 9eba4c86362e1..0000000000000 --- a/.github/workflows/go.yml +++ /dev/null @@ -1,484 +0,0 @@ -# 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. - -name: Go - -on: - push: - paths: - - '.dockerignore' - - '.github/workflows/go.yml' - - 'ci/docker/*_go.dockerfile' - - 'ci/scripts/go_*' - - 'docker-compose.yml' - - 'go/**' - pull_request: - paths: - - '.dockerignore' - - '.github/workflows/go.yml' - - 'ci/docker/*_go.dockerfile' - - 'ci/docker/**' - - 'ci/scripts/go_*' - - 'docker-compose.yml' - - 'go/**' - -concurrency: - group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} - cancel-in-progress: true - -permissions: - contents: read - -env: - ARCHERY_DEBUG: 1 - -jobs: - - docker-targets: - name: Docker targets - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - outputs: - targets: ${{ steps.detect-targets.outputs.targets }} - steps: - - name: Detect targets - id: detect-targets - run: | - echo "targets<> "$GITHUB_OUTPUT" - echo "[" >> "$GITHUB_OUTPUT" - cat <> "$GITHUB_OUTPUT" - { - "arch-label": "AMD64", - "arch": "amd64", - "go": "1.22", - "runs-on": "ubuntu-latest" - }, - { - "arch-label": "AMD64", - "arch": "amd64", - "go": "1.23", - "runs-on": "ubuntu-latest" - } - JSON - if [ "$GITHUB_REPOSITORY_OWNER" = "apache" ]; then - echo "," >> "$GITHUB_OUTPUT" - cat <> "$GITHUB_OUTPUT" - { - "arch-label": "ARM64", - "arch": "arm64v8", - "go": "1.22", - "runs-on": ["self-hosted", "arm", "linux"] - }, - { - "arch-label": "ARM64", - "arch": "arm64v8", - "go": "1.23", - "runs-on": ["self-hosted", "arm", "linux"] - } - JSON - fi - echo "]" >> "$GITHUB_OUTPUT" - echo "JSON" >> "$GITHUB_OUTPUT" - - docker: - name: ${{ matrix.arch-label }} Debian 12 Go ${{ matrix.go }} - needs: docker-targets - runs-on: ${{ matrix.runs-on }} - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - include: ${{ fromJson(needs.docker-targets.outputs.targets) }} - env: - ARCH: ${{ matrix.arch }} - GO: ${{ matrix.go }} - steps: - - name: Checkout Arrow - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - with: - fetch-depth: 0 - submodules: recursive - - name: Setup Python - run: | - sudo apt update - sudo apt install -y --no-install-recommends python3 python3-dev python3-pip - - name: Setup Archery - run: python3 -m pip install -e dev/archery[docker] - - name: Execute Docker Build - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - run: archery docker run debian-go - - name: Docker Push - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - run: archery docker push debian-go - - name: Install Go ${{ matrix.go }} for Benchmarks - if: >- - success() && - matrix.arch == 'amd64' && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 - with: - go-version: ${{ matrix.go }} - cache: true - cache-dependency-path: go/go.sum - - name: Run Benchmarks - if: >- - success() && - matrix.arch == 'amd64' && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - env: - CONBENCH_URL: https://conbench.ursa.dev - CONBENCH_EMAIL: ${{ secrets.CONBENCH_EMAIL }} - CONBENCH_PASSWORD: ${{ secrets.CONBENCH_PASS }} - CONBENCH_REF: ${{ github.ref_name }} - CONBENCH_MACHINE_INFO_NAME: ${{ matrix.arch }}-debian-12 - run: | - python3 -m pip install benchadapt@git+https://github.com/conbench/conbench.git@main#subdirectory=benchadapt/python - python3 ci/scripts/go_bench_adapt.py - - build_test_386: - name: Go Cross-build and test for 386 - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 20 - steps: - - name: Checkout Arrow - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Get required Go version - run: | - (. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version: "${{ env.GO_VERSION }}" - cache: true - cache-dependency-path: go/go.sum - - name: Run build - run: GOARCH=386 go build ./... - working-directory: ./go - - name: Run test - # WIP refactor, only tests in the specified dirs have been fixed - run: GOARCH=386 go test ./parquet/file/... - working-directory: ./go - - docker_cgo: - name: AMD64 Debian 12 Go ${{ matrix.go }} - CGO - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 20 - strategy: - fail-fast: false - matrix: - go: ['1.22', '1.23'] - env: - GO: ${{ matrix.go }} - steps: - - name: Checkout Arrow - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - with: - fetch-depth: 0 - submodules: recursive - - name: Setup Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: 3.12 - - name: Setup Archery - run: pip install -e dev/archery[docker] - - name: Execute Docker Build - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - run: archery docker run debian-go-cgo - - name: Docker Push - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - run: archery docker push debian-go-cgo - - - docker_cgo_python: - name: AMD64 Debian 12 Go ${{ matrix.go }} - CGO Python - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 15 - strategy: - fail-fast: false - matrix: - go: ['1.22', '1.23'] - env: - GO: ${{ matrix.go }} - steps: - - name: Checkout Arrow - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - with: - fetch-depth: 0 - - name: Setup Python - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: 3.12 - - name: Setup Archery - run: pip install -e dev/archery[docker] - - name: Execute Docker Build - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - run: archery docker run debian-go-cgo-python - - name: Docker Push - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - env: - ARCHERY_DOCKER_USER: ${{ secrets.DOCKERHUB_USER }} - ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} - continue-on-error: true - run: archery docker push debian-go-cgo-python - - windows: - name: AMD64 Windows 2019 Go ${{ matrix.go }} - runs-on: windows-2019 - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 25 - strategy: - fail-fast: false - matrix: - go: ['1.22', '1.23'] - steps: - - name: Checkout Arrow - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - with: - fetch-depth: 0 - submodules: recursive - - name: Install go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 - with: - go-version: ${{ matrix.go }} - cache: true - cache-dependency-path: go/go.sum - - name: Install staticcheck - shell: bash - run: | - . .env - go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK} - - name: Build - shell: bash - run: ci/scripts/go_build.sh $(pwd) - - name: Test - shell: bash - run: ci/scripts/go_test.sh $(pwd) - - macos: - name: AMD64 macOS 12 Go ${{ matrix.go }} - runs-on: macos-12 - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - go: ['1.22', '1.23'] - steps: - - name: Checkout Arrow - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - with: - fetch-depth: 0 - submodules: recursive - - name: Install go - uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0 - with: - go-version: ${{ matrix.go }} - cache: true - cache-dependency-path: go/go.sum - - name: Install staticcheck - run: | - . .env - go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK} - - name: Build - shell: bash - run: ci/scripts/go_build.sh $(pwd) - - name: Test - shell: bash - run: ci/scripts/go_test.sh $(pwd) - - name: Setup Python - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0 - with: - python-version: '3.10' - - name: Run Benchmarks - if: >- - success() && - github.event_name == 'push' && - github.repository == 'apache/arrow' && - github.ref_name == 'main' - shell: bash - env: - CONBENCH_URL: 'https://conbench.ursa.dev' - CONBENCH_EMAIL: ${{ secrets.CONBENCH_EMAIL }} - CONBENCH_PASSWORD: ${{ secrets.CONBENCH_PASS }} - CONBENCH_REF: ${{ github.ref_name }} - CONBENCH_MACHINE_INFO_NAME: amd64-macos-11 - run: | - pip install benchadapt@git+https://github.com/conbench/conbench.git@main#subdirectory=benchadapt/python - python ci/scripts/go_bench_adapt.py - - - macos-cgo: - name: AMD64 macOS 12 Go ${{ matrix.go }} - CGO - runs-on: macos-12 - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - go: ['1.22', '1.23'] - env: - ARROW_GO_TESTCGO: "1" - steps: - - name: Checkout Arrow - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Install go - uses: actions/setup-go@v5 - with: - go-version: ${{ matrix.go }} - cache: true - cache-dependency-path: go/go.sum - - name: Brew Install Arrow and pkg-config - shell: bash - run: brew install apache-arrow pkg-config - - name: Install staticcheck - run: | - . .env - go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK} - - name: Add To pkg config path - shell: bash - run: | - echo "PKG_CONFIG_PATH=$(brew --prefix openssl@3)/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV - - name: Build - shell: bash - run: ci/scripts/go_build.sh $(pwd) - - name: Test - shell: bash - run: ci/scripts/go_test.sh $(pwd) - - windows-mingw: - name: AMD64 Windows MinGW ${{ matrix.mingw-n-bits }} CGO - runs-on: windows-2019 - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - timeout-minutes: 60 - strategy: - fail-fast: false - matrix: - mingw-n-bits: - #- 32 runtime handling for CGO needs 64-bit currently - - 64 - env: - ARROW_GO_TESTCGO: "1" - MINGW_LINT: "1" - steps: - - name: Disable Crash Dialogs - run: | - reg add ` - "HKCU\SOFTWARE\Microsoft\Windows\Windows Error Reporting" ` - /v DontShowUI ` - /t REG_DWORD ` - /d 1 ` - /f - - name: Checkout Arrow - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - uses: msys2/setup-msys2@v2 - with: - msystem: MINGW${{ matrix.mingw-n-bits }} - update: true - - name: Setup MSYS2 - shell: msys2 {0} - run: | - ci/scripts/msys2_setup.sh cgo - - name: Get required Go version - run: | - (. .env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV - - name: Update CGO Env vars - shell: msys2 {0} - run: | - echo "CGO_CPPFLAGS=-I$(cygpath --windows ${MINGW_PREFIX}/include)" >> $GITHUB_ENV - echo "CGO_LDFLAGS=-g -O2 -L$(cygpath --windows ${MINGW_PREFIX}/lib) -L$(cygpath --windows ${MINGW_PREFIX}/bin)" >> $GITHUB_ENV - echo "MINGW_PREFIX=$(cygpath --windows ${MINGW_PREFIX})" >> $GITHUB_ENV - - name: Install go - uses: actions/setup-go@v5 - with: - go-version: "${{ env.GO_VERSION }}" - cache: true - cache-dependency-path: go/go.sum - - name: Install staticcheck - shell: bash - run: | - . .env - go install honnef.co/go/tools/cmd/staticcheck@${STATICCHECK} - - name: Build - shell: bash - run: ci/scripts/go_build.sh $(pwd) - - name: Test - shell: bash - run: ci/scripts/go_test.sh $(pwd) - - tinygo: - name: TinyGo - runs-on: ubuntu-latest - if: ${{ !contains(github.event.pull_request.title, 'WIP') }} - env: - TINYGO_VERSION: 0.27.0 - timeout-minutes: 60 - steps: - - name: Checkout Arrow - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Build and Run Example - run: | - docker run --rm -v $(pwd)/go:/src -v $(pwd)/ci/scripts:/ci-scripts "tinygo/tinygo:$TINYGO_VERSION" /ci-scripts/go_tinygo_example.sh diff --git a/ci/scripts/go_bench.sh b/ci/scripts/go_bench.sh deleted file mode 100755 index 6d5305f9eeff2..0000000000000 --- a/ci/scripts/go_bench.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/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. - -# this will output the benchmarks to STDOUT but if `-json` is passed -# as the second argument, it will create a file "bench_stats.json" -# in the directory this is called from containing a json representation - -set -ex - -# simplistic semver comparison -verlte() { - [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] -} -verlt() { - [ "$1" = "$2" ] && return 1 || verlte $1 $2 -} - -ver=`go env GOVERSION` - -source_dir=${1}/go - -export PARQUET_TEST_DATA=${1}/cpp/submodules/parquet-testing/data -pushd ${source_dir} - -# lots of benchmarks, they can take a while -# the timeout is for *ALL* benchmarks together, -# not per benchmark -go test -bench=. -benchmem -timeout 40m -run=^$ ./... | tee bench_stat.dat - -popd - -if [[ "$2" = "-json" ]]; then - go install go.bobheadxi.dev/gobenchdata@latest - export PATH=`go env GOPATH`/bin:$PATH - cat ${source_dir}/bench_*.dat | gobenchdata --json bench_stats.json -fi - -rm ${source_dir}/bench_*.dat \ No newline at end of file diff --git a/ci/scripts/go_bench_adapt.py b/ci/scripts/go_bench_adapt.py deleted file mode 100644 index a05e25de8bdd3..0000000000000 --- a/ci/scripts/go_bench_adapt.py +++ /dev/null @@ -1,127 +0,0 @@ -# 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. - -import json -import os -import uuid -import logging -from pathlib import Path -from typing import List - -from benchadapt import BenchmarkResult -from benchadapt.adapters import BenchmarkAdapter -from benchadapt.log import log - -log.setLevel(logging.DEBUG) - -ARROW_ROOT = Path(__file__).parent.parent.parent.resolve() -SCRIPTS_PATH = ARROW_ROOT / "ci" / "scripts" - -# `github_commit_info` is meant to communicate GitHub-flavored commit -# information to Conbench. See -# https://github.com/conbench/conbench/blob/cf7931f/benchadapt/python/benchadapt/result.py#L66 -# for a specification. -github_commit_info = {"repository": "https://github.com/apache/arrow"} - -if os.environ.get("CONBENCH_REF") == "main": - # Assume GitHub Actions CI. The environment variable lookups below are - # expected to fail when not running in GitHub Actions. - github_commit_info = { - "repository": f'{os.environ["GITHUB_SERVER_URL"]}/{os.environ["GITHUB_REPOSITORY"]}', - "commit": os.environ["GITHUB_SHA"], - "pr_number": None, # implying default branch - } - run_reason = "commit" -else: - # Assume that the environment is not GitHub Actions CI. Error out if that - # assumption seems to be wrong. - assert os.getenv("GITHUB_ACTIONS") is None - - # This is probably a local dev environment, for testing. In this case, it - # does usually not make sense to provide commit information (not a - # controlled CI environment). Explicitly leave out "commit" and "pr_number" to - # reflect that (to not send commit information). - - # Reflect 'local dev' scenario in run_reason. Allow user to (optionally) - # inject a custom piece of information into the run reason here, from - # environment. - run_reason = "localdev" - custom_reason_suffix = os.getenv("CONBENCH_CUSTOM_RUN_REASON") - if custom_reason_suffix is not None: - run_reason += f" {custom_reason_suffix.strip()}" - - -class GoAdapter(BenchmarkAdapter): - result_file = "bench_stats.json" - command = ["bash", SCRIPTS_PATH / "go_bench.sh", ARROW_ROOT, "-json"] - - def __init__(self, *args, **kwargs) -> None: - super().__init__(command=self.command, *args, **kwargs) - - def _transform_results(self) -> List[BenchmarkResult]: - with open(self.result_file, "r") as f: - raw_results = json.load(f) - - run_id = uuid.uuid4().hex - parsed_results = [] - for suite in raw_results[0]["Suites"]: - batch_id = uuid.uuid4().hex - pkg = suite["Pkg"] - - for benchmark in suite["Benchmarks"]: - data = benchmark["Mem"]["MBPerSec"] * 1e6 - time = 1 / benchmark["NsPerOp"] * 1e9 - - name = benchmark["Name"].removeprefix("Benchmark") - ncpu = name[name.rfind("-") + 1 :] - pieces = name[: -(len(ncpu) + 1)].split("/") - - parsed = BenchmarkResult( - run_id=run_id, - batch_id=batch_id, - stats={ - "data": [data], - "unit": "B/s", - "times": [time], - "time_unit": "i/s", - "iterations": benchmark["Runs"], - }, - context={ - "benchmark_language": "Go", - "goos": suite["Goos"], - "goarch": suite["Goarch"], - }, - tags={ - "pkg": pkg, - "num_cpu": ncpu, - "name": pieces[0], - "params": "/".join(pieces[1:]), - }, - run_reason=run_reason, - github=github_commit_info, - ) - parsed.run_name = ( - f"{parsed.run_reason}: {github_commit_info.get('commit')}" - ) - parsed_results.append(parsed) - - return parsed_results - - -if __name__ == "__main__": - go_adapter = GoAdapter(result_fields_override={"info": {}}) - go_adapter() diff --git a/ci/scripts/go_build.sh b/ci/scripts/go_build.sh deleted file mode 100755 index ea77ecf56ac0e..0000000000000 --- a/ci/scripts/go_build.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/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 -ex - -source_dir=${1}/go - -# Need "all=" as per https://github.com/golang/go/issues/42131#issuecomment-713917379 -export GOFLAGS="${GOFLAGS} -gcflags=all=-d=checkptr" - -pushd ${source_dir}/arrow - -if [[ -n "${ARROW_GO_TESTCGO}" ]]; then - if [[ "${MSYSTEM}" = "MINGW64" ]]; then - export PATH=${MINGW_PREFIX}/bin:$PATH - go clean -cache - go clean -testcache - fi - TAGS="-tags assert,test,ccalloc" -fi - -go install $TAGS -v ./... - -popd - -pushd ${source_dir}/parquet - -go install -v ./... - -popd - -: ${ARROW_INTEGRATION_GO:=ON} - -if [ "${ARROW_INTEGRATION_GO}" == "ON" ]; then - pushd ${source_dir}/arrow/internal/cdata_integration - - case "$(uname)" in - Linux) - go_lib="arrow_go_integration.so" - ;; - Darwin) - go_lib="arrow_go_integration.dylib" - ;; - MINGW*) - go_lib="arrow_go_integration.dll" - ;; - esac - go build -buildvcs=false -tags cdata_integration,assert -buildmode=c-shared -o ${go_lib} . - - popd -fi diff --git a/ci/scripts/go_cgo_python_test.sh b/ci/scripts/go_cgo_python_test.sh deleted file mode 100755 index a76b6d0613a4b..0000000000000 --- a/ci/scripts/go_cgo_python_test.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/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 -ex - -source_dir=${1}/go - -if [ -n "${ARROW_PYTHON_VENV:-}" ]; then - . "${ARROW_PYTHON_VENV}/bin/activate" -fi - -export GOFLAGS="${GOFLAGS} -gcflags=all=-d=checkptr" - -pushd ${source_dir}/arrow/cdata/test - -case "$(uname)" in - Linux) - testlib="cgotest.so" - ;; - Darwin) - testlib="cgotest.so" - ;; - MINGW*) - testlib="cgotest.dll" - ;; -esac - -go build -tags cdata_test,assert -buildmode=c-shared -o $testlib . - -python test_export_to_cgo.py - -rm $testlib -rm "${testlib%.*}.h" - -popd diff --git a/ci/scripts/go_test.sh b/ci/scripts/go_test.sh deleted file mode 100755 index bad2ffe619026..0000000000000 --- a/ci/scripts/go_test.sh +++ /dev/null @@ -1,89 +0,0 @@ -#!/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 -ex - -# simplistic semver comparison -verlte() { - [ "$1" = "`echo -e "$1\n$2" | sort -V | head -n1`" ] -} -verlt() { - [ "$1" = "$2" ] && return 1 || verlte $1 $2 -} - -ver=`go env GOVERSION` - -source_dir=${1}/go - -testargs="-race" -if verlte "1.18" "${ver#go}" && [ "$(go env GOOS)" != "darwin" ]; then - # asan not supported on darwin/amd64 - testargs="-asan" -fi - -case "$(uname)" in - MINGW*) - # -asan and -race don't work on windows currently - testargs="" - ;; -esac - -if [[ "$(go env GOHOSTARCH)" = "s390x" ]]; then - testargs="" # -race and -asan not supported on s390x -fi - -# Go static check (skipped in MinGW) -if [[ -z "${MINGW_LINT}" ]]; then - pushd ${source_dir} - "$(go env GOPATH)"/bin/staticcheck ./... - popd -fi - - -pushd ${source_dir}/arrow - -TAGS="assert,test" -if [[ -n "${ARROW_GO_TESTCGO}" ]]; then - if [[ "${MSYSTEM}" = "MINGW64" ]]; then - export PATH=${MINGW_PREFIX}\\bin:${MINGW_PREFIX}\\lib:$PATH - fi - TAGS="${TAGS},ccalloc" -fi - -# the cgo implementation of the c data interface requires the "test" -# tag in order to run its tests so that the testing functions implemented -# in .c files don't get included in non-test builds. - -go test $testargs -tags $TAGS ./... - -# run it again but with the noasm tag -go test $testargs -tags $TAGS,noasm ./... - -popd - -export PARQUET_TEST_DATA=${1}/cpp/submodules/parquet-testing/data -export ARROW_TEST_DATA=${1}/testing/data -pushd ${source_dir}/parquet - -go test $testargs -tags assert ./... - -# run the tests again but with the noasm tag -go test $testargs -tags assert,noasm ./... - -popd diff --git a/ci/scripts/go_tinygo_example.sh b/ci/scripts/go_tinygo_example.sh deleted file mode 100755 index 7bde56226db7b..0000000000000 --- a/ci/scripts/go_tinygo_example.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/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 -ex - -cd ~ -pushd /src -tinygo build -tags noasm -o ~/example_tinygo arrow/_examples/helloworld/main.go -popd - -./example_tinygo diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index 4dcafc73a25ad..b5a9259251012 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -98,9 +98,6 @@ groups: ruby: - test-*ruby* - go: - - test*-go-* - vcpkg: - test-*vcpkg* - wheel-* @@ -911,7 +908,6 @@ tasks: ("ubuntu", "22.04")] %} {% for target in ["cpp", "csharp", - "go", "integration", "java", "js", @@ -964,7 +960,6 @@ tasks: {% for target in ["cpp", "csharp", - "go", "integration", "java", "js", @@ -980,7 +975,6 @@ tasks: {% for target in ["cpp", "csharp", - "go", "integration", "js", "python", @@ -1487,18 +1481,6 @@ tasks: R_PRUNE_DEPS: TRUE image: r-clang-sanitizer - {% for go_version, staticcheck in [("1.22", "v0.5.1"), ("1.23", "latest")] %} - test-debian-12-go-{{ go_version }}: - ci: github - template: docker-tests/github.linux.yml - params: - env: - DEBIAN: 12 - GO: "{{go_version}}" - STATICCHECK: "{{ staticcheck }}" - image: debian-go - {% endfor %} - # be sure to update binary-task.rb when upgrading Debian test-debian-12-docs: ci: github diff --git a/docker-compose.yml b/docker-compose.yml index a76ee49490a6e..64e6c453629b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -134,9 +134,6 @@ x-hierarchy: - debian-ruby - debian-python: - debian-docs - - debian-go: - - debian-go-cgo - - debian-go-cgo-python - debian-js - fedora-cpp: - fedora-python @@ -1716,68 +1713,6 @@ services: command: > /bin/bash -c "/arrow/ci/scripts/r_revdepcheck.sh /arrow" - ################################# Go ######################################## - - debian-go: - # Usage: - # docker-compose build debian-go - # docker-compose run debian-go - image: ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO} - build: - context: . - dockerfile: ci/docker/debian-${DEBIAN}-go.dockerfile - cache_from: - - ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO} - args: - arch: ${ARCH} - go: ${GO} - staticcheck: ${STATICCHECK} - shm_size: *shm-size - volumes: *debian-volumes - command: &go-command > - /bin/bash -c " - git config --global --add safe.directory /arrow && - /arrow/ci/scripts/go_build.sh /arrow && - /arrow/ci/scripts/go_test.sh /arrow" - - debian-go-cgo: - # Usage: - # docker-compose build debian-go-cgo - # docker-compose run debian-go-cgo - image: ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO}-cgo - build: - context: . - dockerfile: ci/docker/debian-go-cgo.dockerfile - cache_from: - - ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO}-cgo - args: - base: ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO} - shm_size: *shm-size - volumes: *debian-volumes - environment: - <<: *common - ARROW_GO_TESTCGO: "1" - command: *go-command - - debian-go-cgo-python: - # Usage: - # docker-compose build debian-go-cgo-python - # docker-compose run debian-go-cgo-python - image: ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO}-cgo-python - build: - context: . - dockerfile: ci/docker/debian-${DEBIAN}-go-cgo-python.dockerfile - cache_from: - - ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO}-cgo-python - args: - base: ${REPO}:${ARCH}-debian-${DEBIAN}-go-${GO} - shm_size: *shm-size - volumes: *debian-volumes - command: &go-cgo-python-command > - /bin/bash -c " - git config --global --add safe.directory /arrow && - /arrow/ci/scripts/go_cgo_python_test.sh /arrow" - ############################# JavaScript #################################### debian-js: @@ -1866,7 +1801,6 @@ services: jdk: 17 maven: ${MAVEN} node: ${NODE} - go: ${GO} volumes: *conda-volumes environment: <<: [*common, *ccache]