Skip to content

Commit

Permalink
Merge pull request #19 from elephant-track/v0.4.x
Browse files Browse the repository at this point in the history
ELEPHANT server v0.4.2-> v0.4.3
  • Loading branch information
ksugar authored Oct 19, 2022
2 parents eba45f7 + 58a002e commit 9bb9dc7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Dockerfile-test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM elephant-server:0.4.2
FROM elephant-server:0.4.3

LABEL maintainer="Ko Sugawara <[email protected]>"

Expand Down
21 changes: 15 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ help:

ELEPHANT_GPU?=all
ELEPHANT_WORKSPACE?=${PWD}/workspace
ELEPHANT_IMAGE_NAME?=elephant-server:0.4.2
ELEPHANT_IMAGE_NAME?=elephant-server:0.4.3
ELEPHANT_NVIDIA_GID?=$$(ls -n /dev/nvidia0 2>/dev/null | awk '{print $$4}')
ELEPHANT_DOCKER?=docker

Expand All @@ -26,20 +26,29 @@ stop:
fi

warmup:
$(ELEPHANT_DOCKER) run -it --rm --gpus all $(ELEPHANT_IMAGE_NAME) echo "warming up..."
$(eval GPU_ARG:=$(shell \
if [ -n "$(ELEPHANT_NVIDIA_GID)" ] && [ -n "$(ELEPHANT_GPU)" ]; then \
VAR=$$(echo --gpus '"device=$(ELEPHANT_GPU)"'); \
fi;\
echo $$VAR))
@if [ -n "$(GPU_ARG)" ]; then \
$(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) $(ELEPHANT_IMAGE_NAME) echo "warming up GPU..."; \
else \
echo "CPU mode..."; \
fi

launch: warmup
$(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace -p 8080:80 -p 5672:5672 \
$(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace -p 8080:80 -p 5672:5672 \
-e LOCAL_UID=$(shell id -u) -e LOCAL_GID=$(shell id -g) -e NVIDIA_GID=$(ELEPHANT_NVIDIA_GID) \
$(ELEPHANT_IMAGE_NAME)

bash: warmup
$(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \
$(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \
-e LOCAL_UID=$(shell id -u) -e LOCAL_GID=$(shell id -g) -e AS_LOCAL_USER=1 -e NVIDIA_GID=$(ELEPHANT_NVIDIA_GID) \
$(ELEPHANT_IMAGE_NAME) /bin/bash

bashroot:
$(ELEPHANT_DOCKER) run -it --rm --gpus '"device=$(ELEPHANT_GPU)"' --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \
bashroot: warmup
$(ELEPHANT_DOCKER) run -it --rm $(GPU_ARG) --shm-size=8g -v $(ELEPHANT_WORKSPACE):/workspace \
$(ELEPHANT_IMAGE_NAME) /bin/bash

test:
Expand Down
2 changes: 1 addition & 1 deletion elephant-core/elephant/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
# ==============================================================================
"""Version definition."""

__version__ = '0.4.2'
__version__ = '0.4.3'
2 changes: 1 addition & 1 deletion elephant_server.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"id": "CpJPKG_ATv39"
},
"source": [
"%env ELEPHANT_SERVER_VERSION = v0.4.2"
"%env ELEPHANT_SERVER_VERSION = v0.4.3"
],
"execution_count": null,
"outputs": []
Expand Down

0 comments on commit 9bb9dc7

Please sign in to comment.