Remove Docker-based builds since they are no more reproducible than metal builds. Fixes https://github.com/browsermt/bergamot-translator/issues/31

This commit is contained in:
Motin 2021-02-18 15:02:44 +02:00
parent 79571bada5
commit 51f702ea6c
3 changed files with 0 additions and 118 deletions

View File

@ -1,55 +0,0 @@
# -*- mode: makefile-gmake; indent-tabs-mode: true; tab-width: 4 -*-
SHELL = bash
PWD = $(shell pwd)
WASM_IMAGE = local/bergamot-translator-build-wasm
all: wasm-image compile-wasm
# Build the Docker image for WASM builds
wasm-image:
docker build -t local/bergamot-translator-build-wasm ./wasm/
# Commands for compilation:
cmake_cmd = cmake
wasm_cmake_cmd = ${cmake_cmd}
wasm_cmake_cmd += -DCOMPILE_WASM=on
wasm_cmake_cmd += -DProtobuf_INCLUDE_DIR=/usr/opt/protobuf-wasm-lib/dist/include
wasm_cmake_cmd += -DProtobuf_LIBRARY=/usr/opt/protobuf-wasm-lib/dist/lib/libprotobuf.a
wasm_cmake_cmd += -DPACKAGE_DIR=/repo/models
make_cmd = make
#make_cmd += VERBOSE=1
# ... and running things on Docker
docker_mounts = ${PWD}/..:/repo
docker_mounts += ${HOME}/.ccache:/.ccache
run_on_docker = docker run --rm
run_on_docker += $(addprefix -v, ${docker_mounts})
run_on_docker += ${INTERACTIVE_DOCKER_SESSION}
${HOME}/.ccache:
mkdir -p $@
# Remove the bergamot-translator WASM build dir, forcing a clean compilation attempt
clean-wasm: BUILD_DIR = /repo/build-wasm-docker
clean-wasm: ${HOME}/.ccache
${run_on_docker} ${WASM_IMAGE} bash -c '(rm -rf ${BUILD_DIR} || true)'
# Compile bergamot-translator to WASM
compile-wasm: BUILD_DIR = /repo/build-wasm-docker
compile-wasm: ${HOME}/.ccache
${run_on_docker} ${WASM_IMAGE} bash -c 'mkdir -p ${BUILD_DIR} && \
cd ${BUILD_DIR} && \
(emcmake ${wasm_cmake_cmd} .. && \
(emmake ${make_cmd}) || \
rm CMakeCache.txt)'
# Start interactive shells for development / debugging purposes
native-shell: INTERACTIVE_DOCKER_SESSION = -it
native-shell:
${run_on_docker} ${NATIVE_IMAGE} bash
wasm-shell: INTERACTIVE_DOCKER_SESSION = -it
wasm-shell:
${run_on_docker} ${WASM_IMAGE} bash

View File

@ -1,27 +0,0 @@
## WASM
Prepare docker image for WASM compilation:
```bash
make wasm-image
```
Compile to wasm:
```bash
make compile-wasm
```
## Debugging
Remove the marian-decoder build dir, forcing the next compilation attempt to start from scratch:
```bash
make clean-wasm
```
Enter a docker container shell for manually running commands:
```bash
make wasm-shell
```

View File

@ -1,36 +0,0 @@
FROM emscripten/emsdk:2.0.9
# Install specific version of CMake
WORKDIR /usr
RUN wget https://github.com/Kitware/CMake/releases/download/v3.17.2/cmake-3.17.2-Linux-x86_64.tar.gz -qO-\
| tar xzf - --strip-components 1
# Install Python and Java (needed for Closure Compiler minification)
RUN apt-get update \
&& apt-get install -y \
python3 \
default-jre
# Deps to compile protobuf from source + the protoc binary which we need natively
RUN apt-get update -y && apt-get --no-install-recommends -y install \
protobuf-compiler \
autoconf \
autotools-dev \
automake \
autogen \
libtool && ln -s /usr/bin/libtoolize /usr/bin/libtool \
&& mkdir -p /usr/opt \
&& cd /usr/opt \
&& git clone https://github.com/menduz/protobuf-wasm-lib
RUN cd /usr/opt/protobuf-wasm-lib \
&& /bin/bash -c "BRANCH=v3.6.1 ./prepare.sh"
RUN cd /usr/opt/protobuf-wasm-lib/protobuf \
&& bash -x ../build.sh
RUN cp /usr/bin/protoc /usr/opt/protobuf-wasm-lib/dist/bin/protoc
RUN apt-get --no-install-recommends -y install \
libprotobuf-dev
# Necessary for benchmarking
RUN pip3 install sacrebleu