Skip to content

Commit

Permalink
Change references to "docker" to "container"
Browse files Browse the repository at this point in the history
  • Loading branch information
bbfrederick committed Dec 30, 2024
1 parent 0b8df9b commit 08eb4f7
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ USER rapidtide
# set up variable for non-interactive shell
ENV PATH=/opt/miniforge3/envs/science/bin:/opt/miniforge3/condabin:.:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

ENV IN_DOCKER_CONTAINER=1
ENV RUNNING_IN_CONTAINER=1

WORKDIR /tmp/
ENTRYPOINT ["/cloud/mount-and-run"]
Expand Down
8 changes: 4 additions & 4 deletions rapidtide/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,13 +464,13 @@ def version():
"""
try:
dummy = os.environ["IN_DOCKER_CONTAINER"]
dummy = os.environ["RUNNING_IN_CONTAINER"]
except KeyError:
isdocker = False
iscontainer = False
else:
isdocker = True
iscontainer = True

if isdocker:
if iscontainer:
try:
theversion = os.environ["GITVERSION"]
if theversion.find("+") < 0:
Expand Down
12 changes: 6 additions & 6 deletions rapidtide/workflows/happy.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def happy_main(argparsingfunc):
# create the canary file
Path(f"{outputroot}_ISRUNNING.txt").touch()

# if we are running in a Docker container, make sure we enforce memory limits properly
# if we are running in a container, make sure we enforce memory limits properly
try:
testval = os.environ["IN_DOCKER_CONTAINER"]
testval = os.environ["RUNNING_IN_CONTAINER"]
except KeyError:
args.runningindocker = False
args.runningincontainer = False
else:
args.runningindocker = True
args.dockermemfree, args.dockermemswap = tide_util.findavailablemem()
tide_util.setmemlimit(args.dockermemfree)
args.runningincontainer = True
args.containermemfree, args.containermemswap = tide_util.findavailablemem()
tide_util.setmemlimit(args.containermemfree)

# Set up loggers for workflow
setup_logger(
Expand Down
14 changes: 7 additions & 7 deletions rapidtide/workflows/rapidtide.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,14 +269,14 @@ def rapidtide_main(argparsingfunc):
gc.enable()
print("turning on garbage collection")

# if we are running in a Docker container, make sure we enforce memory limits properly
if "IN_DOCKER_CONTAINER" in os.environ:
optiondict["runningindocker"] = True
optiondict["dockermemfree"], optiondict["dockermemswap"] = tide_util.findavailablemem()
if optiondict["dockermemfix"]:
tide_util.setmemlimit(optiondict["dockermemfree"])
# if we are running in a container, make sure we enforce memory limits properly
if "RUNNING_IN_CONTAINER" in os.environ:
optiondict["runningincontainer"] = True
optiondict["containermemfree"], optiondict["containermemswap"] = tide_util.findavailablemem()
if optiondict["containermemfix"]:
tide_util.setmemlimit(optiondict["containermemfree"])
else:
optiondict["runningindocker"] = False
optiondict["runningincontainer"] = False

# write out the current version of the run options
optiondict["currentstage"] = "init"
Expand Down
6 changes: 3 additions & 3 deletions rapidtide/workflows/rapidtide_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1667,10 +1667,10 @@ def _get_parser():
default=False,
)
debugging.add_argument(
"--disabledockermemfix",
dest="dockermemfix",
"--disablecontainermemfix",
dest="containermemfix",
action="store_false",
help=("Disable docker memory limit setting."),
help=("Disable container memory limit setting."),
default=True,
)
debugging.add_argument(
Expand Down

0 comments on commit 08eb4f7

Please sign in to comment.