浏览代码

ML-Agents Extensions package (#4105)

* extensions package first pass

* add extensions test to yamato

* cleanup docs folder

* triggers and pack

* yamato - different jobs for each package

* disable coverage checks for extensions

* trigger

* Unity Companion License
/MLA-1734-demo-provider
GitHub 5 年前
当前提交
59fb7aa5
共有 47 个文件被更改,包括 392 次插入18 次删除
  1. 13
      .yamato/com.unity.ml-agents-pack.yml
  2. 40
      .yamato/com.unity.ml-agents-test.yml
  3. 1
      .yamato/standalone-build-test.yml
  4. 1
      .yamato/training-int-tests.yml
  5. 4
      DevProject/Packages/manifest.json
  6. 4
      Project/Packages/manifest.json
  7. 10
      utils/validate_meta_files.py
  8. 12
      com.unity.ml-agents.extensions/.gitignore
  9. 19
      com.unity.ml-agents.extensions/.npmignore
  10. 8
      com.unity.ml-agents.extensions/CHANGELOG.md
  11. 7
      com.unity.ml-agents.extensions/CHANGELOG.md.meta
  12. 37
      com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md
  13. 8
      com.unity.ml-agents.extensions/Editor.meta
  14. 6
      com.unity.ml-agents.extensions/Editor/EditorExample.cs
  15. 11
      com.unity.ml-agents.extensions/Editor/EditorExample.cs.meta
  16. 10
      com.unity.ml-agents.extensions/Editor/Unity.ML-Agents.Extensions.Editor.asmdef
  17. 7
      com.unity.ml-agents.extensions/Editor/Unity.ML-Agents.Extensions.Editor.asmdef.meta
  18. 9
      com.unity.ml-agents.extensions/LICENSE.md
  19. 7
      com.unity.ml-agents.extensions/LICENSE.md.meta
  20. 3
      com.unity.ml-agents.extensions/README.md
  21. 7
      com.unity.ml-agents.extensions/README.md.meta
  22. 8
      com.unity.ml-agents.extensions/Runtime.meta
  23. 6
      com.unity.ml-agents.extensions/Runtime/RuntimeExample.cs
  24. 11
      com.unity.ml-agents.extensions/Runtime/RuntimeExample.cs.meta
  25. 9
      com.unity.ml-agents.extensions/Runtime/Unity.ML-Agents.Extensions.asmdef
  26. 7
      com.unity.ml-agents.extensions/Runtime/Unity.ML-Agents.Extensions.asmdef.meta
  27. 8
      com.unity.ml-agents.extensions/Tests.meta
  28. 3
      com.unity.ml-agents.extensions/Tests/.tests.json
  29. 8
      com.unity.ml-agents.extensions/Tests/Editor.meta
  30. 20
      com.unity.ml-agents.extensions/Tests/Editor/EditorExampleTest.cs
  31. 11
      com.unity.ml-agents.extensions/Tests/Editor/EditorExampleTest.cs.meta
  32. 14
      com.unity.ml-agents.extensions/Tests/Editor/Unity.ML-Agents.Extensions.EditorTests.asmdef
  33. 7
      com.unity.ml-agents.extensions/Tests/Editor/Unity.ML-Agents.Extensions.EditorTests.asmdef.meta
  34. 8
      com.unity.ml-agents.extensions/Tests/Runtime.meta
  35. 20
      com.unity.ml-agents.extensions/Tests/Runtime/RuntimeExampleTest.cs
  36. 11
      com.unity.ml-agents.extensions/Tests/Runtime/RuntimeExampleTest.cs.meta
  37. 11
      com.unity.ml-agents.extensions/Tests/Runtime/Unity.ML-Agents.Extensions.Tests.asmdef
  38. 7
      com.unity.ml-agents.extensions/Tests/Runtime/Unity.ML-Agents.Extensions.Tests.asmdef.meta
  39. 10
      com.unity.ml-agents.extensions/package.json
  40. 7
      com.unity.ml-agents.extensions/package.json.meta

13
.yamato/com.unity.ml-agents-pack.yml


pack:
name: Pack
packages:
- name: com.unity.ml-agents
- name: com.unity.ml-agents.extensions
---
{% for package in packages %}
pack_{{ package.name }}:
name: Pack {{ package.name }}
agent:
type: Unity::VM::osx
image: package-ci/mac:stable

- upm-ci package pack --package-path com.unity.ml-agents
- upm-ci package pack --package-path {{ package.name }}
artifacts:
packages:
paths:

{% endfor %}

40
.yamato/com.unity.ml-agents-test.yml


type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.medium
packages:
- name: com.unity.ml-agents
- name: com.unity.ml-agents.extensions
---
all_package_tests:

- branch: master
frequency: daily
{% for editor in test_editors %}
{% for platform in test_platforms %}
test_{{ platform.name }}_{{ editor.version }}:
name : com.unity.ml-agents test {{ editor.version }} on {{ platform.name }}
{% for package in packages %}
{% for editor in test_editors %}
{% for platform in test_platforms %}
test_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}

- upm-ci package test -u {{ editor.version }} --package-path com.unity.ml-agents {{ editor.coverageOptions }}
- upm-ci package test -u {{ editor.version }} --package-path {{ package.name }} {{ editor.coverageOptions }}
{% if package.name == "com.unity.ml-agents" %}
# TODO get coverage tests running for extensions too
{% endif %}
- .yamato/com.unity.ml-agents-pack.yml#pack
- .yamato/com.unity.ml-agents-pack.yml#pack_{{ package.name }}
triggers:
cancel_old_ci: true
{% if platform.name == "mac" %}

NOT pull_request.draft AND
(pull_request.changes.any match "com.unity.ml-agents/**" OR
{% if package.name == "com.unity.ml-agents" %}
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
{% endif %}
{% endfor %}
{% for editor in trunk_editor %}
{% for platform in test_platforms %}
test_{{ platform.name }}_trunk:
name : com.unity.ml-agents test {{ editor.version }} on {{ platform.name }}
{% for package in packages %}
{% for editor in trunk_editor %}
{% for platform in test_platforms %}
test_{{ package.name }}_{{ platform.name }}_trunk:
name : {{ package.name }} test {{ editor.version }} on {{ platform.name }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}

- unity-downloader-cli -u trunk -c editor --wait --fast
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
- upm-ci package test -u {{ editor.version }} --package-path com.unity.ml-agents {{ editor.coverageOptions }}
- upm-ci package test -u {{ editor.version }} --package-path {{ package.name }} {{ editor.coverageOptions }}
{% if package.name == "com.unity.ml-agents" %}
# TODO get coverage tests running for extensions too
{% endif %}
- .yamato/com.unity.ml-agents-pack.yml#pack
- .yamato/com.unity.ml-agents-pack.yml#pack_{{ package.name }}
{% endfor %}

1
.yamato/standalone-build-test.yml


pull_request.target match "release.+") AND
NOT pull_request.draft AND
(pull_request.changes.any match "com.unity.ml-agents/**" OR
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
pull_request.changes.any match ".yamato/standalone-build-test.yml") AND
NOT pull_request.changes.all match "**/*.md"
artifacts:

1
.yamato/training-int-tests.yml


pull_request.target match "release.+") AND
NOT pull_request.draft AND
(pull_request.changes.any match "com.unity.ml-agents/**" OR
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
pull_request.changes.any match "Project/**" OR
pull_request.changes.any match "ml-agents/**" OR
pull_request.changes.any match "ml-agents-envs/**" OR

4
DevProject/Packages/manifest.json


"com.unity.ide.rider": "1.1.4",
"com.unity.ide.vscode": "1.1.4",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.multiplayer-hlapi": "1.0.4",
"com.unity.package-manager-doctools": "1.1.1-preview.3",
"com.unity.package-validation-suite": "0.11.0-preview",

},
"registry": "https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-candidates",
"testables": [
"com.unity.ml-agents"
"com.unity.ml-agents",
"com.unity.ml-agents.extensions"
]
}

4
Project/Packages/manifest.json


"com.unity.analytics": "3.2.3",
"com.unity.collab-proxy": "1.2.15",
"com.unity.ml-agents": "file:../../com.unity.ml-agents",
"com.unity.ml-agents.extensions": "file:../../com.unity.ml-agents.extensions",
"com.unity.package-manager-ui": "2.0.8",
"com.unity.package-validation-suite": "0.7.15-preview",
"com.unity.purchasing": "2.0.3",

"com.unity.modules.xr": "1.0.0"
},
"testables": [
"com.unity.ml-agents"
"com.unity.ml-agents",
"com.unity.ml-agents.extensions"
]
}

10
utils/validate_meta_files.py


def main():
asset_paths = ["Project/Assets", "com.unity.ml-agents"]
asset_paths = [
"Project/Assets",
"DevProject/Assets",
"com.unity.ml-agents",
"com.unity.ml-agents.extensions",
]
meta_suffix = ".meta"
python_suffix = ".py"
allow_list = frozenset(

"com.unity.ml-agents/.npmignore",
"com.unity.ml-agents/Tests/.tests.json",
"com.unity.ml-agents.extensions/.gitignore",
"com.unity.ml-agents.extensions/.npmignore",
"com.unity.ml-agents.extensions/Tests/.tests.json",
]
)
ignored_dirs = {"Documentation~"}

12
com.unity.ml-agents.extensions/.gitignore


artifacts/**
build/**
.build_script/**
node_modules/**
.DS_Store
.npmrc
!Documentation~
!.Documentation
npm-debug.log
build.sh.meta
build.bat.meta
.idea/

19
com.unity.ml-agents.extensions/.npmignore


artifacts/**
build/**
.build_script/**
node_modules/**
Documentation/ApiDocs/**
Documentation~/ApiDocs/**
.DS_Store
.npmrc
.npmignore
.gitignore
CONTRIBUTING.md
CONTRIBUTING.md.meta
QAReport.md
QAReport.md.meta
.gitlab-ci.yml
build.sh
build.sh.meta
build.bat
build.bat.meta

8
com.unity.ml-agents.extensions/CHANGELOG.md


# Changelog
All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
* Initial version

7
com.unity.ml-agents.extensions/CHANGELOG.md.meta


fileFormatVersion: 2
guid: cb3bf154cb17b41fca51ce7b73ef4d1b
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

37
com.unity.ml-agents.extensions/Documentation~/com.unity.ml-agents.extensions.md


# About ML-Agents Extensions package (`com.unity.ml-agents.extensions`)
The Unity ML-Agents Extensions package optional add-ons to the C# SDK for the
[Unity ML-Agents Toolkit](https://github.com/Unity-Technologies/ml-agents).
These extensions are all considered experimental, and their API or behavior
may change between versions.
## Package contents
The following table describes the package folder structure:
| **Location** | **Description** |
| ---------------- | ---------------------------------------------------------------------- |
| _Documentation~_ | Contains the documentation for the Unity package. |
| _Editor_ | Contains utilities for Editor windows and drawers. |
| _Runtime_ | Contains core C# APIs for integrating ML-Agents into your Unity scene. |
| _Tests_ | Contains the unit tests for the package. |
<a name="Installation"></a>
## Installation
To install this _ML-Agents_ package, follow the instructions in the [Package
Manager documentation](https://docs.unity3d.com/Manual/upm-ui-install.html).
## Requirements
This version of the Unity ML-Agents Extensions package is compatible with the
following versions of the Unity Editor:
- 2018.4 and later
## Known Limitations

8
com.unity.ml-agents.extensions/Editor.meta


fileFormatVersion: 2
guid: 40d78a1c3c0ef4584a1816f66812de87
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

6
com.unity.ml-agents.extensions/Editor/EditorExample.cs


using Unity.MLAgents;
namespace Unity.MLAgents.Extensions.Editor
{
}

11
com.unity.ml-agents.extensions/Editor/EditorExample.cs.meta


fileFormatVersion: 2
guid: 4d278d118acf74b1294c16f6a065b4ab
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

10
com.unity.ml-agents.extensions/Editor/Unity.ML-Agents.Extensions.Editor.asmdef


{
"name": "Unity.ML-Agents.Extensions.Editor",
"references": [
"Unity.ML-Agents.Extensions"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}

7
com.unity.ml-agents.extensions/Editor/Unity.ML-Agents.Extensions.Editor.asmdef.meta


fileFormatVersion: 2
guid: eec81f5d1363e46538604927f0b9199c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
com.unity.ml-agents.extensions/LICENSE.md


com.unity.ml-agents.extensions copyright © 2020 Unity Technologies
Licensed under the Unity Companion License for Unity-dependent projects -- see
[Unity Companion License](http://www.unity3d.com/legal/licenses/Unity_Companion_License).
Unless expressly provided otherwise, the Software under this license is made
available strictly on an “AS IS” BASIS WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED. Please review the license for details on these and other terms and
conditions.

7
com.unity.ml-agents.extensions/LICENSE.md.meta


fileFormatVersion: 2
guid: 1f518b76bbd7b4806b0653aac1143b42
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
com.unity.ml-agents.extensions/README.md


# ML-Agents Extensions
This is a source-only package for new features based on ML-Agents.

7
com.unity.ml-agents.extensions/README.md.meta


fileFormatVersion: 2
guid: 86620336dab3b4d3783b0b3114496654
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.ml-agents.extensions/Runtime.meta


fileFormatVersion: 2
guid: 35f52f986759c491cb377b1f3841c566
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

6
com.unity.ml-agents.extensions/Runtime/RuntimeExample.cs


using Unity.MLAgents;
namespace Unity.MLAgents.Extensions
{
}

11
com.unity.ml-agents.extensions/Runtime/RuntimeExample.cs.meta


fileFormatVersion: 2
guid: 2763a568e3b8541e08b90cb15e442281
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
com.unity.ml-agents.extensions/Runtime/Unity.ML-Agents.Extensions.asmdef


{
"name": "Unity.ML-Agents.Extensions",
"references": [
"Unity.Barracuda",
"Unity.ML-Agents"
],
"includePlatforms": [],
"excludePlatforms": []
}

7
com.unity.ml-agents.extensions/Runtime/Unity.ML-Agents.Extensions.asmdef.meta


fileFormatVersion: 2
guid: 0234213bbb9574f66bb4d93920cc6bb7
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.ml-agents.extensions/Tests.meta


fileFormatVersion: 2
guid: 8b9992bc4a2804deda293d0d28bbf5e0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

3
com.unity.ml-agents.extensions/Tests/.tests.json


{
"createSeparatePackage": false
}

8
com.unity.ml-agents.extensions/Tests/Editor.meta


fileFormatVersion: 2
guid: bac537d30d9774fbcbac15029a3414f0
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

20
com.unity.ml-agents.extensions/Tests/Editor/EditorExampleTest.cs


using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
namespace Unity.MLAgents.Extensions.Tests
{
internal class EditorExampleTest {
[Test]
public void EditorTestMath()
{
Assert.AreEqual(2, 1 + 1);
}
}
}

11
com.unity.ml-agents.extensions/Tests/Editor/EditorExampleTest.cs.meta


fileFormatVersion: 2
guid: 8dadec7ee45de484bac4cab4efcca17d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

14
com.unity.ml-agents.extensions/Tests/Editor/Unity.ML-Agents.Extensions.EditorTests.asmdef


{
"name": "Unity.ML-Agents.Extensions.EditorTests",
"references": [
"Unity.ML-Agents.Extensions.Editor",
"Unity.ML-Agents.Extensions"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": []
}

7
com.unity.ml-agents.extensions/Tests/Editor/Unity.ML-Agents.Extensions.EditorTests.asmdef.meta


fileFormatVersion: 2
guid: 1356a0eb3b0d44ae19ba9348023d1d73
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
com.unity.ml-agents.extensions/Tests/Runtime.meta


fileFormatVersion: 2
guid: 302e80f9aed2d40a3899643525e5b706
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

20
com.unity.ml-agents.extensions/Tests/Runtime/RuntimeExampleTest.cs


using UnityEngine;
using UnityEditor;
using UnityEngine.TestTools;
using NUnit.Framework;
using System.Collections;
namespace Unity.MLAgents.Extensions.Tests
{
internal class RuntimeExampleTest {
[Test]
public void RuntimeTestMath()
{
Assert.AreEqual(2, 1 + 1);
}
}
}

11
com.unity.ml-agents.extensions/Tests/Runtime/RuntimeExampleTest.cs.meta


fileFormatVersion: 2
guid: be1c02c37007345aa8ad2e44603852b2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
com.unity.ml-agents.extensions/Tests/Runtime/Unity.ML-Agents.Extensions.Tests.asmdef


{
"name": "Unity.ML-Agents.Extensions.Tests",
"references": [
"Unity.ML-Agents.Extensions"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": []
}

7
com.unity.ml-agents.extensions/Tests/Runtime/Unity.ML-Agents.Extensions.Tests.asmdef.meta


fileFormatVersion: 2
guid: 30cbc899aa9234b7c93bfcba45275b9c
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

10
com.unity.ml-agents.extensions/package.json


{
"name": "com.unity.ml-agents.extensions",
"displayName":"ML Agents Extensions",
"version": "0.0.1-preview",
"unity": "2018.4",
"description": "A source-only package for new features based on ML-Agents",
"dependencies": {
"com.unity.ml-agents": "1.1.0-preview"
}
}

7
com.unity.ml-agents.extensions/package.json.meta


fileFormatVersion: 2
guid: a12a065df9b6f44d0b9a8e85d08d1cef
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存