Skip to content

Commit

Permalink
Create ML-Agents Package (Unity-Technologies#3267)
Browse files Browse the repository at this point in the history
Convert the UnitySDK to a Packman Package.

- Separate Examples into a sample project.
- Move core UnitySDK Code into com.unity.ml-agents.
- Create asmdefs for the ml-agents package.
- Add package validation tests for win/linux/max.
- Update protobuf generation scripts.
- Add Barracuda as a package dependency for ML-Agents. (users no longer have to install it themselves).
  • Loading branch information
surfnerd authored Jan 28, 2020
1 parent 66c9f76 commit a22b62f
Show file tree
Hide file tree
Showing 900 changed files with 987 additions and 381 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ jobs:
chmod +x Grpc.Tools.1.14.1/tools/linux_x64/protoc
chmod +x Grpc.Tools.1.14.1/tools/linux_x64/grpc_csharp_plugin
COMPILER=Grpc.Tools.1.14.1/tools/linux_x64 ./make.sh
CS_PROTO_PATH=UnitySDK/Assets/ML-Agents/Scripts/Grpc/CommunicatorObjects
CS_PROTO_PATH=com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects
git diff --exit-code --quiet -- :/ ":(exclude,top)$CS_PROTO_PATH/*.meta" \
|| { GIT_ERR=$?; echo "protobufs need to be regenerated, apply the patch uploaded to artifacts."; \
echo "Apply the patch with the command: git apply proto.patch"; \
Expand Down
26 changes: 4 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
/UnitySDK/[Ll]ibrary/
/UnitySDK/Logs/
/UnitySDK/[Tt]emp/
/UnitySDK/[Oo]bj/
/UnitySDK/[Bb]uild/
/UnitySDK/[Bb]uilds/
/UnitySDK/Assets/AssetStoreTools*
/UnitySDK/Assets/Plugins*
/UnitySDK/Assets/Demonstrations*
/UnitySDK/csharp_timers.json

# Tensorflow Model Info
/models
/summaries
Expand All @@ -23,8 +12,8 @@
/UnitySDK/.vs/

# Autogenerated VS/MD/Consulo solution and project files
/UnitySDKExportedObj/
/UnitySDK.consulo/
/com.unity.ml-agentsExportedObj/
/com.unity.ml-agents.consulo/
*.csproj
*.unityproj
*.sln
Expand All @@ -41,7 +30,7 @@
*.pidb.meta

# Unity3D Generated File On Crash Reports
/UnitySDK/sysinfo.txt
/com.unity.ml-agents/sysinfo.txt

# Builds
*.apk
Expand All @@ -51,15 +40,8 @@
*.x86_64
*.x86

# Tensorflow Sharp Files
/UnitySDK/Assets/ML-Agents/Plugins/Android*
/UnitySDK/Assets/ML-Agents/Plugins/iOS*
/UnitySDK/Assets/ML-Agents/Plugins/Computer*
/UnitySDK/Assets/ML-Agents/Plugins/System.Numerics*
/UnitySDK/Assets/ML-Agents/Plugins/System.ValueTuple*

# Plugins
/UnitySDK/Assets/ML-Agents/VideoRecorder*
/com.unity.ml-agents/VideoRecorder*

# Generated doc folders
/docs/html
Expand Down
13 changes: 13 additions & 0 deletions .yamato/com.unity.ml-agents-pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pack:
name: Pack
agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.large
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- upm-ci package pack --package-path com.unity.ml-agents
artifacts:
packages:
paths:
- "upm-ci~/packages/**/*"
44 changes: 44 additions & 0 deletions .yamato/com.unity.ml-agents-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
test_editors:
- version: 2018.4
- version: 2019.3
test_platforms:
- name: win
type: Unity::VM
image: package-ci/win10:stable
flavor: b1.large
- name: mac
type: Unity::VM::osx
image: package-ci/mac:stable
flavor: b1.small
- name: linux
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.medium
---

{% 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 }}
agent:
type: {{ platform.type }}
image: {{ platform.image }}
flavor: {{ platform.flavor}}
commands:
- npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm
- upm-ci package test -u {{ editor.version }} --package-path com.unity.ml-agents
artifacts:
logs:
paths:
- "upm-ci~/test-results/**/*"
dependencies:
- .yamato/com.unity.ml-agents-pack.yml#pack
triggers:
pull_requests:
- targets:
only:
- "master"
- "/release-.*/"
- "/hotfix-.*/"
{% endfor %}
{% endfor %}
27 changes: 0 additions & 27 deletions .yamato/csharp-tests.yml

This file was deleted.

69 changes: 69 additions & 0 deletions Project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/[Ll]ibrary/
/Logs/
/[Tt]emp/
/[Oo]bj/
/[Bb]uild/
/[Bb]uilds/
/Assets/AssetStoreTools*
/Assets/Plugins*
/Assets/Demonstrations*
/csharp_timers.json

# Environemnt logfile
*Project.log

# Visual Studio 2015 cache directory
/.vs/

# Autogenerated VS/MD/Consulo solution and project files
/ProjectExportedObj/
/Project.consulo/
*.csproj
*.unityproj
*.sln
*.suo
*.tmp
*.user
*.userprefs
*.pidb
*.booproj
*.svd
*.pdb

# Unity3D generated meta files
*.pidb.meta

# Unity3D Generated File On Crash Reports
/sysinfo.txt

# Builds
*.apk
*.unitypackage
*.app
*.exe
*.x86_64
*.x86

# Plugins
/Assets/VideoRecorder*

# Mac hidden files
*.DS_Store
*/.ipynb_checkpoints
*/.idea
*.pyc
*.idea/misc.xml
*.idea/modules.xml
*.idea/
*.iml
*.cache
*/build/
*/dist/
*.egg-info*
*.eggs*
*.gitignore.swp

# VSCode hidden files
*.vscode/

.DS_Store
File renamed without changes.
5 changes: 2 additions & 3 deletions UnitySDK/Assets/ML-Agents/Editor.meta → Project/Assets/ML-Agents/Editor.meta
100755 → 100644

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
Loading

0 comments on commit a22b62f

Please sign in to comment.