Skip to content

Commit 797a57a

Browse files
Merge branch 'develop' into release-v0.6
2 parents 42a2214 + 3690cd3 commit 797a57a

File tree

5 files changed

+34
-15
lines changed

5 files changed

+34
-15
lines changed

docs/Installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The `gym-unity` subdirectory contains a package to interface with OpenAI Gym.
4343
### Install Python and mlagents Package
4444

4545
In order to use ML-Agents toolkit, you need Python 3.6 along with the
46-
dependencies listed in the [requirements file](../ml-agents/requirements.txt).
46+
dependencies listed in the [setup.py file](../ml-agents/setup.py).
4747
Some of the primary dependencies include:
4848

4949
- [TensorFlow](Background-TensorFlow.md)

docs/Migrating.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ using the search bar of the `Hierarchy` window with the word `Agent`.
4141
`LearningBrain` ScriptableObjects used in your scene into entries
4242
into this list.
4343

44-
4544
## Migrating from ML-Agents toolkit v0.4 to v0.5
4645

4746
### Important

ml-agents/mlagents/trainers/trainer_controller.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"""Launches trainers for each External Brains in a Unity Environment."""
44

55
import os
6+
import glob
67
import logging
8+
import shutil
79

810
import yaml
911
import re
@@ -71,8 +73,16 @@ def __init__(self, env_path, run_id, save_freq, curriculum_folder,
7173
docker_target_name=docker_target_name,
7274
run_id=run_id)
7375
if env_path is not None:
74-
env_path = '/{docker_target_name}/{env_name}'.format(
75-
docker_target_name=docker_target_name, env_name=env_path)
76+
"""
77+
Comments for future maintenance:
78+
Some OS/VM instances (e.g. COS GCP Image) mount filesystems
79+
with COS flag which prevents execution of the Unity scene,
80+
to get around this, we will copy the executable into the
81+
container.
82+
"""
83+
# Navigate in docker path and find env_path and copy it.
84+
env_path = self._prepare_for_docker_run(docker_target_name,
85+
env_path)
7686
if curriculum_folder is not None:
7787
self.curriculum_folder = \
7888
'/{docker_target_name}/{curriculum_folder}'.format(
@@ -124,6 +134,26 @@ def __init__(self, env_path, run_id, save_freq, curriculum_folder,
124134
'name as the Brain '
125135
'whose curriculum it defines.')
126136

137+
def _prepare_for_docker_run(self, docker_target_name, env_path):
138+
for f in glob.glob('/{docker_target_name}/*'.format(
139+
docker_target_name=docker_target_name)):
140+
if env_path in f:
141+
try:
142+
b = os.path.basename(f)
143+
if os.path.isdir(f):
144+
shutil.copytree(f,
145+
'/ml-agents/{b}'.format(b=b))
146+
else:
147+
src_f = '/{docker_target_name}/{b}'.format(
148+
docker_target_name=docker_target_name, b=b)
149+
dst_f = '/ml-agents/{b}'.format(b=b)
150+
shutil.copyfile(src_f, dst_f)
151+
os.chmod(dst_f, 0o775) # Make executable
152+
except Exception as e:
153+
self.logger.info(e)
154+
env_path = '/ml-agents/{env_name}'.format(env_name=env_path)
155+
return env_path
156+
127157
def _get_measure_vals(self):
128158
if self.meta_curriculum:
129159
brain_names_to_measure_vals = {}

ml-agents/requirements.txt

Lines changed: 0 additions & 10 deletions
This file was deleted.

ml-agents/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
'matplotlib',
3434
'numpy>=1.13.3,<=1.14.5',
3535
'jupyter',
36-
'pytest>=3.2.2',
36+
'pytest>=3.2.2,<4.0.0',
3737
'docopt',
3838
'pyyaml',
3939
'protobuf>=3.6,<3.7',

0 commit comments

Comments
 (0)