ImperialCollegeLondon / drunc_ui

https://imperialcollegelondon.github.io/drunc_ui/
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

`drunc` compose profile fails to build on MacOS #209

Open AdrianDAlessandro opened 6 days ago

AdrianDAlessandro commented 6 days ago

Following the Docker setup instructions in the README, I was able to get the drunc-lite profile working, but the drunc profile failed.

I believe this is an Apple Silicon-only issue because it mentions "rosetta" in the error message, which is the conversion tool for running x86 on ARM.

I can't tell where the error is because it's happening on a multi-line RUN command in the Dockerfile.

$ docker compose --profile drunc build
 => ERROR [drunc  4/14] RUN source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh &&         setup_dbt latest_v5 &&         dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9 &&         cd fddaq-v5.1.0-a9 &&  0.8s
------
 > [drunc  4/14] RUN source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh &&         setup_dbt latest_v5 &&         dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9 &&         cd fddaq-v5.1.0-a9 &&         source env.sh &&         dbt-build &&         dbt-workarea-env &&         pip install git+https://github.com/DUNE-DAQ/drunc.git@v0.10.2:
0.267 Added /cvmfs/dunedaq.opensciencegrid.org/tools/dbt/v8.4.0/bin -> PATH
0.268 Added /cvmfs/dunedaq.opensciencegrid.org/tools/dbt/v8.4.0/scripts -> PATH
0.268 DBT setuptools loaded
0.777 ERROR: [Wed Nov 6 12:28:23 UTC 2024] [/cvmfs/dunedaq.opensciencegrid.org/tools/dbt/v8.4.0/scripts/dbt_setup_tools.py:82]: There was a problem running "/cvmfs/dunedaq.opensciencegrid.org/tools/dbt/v8.4.0/scripts/dbt-clone-pyvenv.sh /cvmfs/dunedaq.opensciencegrid.org/spack/releases/fddaq-v5.1.0-a9-1/.venv 2>&1" (return value 100); exiting...
0.777 Release "fddaq-v5.1.0-a9" requested; interpreting this as release "fddaq-v5.1.0-a9-1"
0.777 Setting up the Python subsystem.
0.777 ==> Error: SPACK_ROOT must point to spack's prefix when using rosetta
0.777 Run this with the correct prefix before sourcing setup-env.sh:
0.777     export SPACK_ROOT=</path/to/spack>
0.777 ERROR: [11/06/24 12:28:23] [dbt-setup-tools.sh:210]:  There was a problem source-ing Spack setup script "/cvmfs/dunedaq.opensciencegrid.org/spack/releases/fddaq-v5.1.0-a9-1/spack-0.20.0/share/spack/setup-env.sh" 
------
failed to solve: process "/bin/bash -c source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh &&         setup_dbt latest_v5 &&         dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9 &&         cd fddaq-v5.1.0-a9 &&         source env.sh &&         dbt-build &&         dbt-workarea-env &&         pip install git+https://github.com/DUNE-DAQ/drunc.git@v0.10.2" did not complete successfully: exit code: 1
AdrianDAlessandro commented 6 days ago

I tried isolating the multi-line RUN command in the Dockerfile into steps to see which one is causing the error. I think it's the dbt-create step that is causing the error.

This is a little convoluted because there must be some details about the way RUN and && \ work in Dockerfiles that I'm missing. But I got the same error as above with this in the Dockerfile:

RUN source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh && \
        setup_dbt latest_v5 && \
        dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9
RUN cd fddaq-v5.1.0-a9
RUN source env.sh
RUN dbt-build
RUN dbt-workarea-env
RUN pip install git+https://github.com/DUNE-DAQ/drunc.git@v0.10.2

And then I got a different error with this in Dockerfile:

RUN source /cvmfs/dunedaq.opensciencegrid.org/setup_dunedaq.sh && \
        setup_dbt latest_v5
RUN dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9
RUN cd fddaq-v5.1.0-a9
RUN source env.sh
RUN dbt-build
RUN dbt-workarea-env
RUN pip install git+https://github.com/DUNE-DAQ/drunc.git@v0.10.2

That error was:

 => ERROR [drunc  5/20] RUN dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9                                                                                                                                                           0.1s
------                                                                                                                                                                                                                                
 > [drunc  5/20] RUN dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9:
0.122 /bin/bash: line 1: dbt-create: command not found
------
failed to solve: process "/bin/bash -c dbt-create fddaq-v5.1.0-a9 fddaq-v5.1.0-a9" did not complete successfully: exit code: 127

Since the dbt-create line was run, it makes we think everything before it passed.