Skip to content

Commit

Permalink
Add Intel-optimized pip package and Dockerfile (rlworkgroup#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjulian authored May 28, 2019
1 parent 8b1bac8 commit fda8d70
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 1 deletion.
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ build-nvidia: docker/docker-compose-nvidia.yml
build \
${ADD_ARGS}

build-intel: TAG ?= rlworkgroup/garage-intel:latest
build-intel: docker/docker-compose-intel.yml
TAG=${TAG} \
docker-compose \
-f docker/docker-compose-intel.yml \
build \
${ADD_ARGS}

run-ci: ## Run the CI Docker container (only used in TravisCI)
run-ci: TAG ?= rlworkgroup/garage-ci
run-ci:
Expand Down Expand Up @@ -108,6 +116,22 @@ run-nvidia: build-nvidia
${ADD_ARGS} \
rlworkgroup/garage-nvidia $(RUN_CMD)

run-intel: ## Run the Docker container for machines with Intel CPUs
run-intel: CONTAINER_NAME ?= garage-intel
run-intel: build-intel
xhost +local:docker
docker run \
-it \
--rm \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $(DATA_PATH)/$(CONTAINER_NAME):/root/code/garage/data \
-e DISPLAY=$(DISPLAY) \
-e QT_X11_NO_MITSHM=1 \
-e MJKEY="$$(cat $(MJKEY_PATH))" \
--name $(CONTAINER_NAME) \
${ADD_ARGS} \
rlworkgroup/garage-intel $(RUN_CMD)


# Help target
# See https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
Expand Down
8 changes: 8 additions & 0 deletions docker/Dockerfile.intel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ARG PARENT_IMAGE=rlworkgroup/garage-base
FROM $PARENT_IMAGE

WORKDIR /root/code/garage
RUN ["/bin/bash", "-c", "source activate garage && pip install -e .[intel]"]

# Ready, set, go.
ENTRYPOINT ["docker/entrypoint-runtime.sh"]
2 changes: 1 addition & 1 deletion docker/Dockerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ ARG PARENT_IMAGE=rlworkgroup/garage-base
FROM $PARENT_IMAGE

# Ready, set, go.
ENTRYPOINT ["docker/entrypoint-nvidia.sh"]
ENTRYPOINT ["docker/entrypoint-runtime.sh"]
27 changes: 27 additions & 0 deletions docker/docker-compose-intel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '2.2'
services:
garage-base:
build:
cache_from:
- rlworkgroup/garage-intel:latest
context: ../
dockerfile: docker/Dockerfile.base
image: rlworkgroup/garage-base
garage-intel-no-files:
build:
cache_from:
- rlworkgroup/garage-intel:latest
context: ../
dockerfile: docker/Dockerfile.intel
args:
- PARENT_IMAGE=rlworkgroup/garage-base
image: rlworkgroup/garage-intel-no-files
garage-intel:
build:
cache_from:
- rlworkgroup/garage-intel:latest
context: ../
dockerfile: docker/Dockerfile.runtime
args:
- PARENT_IMAGE=rlworkgroup/garage-intel-no-files
image: ${TAG}
File renamed without changes.
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
extras = {}
extras['all'] = list(set(sum(extras.values(), [])))

# Intel dependencies not included in all
extras['intel'] = ['intel-tensorflow<1.13,>=1.12.0']

# Development dependencies (*not* included in "all")
extras['dev'] = [
# Please keep alphabetized
Expand Down

0 comments on commit fda8d70

Please sign in to comment.