Skip to content

Commit

Permalink
Part of Bears-R-Us#3957: simplify offline builds (Bears-R-Us#3944)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajpotts committed Jan 8, 2025
1 parent 7869b4a commit d7a67cd
Show file tree
Hide file tree
Showing 12 changed files with 233 additions and 7 deletions.
25 changes: 25 additions & 0 deletions docker/almalinux-chapel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM almalinux:9.0

# Set user to root
USER root

# Set up environment variables
COPY bashrc.chpl /root/
RUN echo 'source ~/.bashrc.chpl' >> ~/.bashrc && mv /root/bashrc.chpl /root/.bashrc.chpl >> ~/.bashrc.chpl

# Install dependencies
RUN dnf update -y && dnf install -y ca-certificates wget python3-pip && 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 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 && tar -xvf chapel-2.3.0.tar.gz

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

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

WORKDIR /root

ENTRYPOINT ["/bin/bash", "-l"]
10 changes: 10 additions & 0 deletions docker/almalinux-chapel/bashrc.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export CHPL_HOME=/chapel-2.3.0
export CHPL_RE2=bundled
export CHPL_GMP=bundled
export CHPL_COMM=none
export CHPL_TARGET_COMPILER=gnu
export 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
export CHPL_TARGET_CPU=native
export CHPL_HOST_MEM=jemalloc
export ARKOUDA_QUICK_COMPILE=true
export ARKOUDA_SKIP_CHECK_DEPS=True
8 changes: 6 additions & 2 deletions docker/almalinux-with-arkouda-deps/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
FROM ajpotts/almalinux-chapel:1.0.0
FROM ajpotts/almalinux-chapel:1.0.1

# 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]
# Download all the dependencies necessary for make install-deps
RUN git clone https://github.com/Bears-R-Us/arkouda.git && source ~/.bashrc && cd arkouda && make install-deps DEP_BUILD_DIR=/dep/build

# Download all the python packages necessary for the pip install
COPY requirements.txt /root/
RUN mkdir /root/pip_deps && cd /root/pip_deps && python3 -m pip download -r /root/requirements.txt

ENTRYPOINT ["/bin/bash", "-l"]
38 changes: 38 additions & 0 deletions docker/almalinux-with-arkouda-deps/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
numpy>=1.24.1,<2.0
pandas>=1.4.0,!=2.2.0
pyzmq>=20.0.0
typeguard==2.10.0
tabulate
pyfiglet
versioneer
matplotlib>=3.3.2
h5py>=3.7.0
types-tabulate
pyarrow
jupyter
scipy<=1.13.1
pytest>=6.0
pytest-env
pexpect
Sphinx>=5.1.1
sphinx-argparse
sphinx-autoapi
sphinx-design
sphinx-autodoc-typehints
sphinx-autopackagesummary
furo
myst-parser
linkify-it-py
typed-ast
flake8
mypy>=0.931
black
isort
pytest-json-report
pytest-benchmark
mathjax
pandas-stubs
types-python-dateutil
blosc2>=2.3.0
numexpr>=2.6.2
tables>=3.8.0
2 changes: 1 addition & 1 deletion docker/build_almalinux_with_arkouda_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

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

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

Expand Down
10 changes: 6 additions & 4 deletions docker/build_push_almalinux.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash

VERSION=1.0.0
VERSION=1.0.1
IMAGE_NAME=almalinux-chapel
REPO_NAME=ajpotts

docker build -t almalinux-chapel:$VERSION almalinux/
docker tag almalinux-chapel:$VERSION ajpotts/almalinux-chapel:$VERSION
docker push ajpotts/almalinux-chapel:$VERSION
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
23 changes: 23 additions & 0 deletions scripts/offline_builds/almalinux/build_scripts/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# These are the steps for an offline build of arkouda on almalinux:9.0 docker container


# Step 1: Make sure the environment variables are set. See bashrc.chpl for an example.
# Step 2: Install the chapel. An example script is given in install_chapel.sh
# Step 3: Install the python dependencies in requirements.txt. If the dependencies are pre-downloaded into a <pip_deps> directory:

> pip install --no-index --find-links <pip_deps> -r requirements.txt

# Step 4: Set environment variable, export ARROW_DEPENDENCIES_SOURCE_DIR=<build_dir>/arrow_dependencies

# Step 5: Install dependencies from source. If the source is in <build_dir>:
> cd arkouda
> make install-deps DEP_BUILD_DIR=<build_dir>

# Step 6: pip install the arkouda project
> python3 -m pip install -e .[dev]

# Step 7: make
> make

# Step 8: verify the unit tests run:
> make test
10 changes: 10 additions & 0 deletions scripts/offline_builds/almalinux/build_scripts/bashrc.chpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export CHPL_HOME=/chapel-2.3.0
export CHPL_RE2=bundled
export CHPL_GMP=bundled
export CHPL_COMM=none
export CHPL_TARGET_COMPILER=gnu
export export PATH="$PATH:$CHPL_HOME"
export CHPL_TARGET_CPU=native
export CHPL_HOST_MEM=jemalloc
export ARKOUDA_QUICK_COMPILE=true
export ARKOUDA_SKIP_CHECK_DEPS=True
18 changes: 18 additions & 0 deletions scripts/offline_builds/almalinux/build_scripts/install_chapel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

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

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

# Install Chapel
cd $CHPL_HOME
make

# Check this install worked
chpl --version

# install chapel-py
cd $CHPL_HOME && make chapel-py-venv
38 changes: 38 additions & 0 deletions scripts/offline_builds/almalinux/build_scripts/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
numpy>=1.24.1,<2.0
pandas>=1.4.0,!=2.2.0
pyzmq>=20.0.0
typeguard==2.10.0
tabulate
pyfiglet
versioneer
matplotlib>=3.3.2
h5py>=3.7.0
types-tabulate
pyarrow
jupyter
scipy<=1.13.1
pytest>=6.0
pytest-env
pexpect
Sphinx>=5.1.1
sphinx-argparse
sphinx-autoapi
sphinx-design
sphinx-autodoc-typehints
sphinx-autopackagesummary
furo
myst-parser
linkify-it-py
typed-ast
flake8
mypy>=0.931
black
isort
pytest-json-report
pytest-benchmark
mathjax
pandas-stubs
types-python-dateutil
blosc2>=2.3.0
numexpr>=2.6.2
tables>=3.8.0
20 changes: 20 additions & 0 deletions scripts/offline_builds/almalinux/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ajpotts/almalinux-chapel:1.0.1

# Set user to root
USER root

RUN git clone -b offline_build_scripts_pr2 https://github.com/ajpotts/arkouda.git

RUN mkdir -p /root/new_dir

# Download all the python packages necessary for the pip install
COPY requirements.txt /root/
COPY build.tar /root/
COPY pip_deps.tar /root/

RUN cd /root/new_dir && tar -xvf /root/build.tar
RUN cd /root/new_dir && tar -xvf /root/pip_deps.tar
RUN echo "export ARROW_DEPENDENCIES_SOURCE_DIR=/root/new_dir/build/arrow_dependencies" >> ~/.bashrc
RUN dnf install -y vim

ENTRYPOINT ["/bin/bash", "-l"]
38 changes: 38 additions & 0 deletions scripts/offline_builds/almalinux/docker/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
numpy>=1.24.1,<2.0
pandas>=1.4.0,!=2.2.0
pyzmq>=20.0.0
typeguard==2.10.0
tabulate
pyfiglet
versioneer
matplotlib>=3.3.2
h5py>=3.7.0
types-tabulate
pyarrow
jupyter
scipy<=1.13.1
pytest>=6.0
pytest-env
pexpect
Sphinx>=5.1.1
sphinx-argparse
sphinx-autoapi
sphinx-design
sphinx-autodoc-typehints
sphinx-autopackagesummary
furo
myst-parser
linkify-it-py
typed-ast
flake8
mypy>=0.931
black
isort
pytest-json-report
pytest-benchmark
mathjax
pandas-stubs
types-python-dateutil
blosc2>=2.3.0
numexpr>=2.6.2
tables>=3.8.0

0 comments on commit d7a67cd

Please sign in to comment.