浏览代码

Merge branch 'develop' into develop-gpu-test

/develop-gpu-test
Anupam Bhatnagar 5 年前
当前提交
d9910ee7
共有 31 个文件被更改,包括 248 次插入166 次删除
  1. 21
      .circleci/config.yml
  2. 9
      .pre-commit-config.yaml
  3. 34
      .yamato/csharp-tests.yml
  4. 54
      .yamato/standalone-build-test.yml
  5. 4
      UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs
  6. 29
      UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs
  7. 23
      UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab
  8. 5
      UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity
  9. 2
      UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentBasic.cs
  10. 19
      UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception3D.cs
  11. 2
      UnitySDK/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs
  12. 2
      UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs
  13. 2
      UnitySDK/Assets/ML-Agents/Scripts/Academy.cs
  14. 12
      UnitySDK/Assets/ML-Agents/Scripts/Agent.cs
  15. 4
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs
  16. 2
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs
  17. 6
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs
  18. 4
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs
  19. 4
      UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs
  20. 2
      gym-unity/setup.py
  21. 5
      ml-agents-envs/mlagents/envs/environment.py
  22. 6
      ml-agents-envs/mlagents/envs/mock_communicator.py
  23. 11
      ml-agents-envs/mlagents/envs/rpc_communicator.py
  24. 4
      ml-agents-envs/mlagents/envs/subprocess_env_manager.py
  25. 2
      ml-agents-envs/setup.py
  26. 2
      ml-agents/setup.py
  27. 55
      run-standalone-build-osx.sh
  28. 71
      run-tests-editmode-osx-editor.sh
  29. 2
      test_constraints_max_version.txt
  30. 16
      markdown-link-check.fast.json
  31. 0
      /markdown-link-check.full.json

21
.circleci/config.yml


keys:
# Parameterize the cache so that different python versions can get different versions of the packages
- v1-dependencies-py<< parameters.pyversion >>-{{ checksum "python_deps.txt" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-py<< parameters.pyversion >>-
- run:
name: Install Dependencies

markdown_link_check:
parameters:
precommit_command:
type: string
description: precommit hook to run
default: markdown-link-check
docker:
- image: circleci/node:12.6.0
working_directory: ~/repo

name: Run markdown-link-check via precommit
command: |
. venv/bin/activate
pre-commit run --hook-stage manual markdown-link-check --all-files
pre-commit run --hook-stage manual << parameters.precommit_command >> --all-files
protobuf_generation_check:
docker:

only: /[0-9]+(\.[0-9]+)*(\.dev[0-9]+)*/
branches:
ignore: /.*/
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- develop
jobs:
- markdown_link_check:
name: markdown-link-check full
precommit_command: markdown-link-check-full

9
.pre-commit-config.yaml


# markdown-link-check doesn't support multiple files on the commandline, so this hacks around that.
# Note that you must install the package separately via npm. For example:
# brew install npm; npm install -g markdown-link-check
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.config.json' --
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.fast.json' --
stages: [manual]
- id: markdown-link-check-full
name: markdown-link-check-full
entry: bash -xc 'echo "$@" | xargs -n1 -t markdown-link-check -c markdown-link-check.full.json' --
language: system
types: [markdown]
exclude: ".*localized.*"
stages: [manual]
- id: validate-versions
name: validate library versions

34
.yamato/csharp-tests.yml


name: Mac Edit Mode Tests
triggers:
test_editors:
- version: 2017.4
- version: 2018.4
- version: 2019.3
---
{% for editor in test_editors %}
test_mac_editmode_{{ editor.version }}:
name: Test Mac EditMode {{ editor.version }}
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
UNITY_VERSION: {{ editor.version }}
commands:
- ./run-tests-editmode-osx-editor.sh
triggers:
- "/develop-.*/"
- "/develop-.*/"
- "develop"
- "develop"
pull_requests:
- targets:
only:

agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
LC_ALL: "en_US.UTF-8"
commands:
- ./run-tests-editmode-osx-editor.sh
{% endfor %}

54
.yamato/standalone-build-test.yml


name: Mac Standalone Build Test
triggers:
branches:
only:
- "/develop-.*/"
targets:
only:
- "develop"
pull_requests:
- targets:
only:
- "master"
- "/release-.*/"
- "/hotfix-.*/"
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
LC_ALL: "en_US.UTF-8"
commands:
- ./run-standalone-build-osx.sh
test_editors:
- version: 2017.4
- version: 2018.4
- version: 2019.3
---
{% for editor in test_editors %}
test_mac_standalone_{{ editor.version }}:
name: Test Mac Standalone {{ editor.version }}
agent:
type: Unity::VM::osx
image: ml-agents/ml-agents-bokken-mac:stable
flavor: i1.small
variables:
UNITY_VERSION: {{ editor.version }}
commands:
- ./run-standalone-build-osx.sh
triggers:
branches:
only:
- "/develop-.*/"
targets:
only:
- "develop"
pull_requests:
- targets:
only:
- "master"
- "/release-.*/"
- "/hotfix-.*/"
{% endfor %}

4
UnitySDK/Assets/ML-Agents/Editor/Tests/MLAgentsEditModeTest.cs


return null;
}
public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
return CompressionType.None;
return SensorCompressionType.None;
}
public string GetName()

29
UnitySDK/Assets/ML-Agents/Editor/Tests/StandaloneBuildTest.cs


using System;
using UnityEditor;
using UnityEngine;
#if UNITY_2018_1_OR_NEWER
using UnityEditor.Build.Reporting;
#endif
namespace MLAgents
{

{
string[] scenes = { "Assets/ML-Agents/Examples/3DBall/Scenes/3DBall.unity" };
var error = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None);
if (string.IsNullOrEmpty(error))
var buildResult = BuildPipeline.BuildPlayer(scenes, "testPlayer", BuildTarget.StandaloneOSX, BuildOptions.None);
#if UNITY_2018_1_OR_NEWER
var isOK = buildResult.summary.result == BuildResult.Succeeded;
var error = "";
foreach (var stepInfo in buildResult.steps)
{
foreach (var msg in stepInfo.messages)
{
if (msg.type != LogType.Log && msg.type != LogType.Warning)
{
error += msg.content + "\n";
}
}
}
#else
var error = buildResult;
var isOK = string.IsNullOrEmpty(error);
#endif
if (isOK)
{
EditorApplication.Exit(0);
}

EditorApplication.Exit(1);
}
}

23
UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Prefabs/FoodCollectorArea.prefab


vectorObservationSize: 53
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
cameraResolutions: []
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3}

m_Name:
m_EditorClassIdentifier:
agentParameters:
agentCameras: []
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

m_Name:
m_EditorClassIdentifier:
agentParameters:
agentCameras: []
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2}
myLaser: {fileID: 1081721624670010}
myLaser: {fileID: 1617924810425504}
contribute: 0
useVectorObs: 1
--- !u!114 &114192565006091356

m_Name:
m_EditorClassIdentifier:
agentParameters:
agentCameras: []
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2}
myLaser: {fileID: 1081721624670010}
myLaser: {fileID: 1045923826166930}
contribute: 0
useVectorObs: 1
--- !u!114 &114374774605792098

vectorObservationSize: 53
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
cameraResolutions: []
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3}

vectorObservationSize: 53
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
cameraResolutions: []
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3}

m_Name:
m_EditorClassIdentifier:
agentParameters:
agentCameras: []
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2}
myLaser: {fileID: 1081721624670010}
myLaser: {fileID: 1421240237750412}
contribute: 0
useVectorObs: 1
--- !u!114 &114661830999747712

m_Name:
m_EditorClassIdentifier:
agentParameters:
agentCameras: []
agentRenderTextures: []
maxStep: 5000
resetOnDone: 1
onDemandDecision: 0

badMaterial: {fileID: 2100000, guid: 88b9ae7af2c1748a0a1f63407587a601, type: 2}
goodMaterial: {fileID: 2100000, guid: c67450f290f3e4897bc40276a619e78d, type: 2}
frozenMaterial: {fileID: 2100000, guid: 66163cf35956a4be08e801b750c26f33, type: 2}
myLaser: {fileID: 1081721624670010}
myLaser: {fileID: 1941433838307300}
contribute: 0
useVectorObs: 1
--- !u!114 &114762047763154270

vectorObservationSize: 53
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
cameraResolutions: []
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3}

vectorObservationSize: 53
numStackedVectorObservations: 1
vectorActionSize: 03000000030000000300000002000000
cameraResolutions: []
vectorActionDescriptions: []
vectorActionSpaceType: 0
m_Model: {fileID: 11400000, guid: d32fca21cf4c04536ab7f88eb9de83e0, type: 3}

5
UnitySDK/Assets/ML-Agents/Examples/FoodCollector/Scenes/FoodCollector.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.44971162, g: 0.49977726, b: 0.5756362, a: 1}
m_IndirectSpecularColor: {r: 0.4497121, g: 0.4997778, b: 0.5756369, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 4fe57113e76a5426297487dd6faadc5b, type: 3}
m_Name:
m_EditorClassIdentifier:
broadcastHub:
brainsToControl:
- {fileID: 11400000, guid: 9e7865ec29c894c2d8c1617b0fa392f9, type: 2}
m_TrainingConfiguration:
width: 500
height: 500

2
UnitySDK/Assets/ML-Agents/Examples/PushBlock/Scripts/PushAgentBasic.cs


var rayDistance = 12f;
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, m_DetectableObjects));
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, m_DetectableObjects, 1.5f));
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, m_DetectableObjects, 1.5f, 1.5f));
}
}

19
UnitySDK/Assets/ML-Agents/Examples/SharedAssets/Scripts/RayPerception3D.cs


/// </summary>
public class RayPerception3D : RayPerception
{
Vector3 m_EndPosition;
RaycastHit m_Hit;
float[] m_SubList;

// along with object distance.
foreach (var angle in rayAngles)
{
m_EndPosition = transform.TransformDirection(
PolarToCartesian(rayDistance, angle));
m_EndPosition.y = endOffset;
Vector3 startPositionLocal = new Vector3(0, startOffset, 0);
Vector3 endPositionLocal = PolarToCartesian(rayDistance, angle);
endPositionLocal.y += endOffset;
var startPositionWorld = transform.TransformPoint(startPositionLocal);
var endPositionWorld = transform.TransformPoint(endPositionLocal);
var rayDirection = endPositionWorld - startPositionWorld;
Debug.DrawRay(transform.position + new Vector3(0f, startOffset, 0f),
m_EndPosition, Color.black, 0.01f, true);
Debug.DrawRay(startPositionWorld,rayDirection, Color.black, 0.01f, true);
if (Physics.SphereCast(transform.position +
new Vector3(0f, startOffset, 0f), 0.5f,
m_EndPosition, out m_Hit, rayDistance))
if (Physics.SphereCast(startPositionWorld, 0.5f, rayDirection, out m_Hit, rayDistance))
{
for (var i = 0; i < detectableObjects.Length; i++)
{

2
UnitySDK/Assets/ML-Agents/Examples/Soccer/Scripts/AgentSoccer.cs


detectableObjects = m_DetectableObjectsBlue;
}
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, detectableObjects));
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, detectableObjects, 1f));
AddVectorObs(m_RayPer.Perceive(rayDistance, m_RayAngles, detectableObjects, 1f, 1f));
}
public void MoveAgent(float[] act)

2
UnitySDK/Assets/ML-Agents/Examples/WallJump/Scripts/WallJumpAgent.cs


AddVectorObs(m_RayPer.Perceive(
rayDistance, rayAngles, m_DetectableObjects));
AddVectorObs(m_RayPer.Perceive(
rayDistance, rayAngles, m_DetectableObjects, 2.5f, 2.5f));
rayDistance, rayAngles, m_DetectableObjects, 2.5f, 5.0f));
var agentPos = m_AgentRb.position - ground.transform.position;
AddVectorObs(agentPos / 20f);

2
UnitySDK/Assets/ML-Agents/Scripts/Academy.cs


"docs/Learning-Environment-Design-Academy.md")]
public abstract class Academy : MonoBehaviour
{
const string k_ApiVersion = "API-10";
const string k_ApiVersion = "API-11";
/// Temporary storage for global gravity value
/// Used to restore oringal value when deriving Academy modifies it

12
UnitySDK/Assets/ML-Agents/Scripts/Agent.cs


/// of the environment extracts its current observation, sends them to its
/// policy and in return receives an action. In practice,
/// however, an agent need not send its observation at every step since very
/// little may have changed between successive steps.
/// little may have changed between successive steps.
///
/// At any step, an agent may be considered <see cref="m_Done"/>.
/// This could occur due to a variety of reasons:

/// <summary>
/// Updates the Model for the agent. Any model currently assigned to the
/// agent will be replaced with the provided one. If the arguments are
/// agent will be replaced with the provided one. If the arguments are
/// remain unchanged.
/// remain unchanged.
/// <param name="behaviorName"> The identifier of the behavior. This
/// will categorize the agent when training.
/// <param name="behaviorName"> The identifier of the behavior. This
/// will categorize the agent when training.
/// <param name = "inferenceDevice"> Define on what device the model
/// <param name = "inferenceDevice"> Define on what device the model
/// will be run.</param>
public void GiveModel(
string behaviorName,

4
UnitySDK/Assets/ML-Agents/Scripts/Sensor/CameraSensor.cs


}
}
public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
return CompressionType.PNG;
return SensorCompressionType.PNG;
}
/// <summary>

2
UnitySDK/Assets/ML-Agents/Scripts/Sensor/CompressedObservation.cs


/// <summary>
/// The format of the compressed data
/// </summary>
public CompressionType CompressionType;
public SensorCompressionType CompressionType;
/// <summary>
/// The uncompressed dimensions of the data.

6
UnitySDK/Assets/ML-Agents/Scripts/Sensor/ISensor.cs


namespace MLAgents.Sensor
{
public enum CompressionType
public enum SensorCompressionType
{
None,
PNG

byte[] GetCompressedObservation();
/// <summary>
/// Return the compression type being used. If no compression is used, return CompressionType.None
/// Return the compression type being used. If no compression is used, return SensorCompressionType.None
CompressionType GetCompressionType();
SensorCompressionType GetCompressionType();
/// <summary>
/// Get the name of the sensor. This is used to ensure deterministic sorting of the sensors on an Agent,

4
UnitySDK/Assets/ML-Agents/Scripts/Sensor/RenderTextureSensor.cs


}
}
public CompressionType GetCompressionType()
public SensorCompressionType GetCompressionType()
return CompressionType.PNG;
return SensorCompressionType.PNG;
}
/// <summary>

4
UnitySDK/Assets/ML-Agents/Scripts/Sensor/SensorBase.cs


return null;
}
public virtual CompressionType GetCompressionType()
public virtual SensorCompressionType GetCompressionType()
return CompressionType.None;
return SensorCompressionType.None;
}
}
}

2
gym-unity/setup.py


from setuptools import setup, find_packages
from setuptools.command.install import install
VERSION = "0.11.0.dev0"
VERSION = "0.11.0"
class VerifyVersionCommand(install):

5
ml-agents-envs/mlagents/envs/environment.py


SCALAR_ACTION_TYPES = (int, np.int32, np.int64, float, np.float32, np.float64)
SINGLE_BRAIN_ACTION_TYPES = SCALAR_ACTION_TYPES + (list, np.ndarray)
SINGLE_BRAIN_TEXT_TYPES = list
API_VERSION = "API-11"
def __init__(
self,

seed: int = 0,
docker_training: bool = False,
no_graphics: bool = False,
timeout_wait: int = 30,
timeout_wait: int = 60,
args: Optional[List[str]] = None,
):
"""

atexit.register(self._close)
self.port = base_port + worker_id
self._buffer_size = 12000
self._version_ = "API-10"
self._version_ = UnityEnvironment.API_VERSION
self._loaded = (
False
) # If true, this means the environment was successfully loaded

6
ml-agents-envs/mlagents/envs/mock_communicator.py


from .communicator import Communicator
from .environment import UnityEnvironment
from mlagents.envs.communicator_objects.unity_rl_output_pb2 import UnityRLOutputProto
from mlagents.envs.communicator_objects.brain_parameters_pb2 import BrainParametersProto
from mlagents.envs.communicator_objects.unity_rl_initialization_output_pb2 import (

is_training=True,
)
rl_init = UnityRLInitializationOutputProto(
name="RealFakeAcademy", version="API-10", log_path="", brain_parameters=[bp]
name="RealFakeAcademy",
version=UnityEnvironment.API_VERSION,
log_path="",
brain_parameters=[bp],
)
output = UnityRLOutputProto(agentInfos=self._get_agent_infos())
return UnityOutputProto(rl_initialization_output=rl_init, rl_output=output)

11
ml-agents-envs/mlagents/envs/rpc_communicator.py


finally:
s.close()
def initialize(self, inputs: UnityInputProto) -> UnityOutputProto:
def poll_for_timeout(self):
"""
Polls the GRPC parent connection for data, to be used before calling recv. This prevents
us from hanging indefinitely in the case where the environment process has died or was not
launched.
"""
if not self.unity_to_external.parent_conn.poll(self.timeout_wait):
raise UnityTimeOutException(
"The Unity environment took too long to respond. Make sure that :\n"

)
def initialize(self, inputs: UnityInputProto) -> UnityOutputProto:
self.poll_for_timeout()
aca_param = self.unity_to_external.parent_conn.recv().unity_output
message = UnityMessageProto()
message.header.status = 200

message.header.status = 200
message.unity_input.CopyFrom(inputs)
self.unity_to_external.parent_conn.send(message)
self.poll_for_timeout()
output = self.unity_to_external.parent_conn.recv()
if output.header.status != 200:
return None

4
ml-agents-envs/mlagents/envs/subprocess_env_manager.py


import cloudpickle
from mlagents.envs.environment import UnityEnvironment
from mlagents.envs.exception import UnityCommunicationException
from mlagents.envs.exception import UnityCommunicationException, UnityTimeOutException
from multiprocessing import Process, Pipe, Queue
from multiprocessing.connection import Connection
from queue import Empty as EmptyQueueException

_send_response("reset", all_brain_info)
elif cmd.name == "close":
break
except (KeyboardInterrupt, UnityCommunicationException):
except (KeyboardInterrupt, UnityCommunicationException, UnityTimeOutException):
logger.info(f"UnityEnvironment worker {worker_id}: environment stopping.")
step_queue.put(EnvironmentResponse("env_close", worker_id, None))
finally:

2
ml-agents-envs/setup.py


from setuptools import setup
from setuptools.command.install import install
VERSION = "0.11.0.dev0"
VERSION = "0.11.0"
here = os.path.abspath(os.path.dirname(__file__))

2
ml-agents/setup.py


from setuptools import setup, find_namespace_packages
from setuptools.command.install import install
VERSION = "0.11.0.dev0"
VERSION = "0.11.0"
here = os.path.abspath(os.path.dirname(__file__))

55
run-standalone-build-osx.sh


set -eo pipefail
EDITOR_VERSION="2017.4.33f1"
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
if [[ -z "${UNITY_VERSION}" ]]; then
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
echo "Environment Variable UNITY_VERSION was not set"
exit 1
UNITY=${HUB_UNITY}
fi
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
else
UNITY=${HUB_UNITY}
fi
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
echo "Cleaning previous results"
echo "Starting tests via $UNITY"
echo "Cleaning previous results"
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -logfile - -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
echo "Starting tests via $UNITY"
echo "$CMD_LINE ..."
CMD_LINE="$UNITY -projectPath $BASETPATH/UnitySDK -batchmode -executeMethod MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX"
${CMD_LINE}
RES=$?
echo "$CMD_LINE ..."
if [[ "${RES}" -eq "0" ]]; then
echo "Standalone build completed successfully.";
exit 0;
else
echo "Standalone build failed."
exit 1;
fi
${CMD_LINE}
RES=$?
exit ${RES}
if [[ "${RES}" -eq "0" ]]; then
echo "Standalone build completed successfully.";
exit 0;
else
echo "Standalone build failed."
exit 1;
exit ${RES}

71
run-tests-editmode-osx-editor.sh


set -eo pipefail
EDITOR_VERSION="2017.4.33f1"
BOKKEN_UNITY="/Users/bokken/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${EDITOR_VERSION}/Unity.app/Contents/MacOS/Unity"
if [[ -z "${UNITY_VERSION}" ]]; then
echo "Environment Variable UNITY_VERSION was not set"
exit 1
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
UNITY=${HUB_UNITY}
fi
BOKKEN_UNITY="/Users/bokken/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
HUB_UNITY="/Applications/Unity/Hub/Editor/${UNITY_VERSION}/Unity.app/Contents/MacOS/Unity"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -f ${BOKKEN_UNITY} ]]; then
UNITY=${BOKKEN_UNITY}
else
UNITY=${HUB_UNITY}
fi
echo "Cleaning previous results"
pushd $(dirname "${0}") > /dev/null
BASETPATH=$(pwd -L)
popd > /dev/null
if [[ -e ${BASETPATH}/results.xml ]]
then
rm ${BASETPATH}/results.xml
fi
echo "Cleaning previous results"
if [[ -e ${BASETPATH}/results.xml ]]
then
rm ${BASETPATH}/results.xml
fi
echo "Starting tests via $UNITY"
echo "Starting tests via $UNITY"
CMD_LINE="$UNITY -runTests -logfile - -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
CMD_LINE="$UNITY -runTests -projectPath $BASETPATH/UnitySDK -testResults $BASETPATH/results.xml -testPlatform editmode"
echo "$CMD_LINE ..."
echo "$CMD_LINE ..."
$CMD_LINE
RES=$?
$CMD_LINE
RES=$?
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
TOTAL=$(echo 'cat /test-run/test-suite/@total' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
PASSED=$(echo 'cat /test-run/test-suite/@passed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
FAILED=$(echo 'cat /test-run/test-suite/@failed' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
DURATION=$(echo 'cat /test-run/test-suite/@duration' | xmllint --shell results.xml | awk -F'[="]' '!/>/{print $(NF-1)}')
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
echo "$TOTAL tests executed in ${DURATION}s: $PASSED passed, $FAILED failed. More details in results.xml"
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
echo "Test run SUCCEEDED!"
else
echo "Test run FAILED!"
fi
if [[ ${RES} -eq 0 ]] && [[ -e ${BASETPATH}/results.xml ]]; then
echo "Test run SUCCEEDED!"
else
echo "Test run FAILED!"
fi
rm "${BASETPATH}/results.xml"
rm "${BASETPATH}/results.xml"
exit ${RES}
exit ${RES}
fi

2
test_constraints_max_version.txt


# For projects with upper bounds, we should periodically update this list to the latest release version
grpcio>=1.23.0
numpy>=1.17.2
tensorflow>=1.14.0
tensorflow>=1.14.0,<2.0

16
markdown-link-check.fast.json


{
"ignorePatterns": [
{
"pattern": "^http://localhost",
"comment": "Ignore local tensorboard links"
},
{
"pattern": "^https://developer.nvidia.com/compute/machine-learning/cudnn/secure",
"comment": "Requires login"
},
{
"pattern": "^https?://",
"comment": "Skip external links for fast runs."
}
]
}

/markdown-link-check.config.json → /markdown-link-check.full.json

正在加载...
取消
保存