Skip to content

Commit

Permalink
add mira-version.txt and use in dockerfile (#3814)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Chang <[email protected]>
  • Loading branch information
dgauldie and mwdchang authored Jun 13, 2024
1 parent fb294df commit fed8a88
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 34 deletions.
33 changes: 22 additions & 11 deletions packages/funman/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@ RUN ./gradlew bootJar
# ------------------------------------------------------------------------------

# Funman-base, should contain dreal4, ibex, and python dependencies
FROM ghcr.io/darpa-askem/funman-base:latest-e5fb635757aa57007615a75371f55dd4a24851e0
FROM ghcr.io/darpa-askem/funman-base:latest

Check failure on line 13 in packages/funman/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3007 warning: Using latest is prone to errors if the image will ever update. Pin the version explicitly to a release tag

# Install OpenJDK JRE
WORKDIR /

# Install OpenJDK JRE and git
RUN apt-get update && \

Check failure on line 18 in packages/funman/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>`
apt-get install -y --no-install-recommends openjdk-17-jre-headless && \
apt-get install -y --no-install-recommends git && \
rm -rf /var/lib/apt/lists/*

# Copy the Spring Boot fat JAR from the builder image
Expand All @@ -24,24 +27,32 @@ COPY --from=taskrunner_builder /taskrunner/build/libs/*.jar /taskrunner.jar
COPY ./packages/taskrunner/src/test/resources/echo.py /echo.py

# Install funman-api
ADD https://api.github.com/repos/DARPA-ASKEM/funman-api/git/refs/heads/develop version.json
RUN git clone https://github.com/DARPA-ASKEM/funman-api.git && \
cd funman-api && \
pip install . && \
pip install auxiliary_packages/funman_dreal && \
pip install auxiliary_packages/funman_demo
RUN echo "Cache bust so we can always pull latest Funman" $(date -u)

Check failure on line 30 in packages/funman/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

SC2046 warning: Quote this to prevent word splitting.
COPY ./packages/funman/funman-version.txt /funmanVersion.txt

RUN git clone https://github.com/DARPA-ASKEM/funman-api.git

WORKDIR /funman-api
RUN COMMIT_SHA=$(cat /funmanVersion.txt) && \

Check failure on line 36 in packages/funman/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

SC2086 info: Double quote to prevent globbing and word splitting.
echo "Using FUNMAN commit $COMMIT_SHA" && \
git reset --hard $COMMIT_SHA
RUN pip install --no-cache-dir . && \
pip install --no-cache-dir auxiliary_packages/funman_dreal && \
pip install --no-cache-dir auxiliary_packages/funman_demo

# Install taskrunner
WORKDIR /
COPY ./packages/taskrunner/setup.py /taskrunner/setup.py
COPY ./packages/taskrunner/taskrunner.py /taskrunner/taskrunner.py

WORKDIR /taskrunner
RUN pip install -e .
RUN pip install --no-cache-dir -e .

# Install funman tasks
COPY ./packages/funman /funman_tasks

WORKDIR /funman_tasks
RUN pip install -e .
RUN pip install --no-cache-dir -e .

WORKDIR /

CMD ["java", "-jar", "taskrunner.jar"]
1 change: 1 addition & 0 deletions packages/funman/funman-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ff7051312955710c3e22b2a0cef85625b09fa461
33 changes: 19 additions & 14 deletions packages/gollm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ FROM python:3.10-slim

WORKDIR /

# Install OpenJDK JRE
# Install OpenJDK JRE and wget
RUN apt-get update && \

Check failure on line 18 in packages/gollm/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>`
apt-get install -y --no-install-recommends openjdk-17-jre-headless && \
apt-get install -y --no-install-recommends wget && \
rm -rf /var/lib/apt/lists/*

# Copy the Spring Boot fat JAR from the builder image
Expand All @@ -25,29 +26,33 @@ COPY --from=taskrunner_builder /taskrunner/build/libs/*.jar /taskrunner.jar
# Copy the echo script for testing
COPY ./packages/taskrunner/src/test/resources/echo.py /echo.py

# Install wget
RUN apt-get update && \
apt-get install -y --no-install-recommends wget && \
rm -rf /var/lib/apt/lists/*

# Install GoLLM
RUN echo "Cache bust so we can always pull latest GoLLM" $(date -u)

Check failure on line 30 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

SC2046 warning: Quote this to prevent word splitting.
RUN wget -O gollm.tar.gz https://github.com/DARPA-ASKEM/GoLLM/archive/refs/heads/main.tar.gz && \
tar -zxvf gollm.tar.gz && \
mv GoLLM-* GoLLM && \
cd /GoLLM && \
pip install -e .
COPY ./packages/gollm/gollm-version.txt /gollmVersion.txt
RUN COMMIT_SHA=$(cat /gollmVersion.txt) && \

Check failure on line 32 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

SC2086 info: Double quote to prevent globbing and word splitting.

Check failure on line 32 in packages/gollm/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

DL3047 info: Avoid use of wget without progress bar. Use `wget --progress=dot:giga <url>`. Or consider using `-q` or `-nv` (shorthands for `--quiet` or `--no-verbose`).
echo "Using GoLLM commit $COMMIT_SHA" && \
wget -O gollm.tar.gz https://github.com/DARPA-ASKEM/GoLLM/archive/${COMMIT_SHA}.tar.gz

RUN tar -zxvf gollm.tar.gz && \
rm gollm.tar.gz
RUN mv GoLLM-* GoLLM

WORKDIR /GoLLM
RUN pip install --no-cache-dir -e .

# Install taskrunner
WORKDIR /
COPY ./packages/taskrunner/setup.py /taskrunner/setup.py
COPY ./packages/taskrunner/taskrunner.py /taskrunner/taskrunner.py

WORKDIR /taskrunner
RUN pip install -e .
RUN pip install --no-cache-dir -e .

# Install GoLLM tasks
COPY ./packages/gollm /gollm_task

WORKDIR /gollm_task
RUN pip install -e .
RUN pip install --no-cache-dir -e .

WORKDIR /

CMD ["java", "-jar", "taskrunner.jar"]
1 change: 1 addition & 0 deletions packages/gollm/gollm-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
468f7863d0d63f005d6dd1564cfadaecdbe04180
26 changes: 17 additions & 9 deletions packages/mira/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ FROM python:3.10-slim

WORKDIR /

# Install OpenJDK JRE and git
# Install OpenJDK JRE and wget
RUN apt-get update && \

Check failure on line 18 in packages/mira/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>`
apt-get install -y --no-install-recommends openjdk-17-jre-headless && \
apt-get install -y --no-install-recommends wget && \
Expand All @@ -28,23 +28,31 @@ COPY ./packages/taskrunner/src/test/resources/echo.py /echo.py

# Install Mira
RUN echo "Cache bust so we can always pull latest MIRA" $(date -u)

Check failure on line 30 in packages/mira/Dockerfile

View workflow job for this annotation

GitHub Actions / Lint Docker Files / Lint Docker Files

SC2046 warning: Quote this to prevent word splitting.
RUN wget -O mira.tar.gz https://github.com/gyorilab/mira/archive/refs/heads/main.tar.gz && \
tar -zxvf mira.tar.gz && \
mv mira-* mira && \
cd /mira && \
pip install -e .[sbml,biomodels]
COPY ./packages/mira/mira-version.txt /miraVersion.txt
RUN COMMIT_SHA=$(cat /miraVersion.txt) && \
echo "Using MIRA commit $COMMIT_SHA" && \
wget -O mira.tar.gz https://github.com/gyorilab/mira/archive/${COMMIT_SHA}.tar.gz

RUN tar -zxvf mira.tar.gz && \
rm mira.tar.gz
RUN mv -v mira-* mira

WORKDIR /mira
RUN pip install --no-cache-dir -e .[sbml,biomodels]

# Install taskrunner
WORKDIR /
COPY ./packages/taskrunner/setup.py /taskrunner/setup.py
COPY ./packages/taskrunner/taskrunner.py /taskrunner/taskrunner.py

WORKDIR /taskrunner
RUN pip install -e .
RUN pip install --no-cache-dir -e .

# Install Mira tasks
COPY ./packages/mira /mira_task

WORKDIR /mira_task
RUN pip install -e .
RUN pip install --no-cache-dir -e .

WORKDIR /

CMD ["java", "-jar", "taskrunner.jar"]
1 change: 1 addition & 0 deletions packages/mira/mira-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7f7dc2a9f811b20bdcfd30a4b5209bb8cc7368b6

0 comments on commit fed8a88

Please sign in to comment.