openworm / org.geppetto

Geppetto is an open-source platform to build web-based applications to visualize and simulate neuroscience data and models.
http://geppetto.org
Other
209 stars 50 forks source link

Refactor dockerimage files #628

Closed rodriguez-facundo closed 4 years ago

rodriguez-facundo commented 4 years ago

Docker images should be refactored. Currently, containers are 3+ Gb in size which takes long time to pull into kubernetes and reduces node disk space, increasing response time.

Refactor would look somewhat like 👇

# org.geppetto/utilities/docker/geppetto/Dockerfile
FROM metacell/java-virgo-maven:development as build-geppetto
# { ... }

FROM  metacell/java-virgo-maven:development
COPY --from=build-geppetto /${SERVER_HOME}/repository/usr/*.war  /${SERVER_HOME}/repository/usr/*.war

And we have to remove this from https://github.com/MetaCell/java-virgo-maven/blob/development/Dockerfile

# Pre download Maven packages to speed up Geppetto builds
ENV \
  VERSION=development \
  GEPPETTO=https://github.com/openworm/org.geppetto.git \
  MODEL=https://github.com/openworm/org.geppetto.model.git \
  CORE=https://github.com/openworm/org.geppetto.core.git \
  NEUROML=https://github.com/openworm/org.geppetto.model.neuroml.git \
  SIM=https://github.com/openworm/org.geppetto.simulation.git \
  FRONTEND=https://github.com/openworm/org.geppetto.frontend.git \
  APP=https://github.com/openworm/geppetto-application.git \
  CLIENT=https://github.com/openworm/geppetto-client.git

RUN mkdir /tmp/delete
WORKDIR /tmp/delete

RUN \
  for i in ${GEPPETTO} ${MODEL} ${CORE} ${NEUROML} ${SIM} ${FRONTEND} ;\
  do \
    git clone -b ${VERSION} $i ;\
  done &&\
  cd org.geppetto.frontend/src/main &&\
  git clone -b ${VERSION} ${APP} webapp &&\
  cd webapp &&\
  git clone -b ${VERSION} ${CLIENT} &&\
  cd ../../../../org.geppetto &&\
  mvn -Dhttps.protocols=TLSv1.2 -Dmaven.test.skip install &&\
  cd ${HOME} &&\
  rm -rf /tmp/delete

We could also look deeper into https://github.com/MetaCell/java-virgo-maven/blob/development/Dockerfile and check what is actually needed inside there to run the geppetto server ones we have the war files and remove all the rest.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.