Skip to content

Commit

Permalink
more unhelpful changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Levitas committed Jan 30, 2024
1 parent 713d65d commit e14dce4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 34 deletions.
56 changes: 28 additions & 28 deletions dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
# # 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
7 changes: 5 additions & 2 deletions mongodb/Singularity
Original file line number Diff line number Diff line change
@@ -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 "$@"
4 changes: 0 additions & 4 deletions singularity-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ instances:
# post:
# command:
# - "mongod --dbpath /tmp"
# # command: ["mongod --dbpath /tmp"]

# mongodb: # NEW BUT STILL BAD
# container_name: brainlife_ezbids-mongodb
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e14dce4

Please sign in to comment.