Helsinki-NLP / Opus-MT

Open neural machine translation models and web services
MIT License
592 stars 71 forks source link

Docker build fails after debian update #44

Closed agomezandrades closed 2 years ago

agomezandrades commented 3 years ago

Hi,

I am trying to build docker image, following steps in readme. However, I am facing several issues.

The current stable docker image that we get from debian has been updated, and this image does not have libprotobuf17 so docker build raises following error : E: Unable to locate package libprotobuf17

I have updated libprotobuf17 to libprotobuf23, this allows me to continue with building the docker, however, another error occurs. This happens in marian_server:

#13 873.6 /usr/src/app/marian/src/3rd_party/simple-websocket-server/server_ws.hpp: In instantiation of 'void SimpleWeb::SocketServerBase<socket_type>::Connection::set_timeout(long int) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]':
#13 873.6 /usr/src/app/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:525:30:   required from 'void SimpleWeb::SocketServerBase<socket_type>::read_handshake(const std::shared_ptr<SimpleWeb::SocketServerBase<socket_type>::Connection>&) [with socket_type = boost::asio::basic_stream_socket<boost::asio::ip::tcp>]'
#13 873.6 /usr/src/app/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:816:36:   required from here
#13 873.6 /usr/src/app/marian/src/3rd_party/simple-websocket-server/server_ws.hpp:190:84: error: 'class boost::asio::basic_stream_socket<boost::asio::ip::tcp>' has no member named 'get_io_service'
#13 873.6   190 |         timer = std::unique_ptr<asio::steady_timer>(new asio::steady_timer(socket->get_io_service()));
#13 873.6           |                                                                                                                                    ~~~~~~~~^~~~~~~~~~~~~~
#13 878.7 cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
#13 878.9 make[3]: *** [src/CMakeFiles/marian_server.dir/build.make:82: src/CMakeFiles/marian_server.dir/command/marian_server.cpp.o] Error 1
#13 878.9 make[2]: *** [CMakeFiles/Makefile2:549: src/CMakeFiles/marian_server.dir/all] Error 2
#13 878.9 make[1]: *** [CMakeFiles/Makefile2:556: src/CMakeFiles/marian_server.dir/rule] Error 2
#13 878.9 make: *** [Makefile:322: marian_server] Error 2
------
executor failed running [/bin/sh -c set -eux;   git clone https://github.com/marian-nmt/marian marian;  cd marian;  git checkout 1.9.0;     cmake . -DUSE_STATIC_LIBS=on -DCOMPILE_SERVER=on -DUSE_SENTENCEPIECE=on -DCOMPILE_CPU=on -DCOMPILE_CUDA=off;    make -j4 marian_server ;]: exit code: 2
ERROR: Service 'opus-mt' failed to build

I have seen marian_server has released a new version, so I have also tried to update it from v1.9.0 to v1.10.0, making following change in Dockerfile:

git clone https://github.com/marian-nmt/marian marian; \
        cd marian; \
        git checkout 1.10.0; \
        cmake . -DUSE_STATIC_LIBS=on -DCOMPILE_SERVER=on -DUSE_SENTENCEPIECE=on -DCOMPILE_CPU=on -DCOMPILE_CUDA=off;  \
        make -j4 marian_server

This seems to fix the issue, however a different issues arises:

#13 1085.0 /usr/include/boost/asio/impl/executor.hpp:94:15: error: 'class boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0> > >' has no member named 'dispatch'
#13 1085.0    94 |     executor_.dispatch(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);
#13 1085.0       |     ~~~~~~~~~~^~~~~~~~
#13 1085.0 /usr/include/boost/asio/impl/executor.hpp: In instantiation of 'void boost::asio::executor::impl< <template-parameter-1-1>, <template-parameter-1-2> >::post(boost::asio::executor::function&&) [with Executor = boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0> > >; Allocator = std::allocator<void>; boost::asio::executor::function = boost::asio::detail::executor_function]':
#13 1085.0 /usr/include/boost/asio/impl/executor.hpp:97:8:   required from here
#13 1085.0 /usr/include/boost/asio/impl/executor.hpp:99:15: error: 'class boost::asio::execution::any_executor<boost::asio::execution::context_as_t<boost::asio::execution_context&>, boost::asio::execution::detail::blocking::never_t<0>, boost::asio::execution::prefer_only<boost::asio::execution::detail::blocking::possibly_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::tracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::outstanding_work::untracked_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::fork_t<0> >, boost::asio::execution::prefer_only<boost::asio::execution::detail::relationship::continuation_t<0> > >' has no member named 'post'
#13 1085.0    99 |     executor_.post(BOOST_ASIO_MOVE_CAST(function)(f), allocator_);
#13 1085.0       |     ~~~~~~~~~~^~~~

I am very interested in using Opus-MT, how can I fix it? do you have a working docker image that I can use?

santhoshtr commented 3 years ago

Debian bullseye comes with Boost 1.74 and Marian cannot compile with that. Marian 1.9.0 cannot compile with 1.71 too. That is the version we have currently in Dockerfile.

I will update if I get the required docker script update for this.

agomezandrades commented 3 years ago

Ok, It will be great to have it :) We'll wait for it. do you know when it will be available?

cgr71ii commented 2 years ago

I have changed the line FROM debian:stable as builder to FROM debian:10 as builder and it doesn't show the error anymore.

agomezandrades commented 2 years ago

Thanks! we can work with that

davidberenstein1957 commented 2 years ago

docker-compose build fails for me too, even after these fixes. Is there a stable Dockerfile available?

santhoshtr commented 2 years ago

Since Marian is not providing fixes for Debian stable(bullseye), the only solution right now is to stick with debian:10 as @cgr71ii replied above.

jorgtied commented 2 years ago

Can we close this issue as the solution with FROM debian:buster as builder seems to solve the problem for now, right?