-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added jobbergate-composed subproject to demonstrate stand-alone Jobbe…
…rgate
- Loading branch information
1 parent
55b995d
commit e87c69d
Showing
41 changed files
with
3,636 additions
and
236 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from jobbergate_cli.subapps.applications.application_base import JobbergateApplicationBase | ||
from jobbergate_cli.subapps.applications.questions import Text, Integer | ||
|
||
class JobbergateApplication(JobbergateApplicationBase): | ||
def mainflow(self, *_, **__): | ||
questions = [] | ||
|
||
questions.append(Text( | ||
"partition", | ||
message="Choose a partition", | ||
default="compute" | ||
)) | ||
questions.append(Integer( | ||
"nodes", | ||
message="Choose number of nodes for job", | ||
default=2, | ||
minval=1, | ||
)) | ||
questions.append(Integer( | ||
"ntasks", | ||
message="Choose number of tasks per node for job", | ||
default=6, | ||
minval=1, | ||
)) | ||
return questions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
jobbergate_config: | ||
default_template: job-script-template.py.j2 | ||
output_directory: . | ||
application_config: | ||
partition: compute | ||
nodes: 2 | ||
ntasks: 1 |
80 changes: 80 additions & 0 deletions
80
examples/motorbike-application/templates/job-script-template.py.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
#!/bin/bash | ||
#SBATCH --partition {{ data.partition }} | ||
#SBATCH --nodes={{ data.nodes }} | ||
#SBATCH --ntasks={{ data.ntasks }} | ||
#SBATCH -J motorbike | ||
#SBATCH --output=/nfs/R-%x.%j.out | ||
#SBATCH --error=/nfs/R-%x.%j.err | ||
#SBATCH -t 1:00:00 | ||
|
||
# clone OpenFOAM-10 if it is not available yet | ||
OPENFOAM_DIR=/nfs/OpenFOAM-10 | ||
if [[ ! -d $OPENFOAM_DIR ]] | ||
then | ||
echo "Cloning OpenFOAM-10" | ||
cd /nfs | ||
git clone https://github.com/OpenFOAM/OpenFOAM-10.git | ||
else | ||
echo "Skipping clone process...we already have the OpenFOAM-10 source code" | ||
fi | ||
|
||
# create a working folder inside the shared directory | ||
WORK_DIR=/nfs/$SLURM_JOB_NAME-Job-$SLURM_JOB_ID | ||
mkdir -p $WORK_DIR | ||
cd $WORK_DIR | ||
|
||
# path to the openfoam singularity image | ||
export SINGULARITY_IMAGE=/nfs/openfoam10.sif | ||
|
||
# download the openfoam v10 singularity image if it is not available yet | ||
if [[ ! -f $SINGULARITY_IMAGE ]] | ||
then | ||
echo "Fetching the singularity image for OpenFOAM-10" | ||
curl -o $SINGULARITY_IMAGE --location "https://omnivector-public-assets.s3.us-west-2.amazonaws.com/singularity/openfoam10.sif" | ||
else | ||
echo "Skipping the image fetch process...we already have the singularity image" | ||
fi | ||
|
||
|
||
# copy motorBike folder | ||
cp -r $OPENFOAM_DIR/tutorials/incompressible/simpleFoam/motorBike . | ||
|
||
# enter motorBike folder | ||
cd motorBike | ||
|
||
# clear any previous execution | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE ./Allclean | ||
|
||
# copy motorBike geometry obj | ||
cp $OPENFOAM_DIR/tutorials/resources/geometry/motorBike.obj.gz constant/geometry/ | ||
|
||
# define surface features inside the block mesh | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE surfaceFeatures | ||
|
||
# generate the first mesh | ||
# mesh the environment (block around the model) | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE blockMesh | ||
|
||
# decomposition of mesh and initial field data | ||
# according to the parameters in decomposeParDict located in the system | ||
# create 6 domains by default | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE decomposePar -copyZero | ||
|
||
# mesh the motorcicle | ||
# overwrite the new mesh files that are generated | ||
srun singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE snappyHexMesh -overwrite -parallel | ||
|
||
# write field and boundary condition info for each patch | ||
srun singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE patchSummary -parallel | ||
|
||
# potential flow solver | ||
# solves the velocity potential to calculate the volumetric face-flux field | ||
srun singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE potentialFoam -parallel | ||
|
||
# steady-state solver for incompressible turbutent flows | ||
srun singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE simpleFoam -parallel | ||
|
||
# after a case has been run in parallel | ||
# it can be reconstructed for post-processing | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE reconstructParMesh -constant | ||
singularity exec --bind $PWD:$HOME $SINGULARITY_IMAGE reconstructPar -latestTime |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/python3 | ||
|
||
#SBATCH -J dummy_job | ||
#SBATCH -t 60 | ||
|
||
print("Executing dummy job script") | ||
with open("dummy-ouput.txt", mode="w") as dump_file: | ||
print("I am a very, very dumb job script", file=dump_file) | ||
print("foo={{ data['foo'] }}", file=dump_file) | ||
print("bar={{ data['bar'] }}", file=dump_file) | ||
print("baz={{ data['baz'] }}", file=dump_file) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,19 @@ | ||
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.8-slim | ||
FROM python:3.8-slim-buster | ||
|
||
RUN apt-get -y update | ||
RUN apt-get install -y --fix-missing build-essential cmake libpq-dev curl | ||
RUN apt update && apt install -y curl libpq-dev gcc | ||
|
||
RUN pip install 'poetry==1.1.7' | ||
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python && \ | ||
cd /usr/local/bin && \ | ||
ln -s /opt/poetry/bin/poetry && \ | ||
poetry config virtualenvs.create false | ||
|
||
ENV MODULE_NAME="jobbergate_api.main" | ||
|
||
COPY ./pyproject.toml /app/ | ||
COPY ./poetry.lock /app/ | ||
COPY ./dev_tools/entrypoint.sh /app/ | ||
RUN chmod +x /app/entrypoint.sh | ||
|
||
ARG AWS_ACCESS_KEY_ID | ||
ENV AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID | ||
|
||
ARG AWS_SECRET_ACCESS_KEY | ||
ENV AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY | ||
|
||
RUN poetry config virtualenvs.create false --local | ||
RUN poetry install | ||
COPY ./pyproject.toml ./poetry.lock* ./README* ./LICENSE* /app/ | ||
WORKDIR /app | ||
RUN poetry install --no-root | ||
|
||
VOLUME /app/jobbergate_api | ||
VOLUME /app/dev_tools | ||
VOLUME /app/alembic | ||
|
||
ENTRYPOINT /app/entrypoint.sh | ||
ENTRYPOINT /app/dev_tools/entrypoint.sh | ||
#CMD ["uvicorn", "jobbergate_api.main:app", "--host", "0.0.0.0", "--port", "80"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
cd /app | ||
poetry run dev-tools db upgrade | ||
poetry run dev-tools dev-server --port=8000 | ||
|
||
tail -f /dev/null | ||
poetry run dev-tools dev-server --port=80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.