Skip to content

Commit

Permalink
Fix dockerfiles. (#4900)
Browse files Browse the repository at this point in the history
Co-authored-by: David Gauldie <[email protected]>
  • Loading branch information
kbirk and dgauldie authored Sep 24, 2024
1 parent 2f4ee55 commit 5903e0a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
24 changes: 22 additions & 2 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function "check_suffix" {

# ---------------------------------
group "prod" {
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner"]
targets = ["hmi-client", "hmi-server", "gollm-taskrunner", "mira-taskrunner", "funman-taskrunner", "text-extraction-taskrunner", "equation-extraction-taskrunner"]
}

group "default" {
targets = ["hmi-client-base", "hmi-server-base", "gollm-taskrunner-base", "mira-taskrunner-base", "funman-taskrunner-base"]
targets = ["hmi-client-base", "hmi-server-base", "gollm-taskrunner-base", "mira-taskrunner-base", "funman-taskrunner-base", "text-extraction-taskrunner-base", "equation-extraction-taskrunner-base"]
}

# ---------------------------------
Expand Down Expand Up @@ -87,3 +87,23 @@ target "funman-taskrunner-base" {
target "funman-taskrunner" {
inherits = ["_platforms", "funman-taskrunner-base"]
}

target "equation-extraction-taskrunner-base" {
context = "." # root of the repo
dockerfile = "./packages/equation_extraction/Dockerfile"
tags = tag("equation-extraction-taskrunner", "", "")
}

target "equation-extraction-taskrunner" {
inherits = ["_platforms", "equation-extraction-taskrunner-base"]
}

target "text-extraction-taskrunner-base" {
context = "." # root of the repo
dockerfile = "./packages/text_extraction/Dockerfile"
tags = tag("text-extraction-taskrunner", "", "")
}

target "text-extraction-taskrunner" {
inherits = ["_platforms", "text-extraction-taskrunner-base"]
}
44 changes: 22 additions & 22 deletions packages/equation_extraction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ FROM python:3.11-slim-bookworm AS equation_extraction_taskrunner_builder

# Install OpenJDK
RUN apt-get update && apt-get install -y --no-install-recommends \

Check failure on line 10 in packages/equation_extraction/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
build-essential \
git \
libgl1 \
libglib2.0-0 \
poppler-utils \
wget \
openjdk-17-jdk-headless && \
rm -rf /var/lib/apt/lists/*
build-essential \
git \
libgl1 \
libglib2.0-0 \
poppler-utils \
wget \
openjdk-17-jdk-headless && \
rm -rf /var/lib/apt/lists/*

# Install equation-extraction
COPY ./packages/equation_extraction/equation-extraction-version.txt /extractionVersion.txt
RUN COMMIT_SHA="$(cat /extractionVersion.txt)" && \
echo "Using document_intelligence commit $COMMIT_SHA" && \
wget --progress=dot:giga -O equation-extraction.tar.gz "https://github.com/DARPA-ASKEM/document_intelligence/archive/${COMMIT_SHA}.tar.gz" && \
tar -zxvf equation-extraction.tar.gz && \
rm equation-extraction.tar.gz && \
mv document_intelligence-* document_intelligence
echo "Using document_intelligence commit $COMMIT_SHA" && \
wget --progress=dot:giga -O equation-extraction.tar.gz "https://github.com/DARPA-ASKEM/document_intelligence/archive/${COMMIT_SHA}.tar.gz" && \
tar -zxvf equation-extraction.tar.gz && \
rm equation-extraction.tar.gz && \
mv document_intelligence-* document_intelligence
WORKDIR /document_intelligence/document_intelligence/fast_latex
RUN pip3 install -r requirements.txt

Check failure on line 29 in packages/equation_extraction/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3042 warning: Avoid use of cache directory with pip. Use `pip install --no-cache-dir <package>`

Expand All @@ -43,7 +43,7 @@ RUN ./gradlew bootJar
WORKDIR /

# Copy the jar to the root directory
RUN mv /taskrunner/build/libs/*.jar .
RUN cp /taskrunner/build/libs/*.jar .
RUN mv /terarium-1.0.0-SNAPSHOT.jar /taskrunner.jar

Check failure on line 47 in packages/equation_extraction/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3059 info: Multiple consecutive `RUN` instructions. Consider consolidation.

# ------------------------------------------------------------------------------
Expand All @@ -53,14 +53,14 @@ WORKDIR /

# Install OpenJDK JRE
RUN apt-get update && apt-get install -y --no-install-recommends \

Check failure on line 55 in packages/equation_extraction/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3008 warning: Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
build-essential \
git \
libgl1 \
libglib2.0-0 \
poppler-utils \
wget \
openjdk-17-jre-headless && \
rm -rf /var/lib/apt/lists/*
build-essential \
git \
libgl1 \
libglib2.0-0 \
poppler-utils \
wget \
openjdk-17-jre-headless && \
rm -rf /var/lib/apt/lists/*

# Copy the supervisord configuration file
COPY ./packages/equation_extraction/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
Expand Down
6 changes: 1 addition & 5 deletions packages/text_extraction/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ RUN ./gradlew bootJar

WORKDIR /

# Copy the jar to the root directory
RUN mv /taskrunner/build/libs/*.jar .
RUN mv /terarium-1.0.0-SNAPSHOT.jar /taskrunner.jar

# -----------------------------------------------------------------------------
# ------------------------------------------------------------------------------
FROM python:3.11-slim-bookworm

WORKDIR /
Expand Down

0 comments on commit 5903e0a

Please sign in to comment.