Skip to content

Commit

Permalink
Fixes #3933: failing make install-arrow (#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Jan 3, 2025
1 parent a77be87 commit 1e14a51
Show file tree
Hide file tree
Showing 7 changed files with 214 additions and 67 deletions.
75 changes: 61 additions & 14 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
make install-arrow
make install-arrow-quick
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
make install-iconv
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" >> Makefile.paths
Expand All @@ -93,6 +93,46 @@ jobs:
run: |
make test-python size=100
arkouda_makefile_almalinux:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
container:
image: ajpotts/almalinux-with-arkouda-deps:1.0.0
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{matrix.python-version}}
- name: Check python version
run: |
python3 --version
- name: Make install-arrow
uses: nick-fields/retry@v2
with:
timeout_seconds: 1200 # or use timeout_minutes
max_attempts: 2
retry_on: error
command: |
make install-arrow
- name: Make install-hdf5
run: |
make install-hdf5
- name: Make install-zmq
run: |
make install-zmq
- name: Make install-iconv
run: |
make install-iconv
- name: Make install-idn2
run: |
make install-idn2
- name: Make install-blosc
run: |
make install-blosc
arkouda_makefile:
runs-on: ubuntu-20.04
Expand All @@ -109,22 +149,29 @@ jobs:
python-version: ${{matrix.python-version}}
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget build-essential ninja-build cmake
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libcurl4-openssl-dev libidn2-dev
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" >> Makefile.paths
apt-get update && apt-get install -y -V ca-certificates lsb-release wget build-essential cmake
apt-get update && apt-get install -y -V python3-pip libcurl4-openssl-dev
apt-get update -y && apt-get -y -V upgrade
- name: Check python version
run: |
python3 --version
- name: Install Chapel frontend bindings
run: |
(cd $CHPL_HOME/tools/chapel-py && python3 -m pip install .)
- name: Make install-arrow
run: |
make install-arrow
- name: Make install-arrow OS=unrecognized
- name: Make install-arrow-quick
run: |
make arrow-clean
make install-arrow OS=unrecognized
make install-arrow-quick
- name: Make install-arrow
uses: nick-fields/retry@v2
with:
timeout_seconds: 1200 # or use timeout_minutes
max_attempts: 2
retry_on: error
command: |
apt-get remove -y apache-arrow-apt-source
make arrow-clean
make install-arrow
- name: Make install-hdf5
run: |
make install-hdf5
Expand Down Expand Up @@ -155,7 +202,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
make install-arrow
make install-arrow-quick
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
make install-iconv
Expand Down Expand Up @@ -186,7 +233,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
make install-arrow
make install-arrow-quick
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
make install-iconv
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" >> Makefile.paths
Expand Down Expand Up @@ -225,7 +272,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
make install-arrow
make install-arrow-quick
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
make install-iconv
echo "\$(eval \$(call add-path,/usr/lib/x86_64-linux-gnu/hdf5/serial/))" >> Makefile.paths
Expand Down Expand Up @@ -270,7 +317,7 @@ jobs:
- name: Install dependencies
run: |
apt-get update && apt-get install -y -V ca-certificates lsb-release wget
make install-arrow
make install-arrow-quick
apt-get update && apt-get install -y libhdf5-dev hdf5-tools libzmq3-dev python3-pip libarrow-dev libparquet-dev libcurl4-openssl-dev libidn2-dev
pip install pytest-benchmark==4.0.0
make install-iconv
Expand Down
83 changes: 30 additions & 53 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,81 +178,58 @@ hdf5-clean:
rm -rf $(HDF5_BUILD_DIR)


# get the OS, ubuntu, etc...
OS := $(shell lsb_release --id --short | tr 'A-Z' 'a-z')
install-arrow-quick:
./scripts/install_arrow_quick.sh $(DEP_BUILD_DIR)

# If pop, replace with ubuntu
OS_FINAL := $(shell echo ${OS} | awk '{gsub(/pop/,"ubuntu")}1')

# System release, such as "jammy" for "ubuntu jammy"
OS_CODENAME :=$(shell lsb_release --codename --short)

# System release, for example, 22 extracted from 22.04
OS_RELEASE :=$(shell lsb_release -rs | cut -d'.' -f1)

ARROW_VER := 18.1.0
ARROW_NAME_VER := apache-arrow-$(ARROW_VER)
ARROW_FULL_NAME_VER := arrow-apache-arrow-$(ARROW_VER)
ARROW_BUILD_DIR := $(DEP_BUILD_DIR)/$(ARROW_FULL_NAME_VER)
ARROW_DEP_DIR := $(DEP_BUILD_DIR)/arrow_dependencies
ARROW_INSTALL_DIR := $(DEP_INSTALL_DIR)/arrow-install
ARROW_SOURCE_LINK := https://github.com/apache/arrow/archive/refs/tags/$(ARROW_NAME_VER).tar.gz

NUM_CORES := $(shell nproc --all)

ifeq ($(OS_FINAL),$(filter $(OS_FINAL), almalinux almalinux-rc))
ARROW_LINK := "https://apache.jfrog.io/ui/native/arrow/${OS_FINAL}/${OS_RELEASE}/apache-arrow-release-latest.rpm"
else ifeq ($(OS_FINAL), amazon-linux)
ARROW_LINK := "https://apache.jfrog.io/ui/native/arrow/amazon-linux/2/apache-arrow-release-latest.rpm"
else ifeq ($(OS_FINAL), amazon-linux-rc)
ARROW_LINK := "https://apache.jfrog.io/ui/native/arrow/amazon-linux-rc/2023/apache-arrow-release-latest.rpm"
else ifeq ($(OS_FINAL), centos)
ARROW_LINK := "https://apache.jfrog.io/ui/native/arrow/centos/8/apache-arrow-release-latest.rpm"
else ifeq ($(OS_FINAL), centos-rc)
ARROW_LINK := "https://apache.jfrog.io/ui/native/arrow/centos-rc/9-stream/apache-arrow-release-latest.rpm"
else ifeq ($(OS_FINAL),$(filter $(OS_FINAL), ubuntu ubuntu-rc debian debian-rc))
ARROW_LINK := "https://apache.jfrog.io/artifactory/arrow/${OS_FINAL}/apache-arrow-apt-source-latest-${OS_CODENAME}.deb"
else
ARROW_LINK := https://github.com/apache/arrow/archive/refs/tags/$(ARROW_NAME_VER).tar.gz
endif
ARROW_DEPENDENCY_SOURCE := BUNDLED


install-arrow:
@echo "Installing Apache Arrow/Parquet"
@echo "from build directory: ${DEP_BUILD_DIR}"
mkdir -p ${DEP_BUILD_DIR}
rm -rf $(ARROW_INSTALL_DIR)
mkdir -p $(DEP_INSTALL_DIR) $(DEP_BUILD_DIR)
touch $(DEP_BUILD_DIR)/arrow_exports.sh

# If the BUILD_DIR does not contain the apache-arrow file, use wget to fetch it
ifeq (,$(wildcard ${DEP_BUILD_DIR}/apache-arrow*))
cd $(DEP_BUILD_DIR) && wget $(ARROW_LINK)
# If the tar.gz file does not exist, fetch it
ifeq (,$(wildcard ${DEP_BUILD_DIR}/$(ARROW_NAME_VER).tar.gz))
cd $(DEP_BUILD_DIR) && wget $(ARROW_SOURCE_LINK)
endif

ifeq ($(OS_FINAL),$(filter $(OS_FINAL), almalinux almalinux-rc amazon-linux amazon-linux-rc))
# If not root, use sudo
ifneq ($(shell id -u), 0)
cd $(DEP_BUILD_DIR) && sudo dnf install -y ./apache-arrow*
else
cd $(DEP_BUILD_DIR) && dnf install -y ./apache-arrow*
endif
else ifeq ($(OS_FINAL),$(filter $(OS_FINAL), ubuntu ubuntu-rc debian debian-rc))
# If not root, use sudo
ifneq ($(shell id -u), 0)
cd $(DEP_BUILD_DIR) && sudo apt install -y -V ./apache-arrow*
else
cd $(DEP_BUILD_DIR) && apt install -y -V ./apache-arrow*
endif
else
cd $(DEP_BUILD_DIR) && tar -xvf $(ARROW_NAME_VER).tar.gz
mkdir -p $(ARROW_BUILD_DIR)/cpp/build-release
cd $(ARROW_BUILD_DIR)/cpp/build-release && cmake .. -DCMAKE_INSTALL_PREFIX=$(ARROW_INSTALL_DIR) -DARROW_DEPENDENCY_SOURCE=AUTO -DCMAKE_BUILD_TYPE=Release -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON -DARROW_WITH_BZ2=ON -DARROW_WITH_LZ4=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON $(ARROW_OPTIONS) && make -j$(NUM_CORES)
# If not root, use sudo
ifneq ($(shell id -u), 0)
cd $(ARROW_BUILD_DIR)/cpp/build-release && sudo make install
else
cd $(ARROW_BUILD_DIR)/cpp/build-release && make install
endif
cd $(DEP_BUILD_DIR) && tar -xvf $(ARROW_NAME_VER).tar.gz
mkdir -p $(ARROW_BUILD_DIR)/cpp/build-release

# if the arrow dependency directory is empty of tar.gz, download the dependencies
ifeq (,$(wildcard $(ARROW_DEP_DIR)/*.tar.gz))
rm -fr $(DEP_BUILD_DIR)/arrow_exports.sh
mkdir -p $(ARROW_DEP_DIR)
cd $(ARROW_BUILD_DIR)/cpp/thirdparty/ && ./download_dependencies.sh $(ARROW_DEP_DIR) > $(DEP_BUILD_DIR)/arrow_exports.sh
endif

cd $(DEP_BUILD_DIR) && . ./arrow_exports.sh && cd $(ARROW_BUILD_DIR)/cpp/build-release && cmake -S $(ARROW_BUILD_DIR)/cpp .. -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_INSTALL_PREFIX=$(ARROW_INSTALL_DIR) -DCMAKE_BUILD_TYPE=Release -DARROW_PARQUET=ON -DARROW_WITH_SNAPPY=ON -DARROW_WITH_BROTLI=ON -DARROW_WITH_BZ2=ON -DARROW_WITH_LZ4=ON -DARROW_WITH_ZLIB=ON -DARROW_WITH_ZSTD=ON -DARROW_DEPENDENCY_SOURCE=$(ARROW_DEPENDENCY_SOURCE) $(ARROW_OPTIONS) && make -j$(NUM_CORES)

cd $(ARROW_BUILD_DIR)/cpp/build-release && make install

echo '$$(eval $$(call add-path,$(ARROW_INSTALL_DIR)))' >> Makefile.paths


arrow-clean:
rm -rf $(DEP_BUILD_DIR)/apache-arrow*
rm -rf $(DEP_BUILD_DIR)/arrow-apache-arrow*
rm -rf $(ARROW_DEP_DIR)
rm -fr $(DEP_BUILD_DIR)/arrow_exports.sh


ICONV_VER := 1.17
ICONV_NAME_VER := libiconv-$(ICONV_VER)
Expand Down
10 changes: 10 additions & 0 deletions docker/almalinux-with-arkouda-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM ajpotts/almalinux-chapel:1.0.0

# Set user to root
USER root


RUN git clone https://github.com/Bears-R-Us/arkouda.git && source ~/.bashrc && cd arkouda && make install-deps DEP_BUILD_DIR=/dep/build && python3 -m pip install -e .[dev]


ENTRYPOINT ["/bin/bash", "-l"]
31 changes: 31 additions & 0 deletions docker/almalinux/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM almalinux:9.0

# Set user to root
USER root

RUN echo 'source ~/.bashrc.chpl' >> ~/.bashrc && printf "export CHPL_HOME=/chapel-2.3.0 \nexport CHPL_RE2=bundled \nexport CHPL_GMP=bundled \nexport CHPL_COMM=none \nexport CHPL_TARGET_COMPILER=gnu \nexport export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/chapel-2.3.0:/chapel-2.3.0/bin/linux64-x86_64 \nexport CHPL_TARGET_CPU=native \nexport CHPL_HOST_MEM=jemalloc \nexport ARKOUDA_QUICK_COMPILE=true \nexport ARKOUDA_SKIP_CHECK_DEPS=True \n" >> ~/.bashrc.chpl && source ~/.bashrc

# Install dependencies
RUN dnf update -y && dnf install -y ca-certificates wget
RUN dnf update -y && dnf install -y python3-pip
RUN dnf update -y && dnf -y upgrade
RUN dnf install -y gcc gcc-c++ m4 perl python3.12 python3-devel bash make gawk git cmake which diffutils
RUN dnf install -y llvm-devel clang clang-devel libcurl-devel

# Download Chapel source
RUN wget https://github.com/chapel-lang/chapel/releases/download/2.3.0/chapel-2.3.0.tar.gz
RUN tar -xvf chapel-2.3.0.tar.gz

# Set environment variables
RUN cd /chapel-2.3.0 && source util/quickstart/setchplenv.bash

# Install Chapel
RUN source ~/.bashrc && cd $CHPL_HOME && make
RUN source ~/.bashrc && chpl --version

# install chapel-py
RUN source ~/.bashrc && cd $CHPL_HOME && make chapel-py-venv

WORKDIR /root

ENTRYPOINT ["/bin/bash", "-l"]
14 changes: 14 additions & 0 deletions docker/build_almalinux_with_arkouda_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash


echo "This script is intended to be run from the arkouda project directory."

VERSION=1.0.0
IMAGE_NAME=almalinux-with-arkouda-deps
REPO_NAME=ajpotts

docker build -t $IMAGE_NAME:$VERSION docker/$IMAGE_NAME/
docker tag $IMAGE_NAME:$VERSION $REPO_NAME/$IMAGE_NAME:$VERSION
docker push $REPO_NAME/$IMAGE_NAME:$VERSION


7 changes: 7 additions & 0 deletions docker/build_push_almalinux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

VERSION=1.0.0

docker build -t almalinux-chapel:$VERSION almalinux/
docker tag almalinux-chapel:$VERSION ajpotts/almalinux-chapel:$VERSION
docker push ajpotts/almalinux-chapel:$VERSION
61 changes: 61 additions & 0 deletions scripts/install_arrow_quick.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

DEP_BUILD_DIR=$1


# Check the necessary programs are installed
if ! command -v lsb_release 2>&1 >/dev/null
then
printf "\nExiting.
The program lsb_release could not be found.
Please install lsb_release and try again, or use 'make install-arrow' instead.\n\n"
exit 1
fi

# get the OS, ubuntu, etc...
OS=$(lsb_release --id --short | tr 'A-Z' 'a-z')

# If pop, replace with ubuntu
OS_FINAL=$(echo ${OS} | awk '{gsub(/pop/,"ubuntu")}1')

# System release, such as "jammy" for "ubuntu jammy"
OS_CODENAME=$(lsb_release --codename --short)

# System release, for example, 22 extracted from 22.04
OS_RELEASE=$(lsb_release -rs | cut -d'.' -f1)

if [[ $OS_FINAL == *"ubuntu"* ]] || [[ $OS_FINAL == *"debian"* ]]; then
ARROW_LINK="https://apache.jfrog.io/artifactory/arrow/${OS_FINAL}/apache-arrow-apt-source-latest-${OS_CODENAME}.deb"
elif [[ $OS_FINAL == *"almalinux"* ]]; then
ARROW_LINK="https://apache.jfrog.io/ui/native/arrow/${OS_FINAL}/${OS_RELEASE}/apache-arrow-release-latest.rpm"
elif [[ $OS_FINAL == *"centos-rc"* ]]; then
ARROW_LINK="https://apache.jfrog.io/ui/native/arrow/centos-rc/9-stream/apache-arrow-release-latest.rpm"
fi

echo "Installing Apache Arrow/Parquet"
echo "from build directory: ${DEP_BUILD_DIR}"
mkdir -p ${DEP_BUILD_DIR}

# If the BUILD_DIR does not contain the apache-arrow file, use wget to fetch it
if ! find ${DEP_BUILD_DIR} -name "apache-arrow*" -type f -print -quit | grep -q .; then
cd ${DEP_BUILD_DIR} && wget ${ARROW_LINK}
fi

# Now do the installs
if [[ $OS_FINAL == *"ubuntu"* ]] || [[ $OS_FINAL == *"debian"* ]]; then
if [ "$EUID" -ne 0 ]; then
cd $DEP_BUILD_DIR && sudo apt install -y -V ./apache-arrow*.deb
else
cd $DEP_BUILD_DIR && apt install -y -V ./apache-arrow*.deb
fi
elif [[ $OS_FINAL == *"almalinux"* ]]; then
if [ "$EUID" -ne 0]; then
cd $DEP_BUILD_DIR && sudo dnf install -y ./apache-arrow*.rpm
else
cd $DEP_BUILD_DIR && dnf install -y ./apache-arrow*.rpm
fi
else
echo "make install-arrow-quick does not support ${OS}. Please use make install-arrow instead."
fi


0 comments on commit 1e14a51

Please sign in to comment.