Skip to content

Commit

Permalink
reduce image similarly as done with the crf-only one
Browse files Browse the repository at this point in the history
  • Loading branch information
kermitt2 committed Mar 19, 2021
1 parent 350dfe6 commit d225477
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
15 changes: 9 additions & 6 deletions Dockerfile.delft
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ COPY settings.gradle ./
COPY grobid-home/ ./grobid-home/
COPY grobid-core/ ./grobid-core/
COPY grobid-service/ ./grobid-service/
COPY grobid-trainer/ ./grobid-trainer/

# cleaning unused native libraries before packaging
RUN rm -rf grobid-home/pdf2xml/lin-32
RUN rm -rf grobid-home/pdf2xml/mac-64
RUN rm -rf grobid-home/pdf2xml/win-*
RUN rm -rf grobid-home/lib/lin-32
RUN rm -rf grobid-home/lib/win-*
RUN rm -rf grobid-home/lib/mac-64

RUN ./gradlew clean assemble --no-daemon --info --stacktrace

Expand Down Expand Up @@ -76,12 +85,6 @@ RUN rm -rf /opt/grobid/grobid-home/pdf2xml/win-*
RUN rm -rf /opt/grobid/grobid-home/lib/lin-32
RUN rm -rf /opt/grobid/grobid-home/lib/win-*

# below to allow logs to be written in the container (not advised for production!)
# RUN mkdir -p logs

# the following might not be necessary - but should result in faster temp file write than directly in the container
VOLUME ["/opt/grobid/grobid-home/tmp"]

RUN python3 -m pip install pip --upgrade

# install DeLFT via pypi
Expand Down
6 changes: 3 additions & 3 deletions doc/Grobid-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The process for retrieving and running the image is as follow:
> docker pull grobid/grobid:${latest_grobid_version}
```

- Run the container (note the new version running on 8070, however it will be mapped on the 8080 of your host):
- Run the container:

```bash
> docker run --rm --gpus all --init grobid/grobid:${latest_grobid_version}
Expand All @@ -61,7 +61,7 @@ The image will automatically uses the GPU and CUDA version available on your hos
To specify to use only certain GPUs (see the [nvidia container toolkit user guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/user-guide.html#gpu-enumeration) for more details):

```bash
> docker run --rm --gpus '"device=1,2"' --init -p 8070:8080 -p 8071:8081 grobid/grobid:${latest_grobid_version}
> docker run --rm --gpus '"device=1,2"' --init -p 8080:8070 -p 8081:8071 grobid/grobid:${latest_grobid_version}
```

You can run the image on CPU by omitting the `-gpus` parameters.
Expand All @@ -83,7 +83,7 @@ Grobid web services are then available as described in the [service documentatio
The simplest way to pass a modified configuration to the docker image is to mount the property file `grobid.properties` when running the image. Modify the config file `grobid/grobid-home/config/grobid.properties` according to your requirements on the host machine and mount it when running the image as follow:

```bash
docker run --rm --gpus all --init -p 8070:8080 -p 8071:8081 -v /home/lopez/grobid/grobid-home/config/grobid.properties:/opt/grobid/grobid-home/config/grobid.properties:ro grobid/grobid:0.6.2-SNAPSHOT
docker run --rm --gpus all --init -p 8080:8070 -p 8081:8071 -v /home/lopez/grobid/grobid-home/config/grobid.properties:/opt/grobid/grobid-home/config/grobid.properties:ro grobid/grobid:0.6.2-SNAPSHOT
```

You need to use an absolute path to specify your modified `grobid.properties` file.
Expand Down

0 comments on commit d225477

Please sign in to comment.