From a6c8ea703533f63f985561560a1dc8eb1931807e Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 00:20:47 -0700 Subject: [PATCH 01/15] Add ROOT building setup for arm64 --- .github/workflows/build_root.yaml | 84 +++++++++++++++++++++++++++++++ Root/Dockerfile | 36 +++++++++++++ Scripts/install_packages.sh | 29 +++++++---- Scripts/install_root.sh | 59 ++++++++++++++++++++++ 4 files changed, 198 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/build_root.yaml create mode 100644 Root/Dockerfile create mode 100755 Scripts/install_root.sh diff --git a/.github/workflows/build_root.yaml b/.github/workflows/build_root.yaml new file mode 100644 index 0000000..1a7c46d --- /dev/null +++ b/.github/workflows/build_root.yaml @@ -0,0 +1,84 @@ + +name: Build ROOT + +on: + push: + tags: ['root_v*'] + workflow_dispatch: + +env: + REGISTRY: ghcr.io + BASE_REPO: ubuntu + BASE_TAG: "22.04" + ROOT_TAG: "root_v6.28.06" + NARG: 2 + +jobs: + + build-and-publish: + + name: Build and push the docker images + + strategy: + matrix: + build: [Dev] + include: + - push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + - build: Dev + tag-suffix: '-dev' + - build: Prod + tag-suffix: '' + + runs-on: ubuntu-latest + steps: + + - name: Check out the repo + uses: actions/checkout@v4 + with: + submodules: recursive + # Need to avoid a shallow clone (fetch-depth=1) so that the lookup of the tag works + fetch-depth: 0 + + - name: Docker meta + id: docker_meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ github.repository }} + flavor: | + latest=auto + suffix=${{ matrix.tag-suffix }},onlatest=true + tags: | + type=semver,pattern={{raw}} + type=ref,event=branch + type=ref,event=pr + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + id: setup_buildx + uses: docker/setup-buildx-action@v3 + with: + buildkitd-flags: --debug + + - name: Log in to the Container registry + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build + id: build + uses: docker/build-push-action@v5 + with: + context: . + file: Root/Dockerfile + push: ${{ matrix.push }} + build-args: | + img_repo=${{ env.BASE_REPO }} + img_tag=${{ env.BASE_TAG }} + root_tag=${{ env.ROOT_TAG }} + narg=${{ env.NARG }} + tags: ${{ env.REGISTRY }}/project8/luna_base_root:${{ env.ROOT_TAG }} + platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }} diff --git a/Root/Dockerfile b/Root/Dockerfile new file mode 100644 index 0000000..7af34bf --- /dev/null +++ b/Root/Dockerfile @@ -0,0 +1,36 @@ +ARG img_repo=ubuntu +ARG img_tag=22.04 + +FROM ${img_repo}:${img_tag} as base_image + +ARG root_tag +ENV ROOT_TAG=$root_tag + +ARG cc_val=gcc +ARG cxx_val=g++ + +ARG narg=2 + +# Set bash as the default shell +SHELL ["/bin/bash", "-c"] + +ENV CMAKE_LIBRARY_PATH=/usr/lib64 + +ENV CC=${cc_val} +ENV CXX=${cxx_val} + +# Copy all build scripts +COPY Scripts ${scripts_dir} + +ENV TARGETARCH=$TARGETARCH + +# Install as many dependencies as possible using apt +RUN ${scripts_dir}/install_packages.sh dev root &&\ +# ${scripts_dir}/install_root.sh &&\ +# rm -rf ${scripts_dir} &&\ + /bin/true + +RUN ${scripts_dir}/install_root.sh $ROOT_TAG $narg &&\ + rm -rf ${scripts_dir} &&\ + /bin/true + diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index dc4e392..51b0669 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -48,7 +48,8 @@ # apt-get update - +dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \ +libxft-dev libxext-dev python libssl-dev if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ @@ -56,21 +57,29 @@ if [[ "$1" = "dev" ]]; then wget \ cmake \ clang \ - openssl \ - vim \ - python3 \ - pipenv \ libgsl-dev \ - libopenblas-dev \ - liblapack-dev \ - libfreetype-dev \ libx11-dev \ libxpm-dev \ libxft-dev \ libxext-dev \ - libpng-dev \ - libjpeg-dev \ + python3 \ + libssl-dev \ libfftw3-dev \ + libpng-dev \ + libjpeg-dev + + if [[ "$2" = "root" ]]; then + echo "Exiting after only ROOT dependencies installed" + exit 0 + fi + + DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ + openssl \ + vim \ + pipenv \ + libopenblas-dev \ + liblapack-dev \ + libfreetype-dev \ libboost-all-dev \ libeigen3-dev \ libhdf5-dev \ diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh new file mode 100755 index 0000000..4994cb3 --- /dev/null +++ b/Scripts/install_root.sh @@ -0,0 +1,59 @@ +#! /bin/bash + +# +# This script installs the other (non-python, outside of apt) packages. +# Usage: +# > ./install_other_packages.sh +# +# Current packages here: +# - ROOT: No longer available in the package manager (after Xenial) +# Required by Katydid, Locust, Kassiopeia +# + +ROOT_TAG=$1 +echo "Installing ROOT: $ROOT_TAG" + +NARG=$2 + +echo "Target arch: $TARGETARCH" + +if [[ "$TARGETARCH" = "amd64" ]]; then + echo "Target arch: $TARGETARCH" + echo "WRONG IF BLOCK" + exit 1 + # List files to be downloaded/used + ROOT_TARBALL="${ROOT_TAG}.Linux-ubuntu22-x86_64-gcc11.3.tar.gz" + + cd /usr/local + + # Install files and cleanup + wget -nv https://root.cern/download/$ROOT_TARBALL + tar -xzf $ROOT_TARBALL + + rm $ROOT_TARBALL +else + # Source file download + ROOT_TARBALL="${ROOT_TAG}.source.tar.gz" + ROOT_SOURCE=/tmp_source + ROOT_INSTALL=/usr/local/root + + mkdir -p $ROOT_INSTALL + + mkdir $ROOT_SOURCE + cd $ROOT_SOURCE + + # Build + wget -nv https://root.cern/download/$ROOT_TARBALL + tar -xzf $ROOT_TARBALL + cd $ROOT_TAG + mkdir root_build + cd root_build + cmake -DCMAKE_INSTALL_PREFIX=$ROOT_INSTALL .. + cmake --build . -- install -j$NARG + + cd / + rm $ROOT_TARBALL + rm -r $ROOT_SOURCE +fi + +echo "Target arch: $TARGETARCH" From cedf164356e76b3e01cb8e6b7ad8c4089f6676e6 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 00:23:39 -0700 Subject: [PATCH 02/15] Modify push logic for initial testing --- .github/workflows/build_root.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_root.yaml b/.github/workflows/build_root.yaml index 1a7c46d..253e7b4 100644 --- a/.github/workflows/build_root.yaml +++ b/.github/workflows/build_root.yaml @@ -23,7 +23,8 @@ jobs: matrix: build: [Dev] include: - - push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} + - push: true +# - push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} - build: Dev tag-suffix: '-dev' - build: Prod @@ -74,7 +75,8 @@ jobs: with: context: . file: Root/Dockerfile - push: ${{ matrix.push }} +# push: ${{ matrix.push }} + push: false build-args: | img_repo=${{ env.BASE_REPO }} img_tag=${{ env.BASE_TAG }} From a7a14c308cabe57261a9bb15bb3c16608c4092ac Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 00:25:53 -0700 Subject: [PATCH 03/15] Modify workflow trigger logic for initial testing --- .github/workflows/build.yaml | 4 ++-- .github/workflows/build_root.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ae773b2..ad2d621 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,10 +2,10 @@ name: Build on: - pull_request: +# pull_request: push: branches: [main, develop] - tags: ['*'] + tags: ['v*'] workflow_dispatch: env: diff --git a/.github/workflows/build_root.yaml b/.github/workflows/build_root.yaml index 253e7b4..16a54f7 100644 --- a/.github/workflows/build_root.yaml +++ b/.github/workflows/build_root.yaml @@ -2,6 +2,7 @@ name: Build ROOT on: + pull_request: push: tags: ['root_v*'] workflow_dispatch: From b3d86f6ddc9028246db62a040e2a7a950daac082 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 00:45:01 -0700 Subject: [PATCH 04/15] Remove prod root build; Exit root install script on error; hopefully pass target arch correctly --- .github/workflows/build_root.yaml | 2 -- Root/Dockerfile | 14 ++++++-------- Scripts/install_root.sh | 17 ++++++++++------- 3 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_root.yaml b/.github/workflows/build_root.yaml index 16a54f7..a2c9177 100644 --- a/.github/workflows/build_root.yaml +++ b/.github/workflows/build_root.yaml @@ -28,8 +28,6 @@ jobs: # - push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }} - build: Dev tag-suffix: '-dev' - - build: Prod - tag-suffix: '' runs-on: ubuntu-latest steps: diff --git a/Root/Dockerfile b/Root/Dockerfile index 7af34bf..8edab28 100644 --- a/Root/Dockerfile +++ b/Root/Dockerfile @@ -3,34 +3,32 @@ ARG img_tag=22.04 FROM ${img_repo}:${img_tag} as base_image +ARG TARGETARCH ARG root_tag -ENV ROOT_TAG=$root_tag +ARG narg=2 ARG cc_val=gcc ARG cxx_val=g++ +ENV CC=${cc_val} +ENV CXX=${cxx_val} + -ARG narg=2 # Set bash as the default shell SHELL ["/bin/bash", "-c"] ENV CMAKE_LIBRARY_PATH=/usr/lib64 -ENV CC=${cc_val} -ENV CXX=${cxx_val} - # Copy all build scripts COPY Scripts ${scripts_dir} -ENV TARGETARCH=$TARGETARCH - # Install as many dependencies as possible using apt RUN ${scripts_dir}/install_packages.sh dev root &&\ # ${scripts_dir}/install_root.sh &&\ # rm -rf ${scripts_dir} &&\ /bin/true -RUN ${scripts_dir}/install_root.sh $ROOT_TAG $narg &&\ +RUN ${scripts_dir}/install_root.sh $root_tag $TARGETARCH $narg &&\ rm -rf ${scripts_dir} &&\ /bin/true diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index 4994cb3..098bac1 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -1,4 +1,5 @@ #! /bin/bash +set -e # exit on error # # This script installs the other (non-python, outside of apt) packages. @@ -13,15 +14,14 @@ ROOT_TAG=$1 echo "Installing ROOT: $ROOT_TAG" -NARG=$2 - +TARGETARCH=$2 echo "Target arch: $TARGETARCH" +NARG=$3 + if [[ "$TARGETARCH" = "amd64" ]]; then - echo "Target arch: $TARGETARCH" - echo "WRONG IF BLOCK" - exit 1 - # List files to be downloaded/used + echo "Installing pre-built binary" + ROOT_TARBALL="${ROOT_TAG}.Linux-ubuntu22-x86_64-gcc11.3.tar.gz" cd /usr/local @@ -30,9 +30,11 @@ if [[ "$TARGETARCH" = "amd64" ]]; then wget -nv https://root.cern/download/$ROOT_TARBALL tar -xzf $ROOT_TARBALL + # Cleanup rm $ROOT_TARBALL else - # Source file download + echo "Installing from source" + ROOT_TARBALL="${ROOT_TAG}.source.tar.gz" ROOT_SOURCE=/tmp_source ROOT_INSTALL=/usr/local/root @@ -51,6 +53,7 @@ else cmake -DCMAKE_INSTALL_PREFIX=$ROOT_INSTALL .. cmake --build . -- install -j$NARG + # Cleanup cd / rm $ROOT_TARBALL rm -r $ROOT_SOURCE From 1e61a46d28735731a788c78c90e2e6456462e759 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 00:59:48 -0700 Subject: [PATCH 05/15] Debugging inability to wget files: perhaps missing openssl? --- Scripts/install_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index 51b0669..4f1332c 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -54,6 +54,7 @@ if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ dpkg-dev \ + openssl \ wget \ cmake \ clang \ @@ -74,7 +75,6 @@ if [[ "$1" = "dev" ]]; then fi DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ - openssl \ vim \ pipenv \ libopenblas-dev \ From 9216b4021216dcea48974f42df95f5af94b493da Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 01:09:55 -0700 Subject: [PATCH 06/15] Removing some debugging and accidentally-left-in code --- Root/Dockerfile | 6 +----- Scripts/install_packages.sh | 3 --- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/Root/Dockerfile b/Root/Dockerfile index 8edab28..ec04373 100644 --- a/Root/Dockerfile +++ b/Root/Dockerfile @@ -24,11 +24,7 @@ COPY Scripts ${scripts_dir} # Install as many dependencies as possible using apt RUN ${scripts_dir}/install_packages.sh dev root &&\ -# ${scripts_dir}/install_root.sh &&\ -# rm -rf ${scripts_dir} &&\ - /bin/true - -RUN ${scripts_dir}/install_root.sh $root_tag $TARGETARCH $narg &&\ + ${scripts_dir}/install_root.sh $root_tag $TARGETARCH $narg &&\ rm -rf ${scripts_dir} &&\ /bin/true diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index 4f1332c..df53a44 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -47,9 +47,6 @@ # - pybind11-dev: Katydid (build only) # -apt-get update -dpkg-dev cmake g++ gcc binutils libx11-dev libxpm-dev \ -libxft-dev libxext-dev python libssl-dev if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ From 5a3df80e32b5df6fb47eed3565aef44cc6aefe39 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 01:15:10 -0700 Subject: [PATCH 07/15] Wasn't supposed to remove apt-get update --- Scripts/install_packages.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index df53a44..59e324d 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -47,6 +47,8 @@ # - pybind11-dev: Katydid (build only) # +apt-get update + if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ build-essential \ From bd8b58080039a41dc75e84bde5d17f8cd69bf93b Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 01:22:39 -0700 Subject: [PATCH 08/15] Fixed ROOT filename --- Scripts/install_root.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index 098bac1..cfac81e 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -22,7 +22,7 @@ NARG=$3 if [[ "$TARGETARCH" = "amd64" ]]; then echo "Installing pre-built binary" - ROOT_TARBALL="${ROOT_TAG}.Linux-ubuntu22-x86_64-gcc11.3.tar.gz" + ROOT_TARBALL="${ROOT_TAG}.Linux-ubuntu22-x86_64-gcc11.4.tar.gz" cd /usr/local From a992b330792799a441c40cebdbc186060123099b Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 01:31:08 -0700 Subject: [PATCH 09/15] Trying to debug ssh issue --- Scripts/install_root.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index cfac81e..14ee406 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -27,7 +27,9 @@ if [[ "$TARGETARCH" = "amd64" ]]; then cd /usr/local # Install files and cleanup - wget -nv https://root.cern/download/$ROOT_TARBALL + URL="https://root.cern/download/$ROOT_TARBALL" + echo "getting this file: $URL" + wget -nv $URL #https://root.cern/download/$ROOT_TARBALL tar -xzf $ROOT_TARBALL # Cleanup From 500599361de13f01e438df36b1e90eec8dec8591 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 01:35:30 -0700 Subject: [PATCH 10/15] Trying wgets without checking certs as a temporary workaround --- Scripts/install_root.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index 14ee406..4959629 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -29,7 +29,7 @@ if [[ "$TARGETARCH" = "amd64" ]]; then # Install files and cleanup URL="https://root.cern/download/$ROOT_TARBALL" echo "getting this file: $URL" - wget -nv $URL #https://root.cern/download/$ROOT_TARBALL + wget -nv --no-check-certificate $URL #https://root.cern/download/$ROOT_TARBALL tar -xzf $ROOT_TARBALL # Cleanup @@ -47,7 +47,7 @@ else cd $ROOT_SOURCE # Build - wget -nv https://root.cern/download/$ROOT_TARBALL + wget -nv --no-check-certificate https://root.cern/download/$ROOT_TARBALL tar -xzf $ROOT_TARBALL cd $ROOT_TAG mkdir root_build From 9c5f5140635fa3fa476b8ca01be19f78e8e739fd Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 02:01:27 -0700 Subject: [PATCH 11/15] Fix the issue with the root source directory name; just build arm64 for the moment --- .github/workflows/build_root.yaml | 3 ++- Scripts/install_root.sh | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_root.yaml b/.github/workflows/build_root.yaml index a2c9177..6753281 100644 --- a/.github/workflows/build_root.yaml +++ b/.github/workflows/build_root.yaml @@ -82,4 +82,5 @@ jobs: root_tag=${{ env.ROOT_TAG }} narg=${{ env.NARG }} tags: ${{ env.REGISTRY }}/project8/luna_base_root:${{ env.ROOT_TAG }} - platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + platforms: linux/arm64 +# platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }} diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index 4959629..e247b75 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -49,9 +49,10 @@ else # Build wget -nv --no-check-certificate https://root.cern/download/$ROOT_TARBALL tar -xzf $ROOT_TARBALL - cd $ROOT_TAG - mkdir root_build - cd root_build + # Tags have the format root_vX.Y.Z, and the directories that are in the tarballs have the format root-X.Y.Z + ROOT_DIR=`echo "$ROOT_TAG" | sed -r 's/[_v]+/-/g'` + mkdir ${ROOT_DIR}/root_build + cd ${ROOT_DIR}/root_build cmake -DCMAKE_INSTALL_PREFIX=$ROOT_INSTALL .. cmake --build . -- install -j$NARG From 3a92e7f4010436416e671fcf203fb91a9e373570 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 02:12:42 -0700 Subject: [PATCH 12/15] Debugging the ROOT source build --- Scripts/install_packages.sh | 13 +++++++------ Scripts/install_root.sh | 4 ++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index 59e324d..4efc4f5 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -23,9 +23,9 @@ # - vim: convenience utility # - wget: downloading files (e.g. tarballs to install) # - libgsl(-dev): ROOT, Kassiopeia -# - libopenblas(-dev): ??? -# - liblapack(-dev): ??? -# - libfreetype(-dev): ??? +# - libopenblas(-dev): ROOT +# - liblapack(-dev): ROOT +# - libfreetype(-dev): ROOT # - libx11(-dev): ROOT # - libxpm(-dev): ROOT # - libxft(-dev): ROOT @@ -55,6 +55,7 @@ if [[ "$1" = "dev" ]]; then dpkg-dev \ openssl \ wget \ + git \ cmake \ clang \ libgsl-dev \ @@ -62,6 +63,9 @@ if [[ "$1" = "dev" ]]; then libxpm-dev \ libxft-dev \ libxext-dev \ + libopenblas-dev \ + liblapack-dev \ + libfreetype-dev \ python3 \ libssl-dev \ libfftw3-dev \ @@ -76,9 +80,6 @@ if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ vim \ pipenv \ - libopenblas-dev \ - liblapack-dev \ - libfreetype-dev \ libboost-all-dev \ libeigen3-dev \ libhdf5-dev \ diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index e247b75..34c11bc 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -37,6 +37,10 @@ if [[ "$TARGETARCH" = "amd64" ]]; then else echo "Installing from source" + # ROOT requires numpy + pip3 install --upgrade pip + pip3 install numpy=1.14 + ROOT_TARBALL="${ROOT_TAG}.source.tar.gz" ROOT_SOURCE=/tmp_source ROOT_INSTALL=/usr/local/root From ce1c9255d9572d8fc68abde3132d2993e64b2c6d Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 02:18:43 -0700 Subject: [PATCH 13/15] Was missing pipenv --- Scripts/install_packages.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/install_packages.sh b/Scripts/install_packages.sh index 4efc4f5..7fb59ad 100755 --- a/Scripts/install_packages.sh +++ b/Scripts/install_packages.sh @@ -67,6 +67,7 @@ if [[ "$1" = "dev" ]]; then liblapack-dev \ libfreetype-dev \ python3 \ + pipenv \ libssl-dev \ libfftw3-dev \ libpng-dev \ @@ -79,7 +80,6 @@ if [[ "$1" = "dev" ]]; then DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ vim \ - pipenv \ libboost-all-dev \ libeigen3-dev \ libhdf5-dev \ From 0532967c0ab1343efc0f4b4c9222a807d3422052 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Sun, 8 Oct 2023 02:25:13 -0700 Subject: [PATCH 14/15] Messed up the numpy install syntax --- Scripts/install_root.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/install_root.sh b/Scripts/install_root.sh index 34c11bc..2f71e3a 100755 --- a/Scripts/install_root.sh +++ b/Scripts/install_root.sh @@ -39,7 +39,7 @@ else # ROOT requires numpy pip3 install --upgrade pip - pip3 install numpy=1.14 + pip3 install 'numpy>=1.14' ROOT_TARBALL="${ROOT_TAG}.source.tar.gz" ROOT_SOURCE=/tmp_source From 300494393e58088dd4290955bdce2f41af97b7e6 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 9 Oct 2023 07:12:06 -0700 Subject: [PATCH 15/15] Attempts to get a ROOT build for arm64. Not working yet. --- .github/workflows/build.yaml | 4 ++++ Dev/Dockerfile | 9 ++++++++- Prod/Dockerfile | 4 +++- Root/Dockerfile | 3 +++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ad2d621..6b2f670 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -12,6 +12,8 @@ env: REGISTRY: ghcr.io BASE_REPO: ubuntu BASE_TAG: "22.04" + ROOT_REPO: project8/luna_base_root + ROOT_TAG: "root_v6.28.06" jobs: @@ -84,6 +86,8 @@ jobs: build-args: | img_repo=${{ env.BASE_REPO }} img_tag=${{ env.BASE_TAG }} + root_repo=${{ env.REGISTRY }}/${{ env.ROOT_REPO }} + root_tag=${{ env.ROOT_TAG }} common_tag=${{ steps.tag_name.outputs.tag }} tags: ${{ steps.docker_meta.outputs.tags }} platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }} diff --git a/Dev/Dockerfile b/Dev/Dockerfile index cfd8b83..3d45b89 100644 --- a/Dev/Dockerfile +++ b/Dev/Dockerfile @@ -1,6 +1,11 @@ ARG img_repo=ubuntu ARG img_tag=22.04 +ARG root_repo=ghcr.io/project8/luna_base_root +ARG root_tag=root_v6.28.06 + +FROM ${root_repo}:${root_tag} as root_image + FROM ${img_repo}:${img_tag} as base_image ARG common_tag=beta @@ -30,7 +35,9 @@ COPY Scripts ${scripts_dir} # Install as many dependencies as possible using apt RUN ${scripts_dir}/install_packages.sh dev &&\ ${scripts_dir}/install_python_packages.sh &&\ - ${scripts_dir}/install_other_packages.sh &&\ +# ${scripts_dir}/install_other_packages.sh &&\ ${scripts_dir}/create_common_setup.sh &&\ rm -rf ${scripts_dir} &&\ /bin/true + +COPY --from=root_image /usr/local/root /usr/local/root diff --git a/Prod/Dockerfile b/Prod/Dockerfile index b108176..5f934d3 100644 --- a/Prod/Dockerfile +++ b/Prod/Dockerfile @@ -35,7 +35,7 @@ COPY Scripts ${scripts_dir} # libhdf5-dev is removed because it was previously needed to install h5py, but isn't needed for running RUN ${scripts_dir}/install_packages.sh prod &&\ ${scripts_dir}/install_python_packages.sh &&\ - ${scripts_dir}/install_other_packages.sh &&\ +# ${scripts_dir}/install_other_packages.sh &&\ apt-get purge -y \ wget \ pipenv \ @@ -44,3 +44,5 @@ RUN ${scripts_dir}/install_packages.sh prod &&\ ${scripts_dir}/create_common_setup.sh &&\ rm -rf ${scripts_dir} &&\ /bin/true + +COPY --from=root_image /usr/local/root /usr/local/root diff --git a/Root/Dockerfile b/Root/Dockerfile index ec04373..a44b9c5 100644 --- a/Root/Dockerfile +++ b/Root/Dockerfile @@ -3,7 +3,10 @@ ARG img_tag=22.04 FROM ${img_repo}:${img_tag} as base_image +# TARGETARCH should get set automatically ARG TARGETARCH + +# These need to be filled in ARG root_tag ARG narg=2