Skip to content

Commit

Permalink
optimize the dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lfoppiano committed Apr 22, 2024
1 parent c164c48 commit baef26d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ jobs:
runs-on: ubuntu-latest

steps:
# - name: Maximize build disk space
# uses: easimon/maximize-build-space@v10
# with:
# root-reserve-mb: 512
# swap-size-mb: 1024
# remove-dotnet: 'true'
- name: Create more disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /opt/hostedtoolcache
- name: Maximize build disk space
uses: easimon/maximize-build-space@v10
with:
root-reserve-mb: 512
swap-size-mb: 1024
remove-dotnet: 'true'
# - name: Create more disk space
# run: |
# sudo rm -rf /usr/share/dotnet
# sudo rm -rf /opt/ghc
# sudo rm -rf "/usr/local/share/boost"
# sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# sudo rm -rf /opt/hostedtoolcache
- uses: actions/checkout@v4
- name: Build and push
id: docker_build
Expand Down
11 changes: 3 additions & 8 deletions Dockerfile.datastet
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,9 @@ RUN ./gradlew installModels --no-daemon --info --stacktrace \
# Preparing distribution
WORKDIR /opt/grobid
RUN unzip -o /opt/grobid/datastet-source/build/distributions/datastet-*.zip -d datastet_distribution \
&& mv datastet_distribution/datastet-* datastet
&& mv datastet_distribution/datastet-* datastet \
&& rm -rf /opt/grobid/datastet-source/build

# Cleanup
RUN rm -rf datastet-source/.git \
&& rm -rf /opt/grobid/datastet-source/build/distributions/datastet-*.zip \
&& rm -rf datastet-source/build

WORKDIR /opt

# -------------------
# build runtime image
Expand Down Expand Up @@ -82,7 +77,7 @@ WORKDIR /opt/grobid
#RUN mv elmo_2x4096_512_2048cnn_2xhighway_5.5B_weights.hdf5 /opt/elmo/

# this will build and load embeddings on the image forever (only if required by the config) :)
RUN #python3 preload_embeddings.py --registry ./resources-registry.json --embedding word2vec
RUN python3 preload_embeddings.py --registry ./resources-registry.json --embedding word2vec

ARG GROBID_VERSION
ENV GROBID_VERSION=${GROBID_VERSION:-latest}
Expand Down

0 comments on commit baef26d

Please sign in to comment.