From e14dce4a3b70c533cd93634755ab94f339277074 Mon Sep 17 00:00:00 2001 From: Dan Levitas Date: Tue, 30 Jan 2024 20:26:14 +0000 Subject: [PATCH] more unhelpful changes --- dev.sh | 56 ++++++++++++++++++++--------------------- mongodb/Singularity | 7 ++++-- singularity-compose.yml | 4 --- 3 files changed, 33 insertions(+), 34 deletions(-) diff --git a/dev.sh b/dev.sh index 64acf8d5..564e4386 100755 --- a/dev.sh +++ b/dev.sh @@ -47,29 +47,29 @@ export SINGULARITY_CACHEDIR=/tmp # chmod -R 770 $PWD/mongodb/data/db # fi -# if [ ! -f $PWD/mongodb/mongodb.sif ]; then # Will eventually be redundant and can remove -# echo "building mongodb" -# # build image -# singularity build \ -# --arch "amd64" \ -# --fakeroot \ -# --disable-cache \ -# $PWD/mongodb/mongodb.sif \ -# $PWD/mongodb/Singularity +if [ ! -f $PWD/mongodb/mongodb.sif ]; then # Will eventually be redundant and can remove + echo "building mongodb" + # build image + singularity build \ + --arch "amd64" \ + --fakeroot \ + --disable-cache \ + $PWD/mongodb/mongodb.sif \ + $PWD/mongodb/Singularity -# # start the container instance -# singularity instance start \ -# --fakeroot \ -# --bind $PWD/mongodb/data/db:/data/db \ -# $PWD/mongodb/mongodb.sif \ -# brainlife_ezbids-mongodb - - -# # --net \ -# # --network-args "portmap=27417:27017/tcp" \ -# # --bind $PWD/data/db:/data/db \ # Might not need this if mongodb/Singularity contains a %files section -# # singularity run instance://brainlife_ezbids-mongodb # This seems to run mongodb in the foreground, meaning can't move on to building other containers. -# fi + # start the container instance + singularity instance start \ + --fakeroot \ + --bind $PWD/mongodb/data/db:/data/db \ + $PWD/mongodb/mongodb.sif \ + brainlife_ezbids-mongodb + + + # --net \ + # --network-args "portmap=27417:27017/tcp" \ + # --bind $PWD/data/db:/data/db \ # Might not need this if mongodb/Singularity contains a %files section + # singularity run instance://brainlife_ezbids-mongodb # This seems to run mongodb in the foreground, meaning can't move on to building other containers. +fi # if [ ! -f $PWD/api/api.sif ]; then # echo "building api" @@ -93,10 +93,10 @@ export SINGULARITY_CACHEDIR=/tmp -# Approach #2: singularity-compose +# # Approach #2: singularity-compose -if [ ! -d $PWD/mongodb/data/db ]; then - mkdir -p $PWD/mongodb/data/db - chmod -R 770 $PWD/mongodb/data/db -fi -singularity-compose --debug up --no-resolv \ No newline at end of file +# # if [ ! -d $PWD/mongodb/data/db ]; then +# # mkdir -p $PWD/mongodb/data/db +# # chmod -R 770 $PWD/mongodb/data/db +# # fi +# singularity-compose --debug up --no-resolv \ No newline at end of file diff --git a/mongodb/Singularity b/mongodb/Singularity index 0a830f86..fe89f3ed 100644 --- a/mongodb/Singularity +++ b/mongodb/Singularity @@ -1,13 +1,16 @@ Bootstrap: docker From: mongo:4.4.15 -# %environment -# export HOME=$PWD/data/db +%environment +export HOME=/data/db +export PWD=/ %runscript # mongod --dbpath $PWD/data/db + cd $HOME exec /usr/bin/mongod "$@" %startscript # mongod --dbpath $PWD/data/db + cd $HOME exec /usr/bin/mongod "$@" diff --git a/singularity-compose.yml b/singularity-compose.yml index 091b955e..ba88a9ae 100644 --- a/singularity-compose.yml +++ b/singularity-compose.yml @@ -12,7 +12,6 @@ instances: # post: # command: # - "mongod --dbpath /tmp" - # # command: ["mongod --dbpath /tmp"] # mongodb: # NEW BUT STILL BAD # container_name: brainlife_ezbids-mongodb @@ -54,9 +53,6 @@ instances: # start: # options: # - fakeroot - post: - command: mongod --dbpath /data/db - # command: echo 'db.runCommand("ping").ok' | mongo localhost:27017/test --quiet # run: # background: true # Does this actually run things in the background? Doesn't seem to