1
0
mirror of https://github.com/gryf/coach.git synced 2026-01-27 18:45:45 +01:00

create per environment Dockerfiles. (#70)

* create per environment Dockerfiles.

Adjust CI setup to better parallelize runs.
Fix a couple of issues in golden and trace tests.
Update a few of the docs.

* bugfix in mmc agent.

Also install kubectl for CI, update badge branch.

* remove integration test parallelism.
This commit is contained in:
Scott Leishman
2018-11-14 07:40:22 -08:00
committed by GitHub
parent a849c17e46
commit 524f8436a2
20 changed files with 448 additions and 139 deletions

View File

@@ -1,8 +1,7 @@
# REGISTRY=nervana-dockrepo01.fm.intel.com:5001/
# REGISTRY=gcr.io/
REGISTRY=docker.io/
IMAGE=zdwiel/coach
# IMAGE=gcr.io/deep-greens/inference:v5
# REGISTRY=gcr.io
REGISTRY=docker.io
ORGANIZATION=nervana
IMAGE=coach
BUILD_ARGUMENTS=
RUN_ARGUMENTS=
@@ -15,15 +14,23 @@ ifdef https_proxy
BUILD_ARGUMENTS+=--build-arg https_proxy=$(https_proxy)
RUN_ARGUMENTS+=--env https_proxy=$(https_proxy)
endif
ifdef MUJOCO_KEY
BUILD_ARGUMENTS+=--build-arg MUJOCO_KEY=$(MUJOCO_KEY)
endif
RUN_ARGUMENTS+=--rm
RUN_ARGUMENTS+=--net host
RUN_ARGUMENTS+=-v /tmp/checkpoint:/checkpoint
UNIT_TESTS=python3 -m pytest rl_coach/tests -m unit_test
INTEGRATION_TESTS=python3 -m pytest rl_coach/tests -m integration_test -n auto --tb=short
GOLDEN_TESTS=python3 -m pytest rl_coach/tests -m golden_test -n auto
TRACE_TESTS=python3 rl_coach/tests/trace_tests.py -prl
INTEGRATION_TESTS=python3 -m pytest rl_coach/tests -m integration_test --tb=short
ifdef PRESETS
PRESETS := -p $(PRESETS)
else
PRESETS :=
endif
GOLDEN_TESTS=python3 rl_coach/tests/test_golden.py ${PRESETS}
TRACE_TESTS=python3 rl_coach/tests/trace_tests.py -prl ${PRESETS}
CONTEXT = $(realpath ..)
@@ -31,7 +38,10 @@ ifndef DOCKER
DOCKER = docker
endif
build:
build_base:
${DOCKER} build -f=Dockerfile.base -t=${IMAGE}-base:master ${BUILD_ARGUMENTS} ${CONTEXT}
build: build_base
${DOCKER} build -f=Dockerfile -t=${IMAGE} ${BUILD_ARGUMENTS} ${CONTEXT}
mkdir -p /tmp/checkpoint
rm -rf /tmp/checkpoint/*
@@ -40,13 +50,13 @@ shell: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} /bin/bash
unit_tests: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${UNIT_TESTS} -n 8
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${UNIT_TESTS}
integration_tests: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${INTEGRATION_TESTS}
golden_tests: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${GOLDEN_TESTS}
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${GOLDEN_TESTS} ${PRESETS}
trace_tests: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} ${TRACE_TESTS}
@@ -61,7 +71,7 @@ run_rollout_worker: build
${DOCKER} run ${RUN_ARGUMENTS} -it ${IMAGE} python3 rl_coach/rollout_worker.py --preset CartPole_DQN_distributed
bootstrap_kubernetes: build push
kubectl run -i --tty --attach --image=${REGISTRY}${IMAGE} --restart=Never distributed-coach -- python3 rl_coach/orchestrators/start_training.py --preset CartPole_DQN_distributed --image ${IMAGE} -ns 10.63.249.182 -np /
kubectl run -i --tty --attach --image=${REGISTRY}/${IMAGE} --restart=Never distributed-coach -- python3 rl_coach/orchestrators/start_training.py --preset CartPole_DQN_distributed --image ${IMAGE} -ns 10.63.249.182 -np /
stop_kubernetes:
kubectl delete service --ignore-not-found redis-service
@@ -75,8 +85,8 @@ kubernetes: stop_kubernetes
python3 ${CONTEXT}/rl_coach/orchestrators/start_training.py --preset CartPole_DQN_distributed --image ${IMAGE} -ns 10.63.249.182 -np /
push: build
${DOCKER} tag ${IMAGE} ${REGISTRY}${IMAGE}
${DOCKER} push ${REGISTRY}${IMAGE}
${DOCKER} tag ${IMAGE} ${REGISTRY}/${ORGANIZATION}/${IMAGE}
${DOCKER} push ${REGISTRY}/${ORGANIZATION}/${IMAGE}
unit_tests_without_docker:
cd .. && ${UNIT_TESTS}