Skip to content

Commit

Permalink
-ignis-export and ignis-export scripts for copying IgnisHPC out of co…
Browse files Browse the repository at this point in the history
…ntainer

-ignis-submit can now run outside of the submitter container
-future implementation of udocker has been dropper from slurm
-new slurm dockerfile to extract ignis-slurm from a container
-docker scheduler important fixes
  • Loading branch information
cesarpomar committed Jun 22, 2022
1 parent 33ac561 commit 0d2c4d8
Show file tree
Hide file tree
Showing 19 changed files with 174 additions and 100 deletions.
8 changes: 6 additions & 2 deletions Dockerfiles/driver-builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \

ENV GRADLE_VERSION=7.2
RUN \
mkdir -p /tmp/gradle && \
mkdir -p /tmp/gradle && \
cd /tmp/gradle && \
wget https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip -O src.zip && \
unzip src && \
Expand All @@ -38,4 +38,8 @@ RUN mkdir ${IGNIS_HOME}/lib/java && \
rm -fr /tmp/backend

COPY ${RELPATH}driver-install.sh ${IGNIS_HOME}/common
RUN chmod +x ${IGNIS_HOME}/common/driver-install.sh
COPY ${RELPATH}ignis-export ${IGNIS_HOME}/bin
COPY ${RELPATH}ignis-export-all ${IGNIS_HOME}/bin
RUN chmod +x ${IGNIS_HOME}/common/driver-install.sh && \
chmod +x ${IGNIS_HOME}/bin/ignis-export && \
chmod +x ${IGNIS_HOME}/bin/ignis-export-all
13 changes: 13 additions & 0 deletions Dockerfiles/driver-builder/ignis-export
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

if [ $# -ne 1 ]
then echo "usage ignis-export <out-folder>"
exit
fi

cd "$1"
mkdir -p ignis/lib
cp -R ${IGNIS_HOME}/bin ignis/
cp -R ${IGNIS_HOME}/etc ignis/
cp -R ${IGNIS_HOME}/backend ignis/
cp -R ${IGNIS_HOME}/lib/java ignis/lib/
10 changes: 10 additions & 0 deletions Dockerfiles/driver-builder/ignis-export-all
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

if [ $# -ne 1 ]
then echo "usage ignis-export-all <out-folder>"
exit
fi

cd "$1"
mkdir -p ignis
cp -R ${IGNIS_HOME}/* ignis/
9 changes: 9 additions & 0 deletions Dockerfiles/slurm-submitter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

ARG REGISTRY=""
ARG NAMESPACE="ignishpc/"
ARG TAG=""
FROM ${REGISTRY}${NAMESPACE}common${TAG}
ARG RELPATH=""

COPY ${RELPATH}ignis-slurm ${IGNIS_HOME}/bin
RUN chmod +x ${IGNIS_HOME}/bin/ignis-slurm
7 changes: 7 additions & 0 deletions Dockerfiles/slurm-submitter/ignis-slurm
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
#script is inside IGNIS_HOME so if it is not set, we can discover it.
if [[ -z "${IGNIS_HOME}" ]]; then
export IGNIS_HOME=$(builtin cd $(dirname "$0"); cd ..; pwd)
fi

exec ${IGNIS_HOME}/backend/jre/bin/java -cp "${IGNIS_HOME}/lib/java/*" org.ignis.submitter.SlurmSubmit "$@"
3 changes: 1 addition & 2 deletions Dockerfiles/submitter/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@ ARG RELPATH=""

RUN ${IGNIS_HOME}/common/driver-install.sh && \
rm -fR ${IGNIS_HOME}/common && \
rm -f ${IGNIS_HOME}/bin/* && \
export DEBIAN_FRONTEND=noninteractive && \
apt update && \
apt install -y --no-install-recommends \
git \
wget \
unzip \
unzip \
python3 \
python3-distutils && \
rm -rf /var/lib/apt/lists/* && \
Expand Down
5 changes: 5 additions & 0 deletions Dockerfiles/submitter/ignis-submit
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
#!/bin/bash
#script is inside IGNIS_HOME so if it is not set, we can discover it.
if [[ -z "${IGNIS_HOME}" ]]; then
export IGNIS_HOME=$(builtin cd $(dirname "$0"); cd ..; pwd)
fi

exec ${IGNIS_HOME}/backend/jre/bin/java -cp "${IGNIS_HOME}/lib/java/*" org.ignis.submitter.Submit "$@"
3 changes: 3 additions & 0 deletions backend/src/main/java/org/ignis/backend/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public static void main(String[] args) {

LOGGER.info("Loading environment variables");
props.fromEnv(System.getenv());
String home = props.getString(IKeys.HOME);

if (props.contains(IKeys.OPTIONS)) {//Submit user options
try {
Expand All @@ -57,6 +58,8 @@ public static void main(String[] args) {
}
props.rmProperty(IKeys.OPTIONS);
}
//Submitter home may be different so we ignore it.
props.setProperty(IKeys.HOME, home);

LOGGER.info("Loading configuration file");
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@
import org.ignis.rpc.executor.*;
import org.ignis.scheduler.model.IPort;

import java.util.*;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;

/**
* @author César Pomar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void run(ITaskContext context) throws IgnisException {
try {
scheduler.destroyExecutorInstances(stopped);
} catch (ISchedulerException ex) {
LOGGER.warn(log() + ex);
}
} else {
for (int i = 0; i < stoppedIndex.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void run(ITaskContext context) throws IgnisException {
"; do sleep 1; done\" || kill -9 " + executor.getPid();
executor.getContainer().getTunnel().execute(killScript, false);
} catch (IgnisException ex) {
LOGGER.warn(log() + ex.toString());
LOGGER.warn(log() + ex);
}
executor.setPid(-1);
LOGGER.info(log() + "Executor destroyed");
Expand Down
2 changes: 1 addition & 1 deletion etc/ignis.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ignis.debug=false
#ignis.job.worker=
#DFS
#ignis.dfs.id=
#ignis.dfs.home=
ignis.dfs.home=/media/dfs
#SCHEDULER
#ignis.scheduler.url=
#ignis.scheduler.type=
Expand Down
Loading

0 comments on commit 0d2c4d8

Please sign in to comment.