bbc / audiowaveform

C++ program to generate waveform data and render waveform images from audio files
https://waveform.prototyping.bbc.co.uk
GNU General Public License v3.0
1.94k stars 242 forks source link

copy bin from docker image? debian based #191

Closed michelson closed 1 year ago

michelson commented 1 year ago

Hi there, I'm using Debian based image, and it seems that the Ubuntu ppa repo is not compatible with Debian images? so I though this could work:

COPY --from=realies/audiowaveform /usr/local/bin/audiowaveform /usr/local/bin/

but when I try to run the executable it is not available, maybe I'm doing something wrong, do you have any hints on this?

chrisn commented 1 year ago

What error are you seeing?

michelson commented 1 year ago

when I try to excecute the program I get:

audiowaveform 
bash: /usr/local/bin/audiowaveform: No such file or directory

if I do tail -100 /usr/local/bin/audiowaveform I get the executable binary information

chrisn commented 1 year ago

Thanks! It looks like it's not statically linked against musl libc:

$ ldd /usr/local/bin/audiowaveform
        linux-vdso.so.1 (0x00007fffda96e000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa0e83e1000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa0e83c6000)
        libc.musl-x86_64.so.1 => not found
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa0e8277000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa0e8085000)
        /lib/ld-musl-x86_64.so.1 => /lib64/ld-linux-x86-64.so.2 (0x00007fa0e85d7000)

Do you particularly need it to be statically linked? Would it be easier if I provide a Debian package?

chrisn commented 1 year ago

Debian packages (for Debian 10, 11, and 12 on x64) are now available on the Releases page.

sudo apt-get update
wget https://github.com/bbc/audiowaveform/releases/download/1.8.1/audiowaveform_1.8.1-1-12_amd64.deb
sudo dpkg -i audiowaveform_1.8.1-1-12_amd64.deb
sudo apt -f install
michelson commented 1 year ago

Hi @chrisn, thank you very much for this release. I had a problem installing it on my architecture tho,

 => ERROR [stage-0 19/28] RUN dpkg -i audiowaveform_1.8.1-1-12_amd64.deb                                                              0.3s
------
 > [stage-0 19/28] RUN dpkg -i audiowaveform_1.8.1-1-12_amd64.deb:
#24 0.312 dpkg: error processing archive audiowaveform_1.8.1-1-12_amd64.deb (--install):
#24 0.312  package architecture (amd64) does not match system (arm64)
#24 0.317 Errors were encountered while processing:
#24 0.317  audiowaveform_1.8.1-1-12_amd64.deb

Can we release this for the arm64 arch?

chrisn commented 1 year ago

Sure, yes. I've just uploaded arm64 binaries.

michelson commented 1 year ago

Hi Chris, unfortunately, I still have issues installing this; it seems that I have some dependencies missing

Running:

RUN apt-get update
RUN wget https://github.com/bbc/audiowaveform/releases/download/1.8.1/audiowaveform_1.8.1-1-12_arm64.deb
RUN dpkg -i audiowaveform_1.8.1-1-12_arm64.deb
RUN apt -f install
 > [stage-0 19/27] RUN dpkg -i audiowaveform_1.8.1-1-12_arm64.deb:
#24 0.338 Selecting previously unselected package audiowaveform.
#24 0.407 (Reading database ... 26499 files and directories currently installed.)
#24 0.408 Preparing to unpack audiowaveform_1.8.1-1-12_arm64.deb ...
#24 0.409 Unpacking audiowaveform (1.8.1) ...
#24 0.424 dpkg: dependency problems prevent configuration of audiowaveform:
#24 0.424  audiowaveform depends on libmad0 (>= 0.15.1); however:
#24 0.424   Package libmad0 is not installed.
#24 0.424  audiowaveform depends on libid3tag0 (>= 0.15.1); however:
#24 0.424   Package libid3tag0 is not installed.
#24 0.424  audiowaveform depends on libsndfile1 (>= 1.0.25); however:
#24 0.424   Package libsndfile1 is not installed.
#24 0.424  audiowaveform depends on libgd3 (>= 2.0.35) | libgd2-xpm (>= 2.0.35); however:
#24 0.424   Package libgd3 is not installed.
#24 0.424   Package libgd2-xpm is not installed.
#24 0.424  audiowaveform depends on libboost-program-options1.74.0; however:
#24 0.424   Package libboost-program-options1.74.0 is not installed.
#24 0.424  audiowaveform depends on libboost-filesystem1.74.0; however:
#24 0.424   Package libboost-filesystem1.74.0 is not installed.
#24 0.424  audiowaveform depends on libboost-regex1.74.0; however:
#24 0.424   Package libboost-regex1.74.0 is not installed.
#24 0.424 
#24 0.424 dpkg: error processing package audiowaveform (--install):
#24 0.424  dependency problems - leaving unconfigured
#24 0.429 Errors were encountered while processing:
#24 0.429  audiowaveform

Is there a specific list of dependencies that you could provide to setup the docker steps?

chrisn commented 1 year ago

The dpkg command errors because the dependencies are missing, then apt -f install will install them, so you need to ignore the error from the dpkg command.

chrisn commented 1 year ago

If you prefer you can install the dependencies before running dpkg:

apt-get install libgd3 libmad0 libid3tag0 libsndfile1 libboost-program-options1.74.0
  libboost-filesystem1.74.0 libboost-regex1.74.0
michelson commented 1 year ago

Hi Chris, thanks for your help, this command seemed to work:

RUN apt-get update && \
    wget https://github.com/bbc/audiowaveform/releases/download/1.8.1/audiowaveform_1.8.1-1-12_arm64.deb && \
    dpkg -i audiowaveform_1.8.1-1-12_arm64.deb || true && \
    apt-get -f install -y

I will test this in production now 🥇

chrisn commented 1 year ago

Please let me know if it works, I haven't tested the arm64 build before!

michelson commented 1 year ago

Hi Chris, the installation seems to work, but I can't see the executable it is supposed to be installed on /usr/local/bin ?

chrisn commented 1 year ago

It should be in /usr/bin.

michelson commented 1 year ago

uhm I've searched in /usr/bin /user/local/bin /bin and the executable is not there

chrisn commented 1 year ago

That's odd.... maybe the apt -f install didn't work. I suggest trying installing the dependencies before running dpkg to install audiowaveform. (If you don't run apt-get update first, this step will remove audiowaveform.)

chrisn commented 1 year ago

I just tested locally, here's the output: https://gist.github.com/chrisn/95840ff742f0fd187d952892bd96833f

michelson commented 1 year ago

I think my issue is the glibc is not matching with the compiled version.

testing it locally even with the installation of dependences:-

docker@20c49c27d369:/usr/src/app$ audiowaveform
audiowaveform: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by audiowaveform)
audiowaveform: /lib/aarch64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by audiowaveform)
audiowaveform: /usr/lib/aarch64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by audiowaveform)
docker@20c49c27d369:/usr/src/app$ 

the current version of is ldd --version ldd (Debian GLIBC 2.31-13+deb11u5) 2.31

I will try to update the glibc version on my system, which version of debian are you using? I'm using bullseye.

michelson commented 1 year ago

I could not upgrade glibc on bullseye but I can confirm that it works ok on debian 12 (bookworm)

chrisn commented 1 year ago

There's no need to update glibc, just select the right package file for your Debian version:

audiowaveform_1.8.1-1-12_arm64.deb - Debian 12 (bookworm) audiowaveform_1.8.1-1-11_arm64.deb - Debian 11 (bullseye) audiowaveform_1.8.1-1-10_arm64.deb - Debian 10 (buster)

michelson commented 1 year ago

Thank you very much for all the help, @chrisn, Waveforms are beautifully displayed on rauversion.com now 🎉 Time to close this issue now. 🙏

chrisn commented 1 year ago

Thank you! Love the website..!