Skip to content

Commit e78a632

Browse files
author
Chris Elion
committed
Merge branch 'match3-example' into match3-example-special
2 parents f14d5a4 + d02830f commit e78a632

File tree

93 files changed

+4341
-408
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4341
-408
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: build and push Docker image
2+
3+
on:
4+
push:
5+
tags:
6+
- "release_[0-9]+"
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
14+
with:
15+
version: '270.0.0'
16+
service_account_email: ${{ secrets.GCP_STG_EMAIL }}
17+
service_account_key: ${{ secrets.GCP_STG_PRIVATE_KEY }}
18+
export_default_credentials: true
19+
- name: Configure GCR Docker auth (stg)
20+
run: gcloud auth configure-docker
21+
- name: Build docker image
22+
run: docker build --tag ml-agents:${GITHUB_SHA} --build-arg SHA=${GITHUB_SHA} .
23+
- name: Tag docker image (stg)
24+
run: |
25+
docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-stg/ml-agents:${GITHUB_SHA}
26+
docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-stg/ml-agents:latest
27+
- name: Push docker image (stg)
28+
run: |
29+
docker push gcr.io/unity-ai-ml-agents-stg/ml-agents:${GITHUB_SHA}
30+
docker push gcr.io/unity-ai-ml-agents-stg/ml-agents:latest
31+
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
32+
with:
33+
version: '270.0.0'
34+
service_account_email: ${{ secrets.GCP_PRD_EMAIL }}
35+
service_account_key: ${{ secrets.GCP_PRD_PRIVATE_KEY }}
36+
export_default_credentials: true
37+
- name: Configure GCR Docker auth (prd)
38+
run: gcloud auth configure-docker
39+
- name: Tag docker image (prd)
40+
run: |
41+
docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-prd/ml-agents:${GITHUB_SHA}
42+
docker tag ml-agents:${GITHUB_SHA} gcr.io/unity-ai-ml-agents-prd/ml-agents:latest
43+
- name: Push docker image (prd)
44+
run: |
45+
docker push gcr.io/unity-ai-ml-agents-prd/ml-agents:${GITHUB_SHA}
46+
docker push gcr.io/unity-ai-ml-agents-prd/ml-agents:latest

.github/workflows/pre-commit.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ jobs:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- uses: actions/setup-python@v1
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.7.x
1416
- uses: actions/setup-ruby@v1
1517
with:
1618
ruby-version: '2.6'

.yamato/com.unity.ml-agents-promotion.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
1+
test_editors:
2+
- version: 2019.3
3+
test_platforms:
4+
- name: win
5+
type: Unity::VM
6+
image: package-ci/win10:stable
7+
flavor: b1.large
8+
---
9+
10+
{% for editor in test_editors %}
11+
{% for platform in test_platforms %}
12+
promotion_test_{{ platform.name }}_{{ editor.version }}:
13+
name : Promotion Test {{ editor.version }} on {{ platform.name }}
14+
agent:
15+
type: {{ platform.type }}
16+
image: {{ platform.image }}
17+
flavor: {{ platform.flavor}}
18+
variables:
19+
UPMCI_PROMOTION: 1
20+
commands:
21+
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
22+
- upm-ci package test --unity-version {{ editor.version }} --package-path com.unity.ml-agents
23+
artifacts:
24+
logs:
25+
paths:
26+
- "upm-ci~/test-results/**/*"
27+
dependencies:
28+
- .yamato/com.unity.ml-agents-pack.yml#pack
29+
{% endfor %}
30+
{% endfor %}
31+
32+
promotion_test_trigger:
33+
name: Promotion Tests Trigger
34+
dependencies:
35+
{% for editor in test_editors %}
36+
{% for platform in test_platforms %}
37+
- .yamato/com.unity.ml-agents-promotion.yml#promotion_test_{{platform.name}}_{{editor.version}}
38+
{% endfor %}
39+
{% endfor %}
40+
41+
142
promote:
243
name: Promote to Production
344
agent:
@@ -19,4 +60,8 @@ promote:
1960
- "upm-ci~/packages/*.tgz"
2061
dependencies:
2162
- .yamato/com.unity.ml-agents-pack.yml#pack
22-
- .yamato/com.unity.ml-agents-test.yml#all_package_tests
63+
{% for editor in test_editors %}
64+
{% for platform in test_platforms %}
65+
- .yamato/com.unity.ml-agents-promotion.yml#promotion_test_{{ platform.name }}_{{ editor.version }}
66+
{% endfor %}
67+
{% endfor %}

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

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,23 @@ test_editors:
22
- version: 2018.4
33
# 2018.4 doesn't support code-coverage
44
enableCodeCoverage: !!bool false
5+
# We want some scene tests to run in the DevProject, but packages there only support 2019+
6+
testProject: Project
57
- version: 2019.4
68
enableCodeCoverage: !!bool true
9+
testProject: DevProject
710
- version: 2020.1
811
enableCodeCoverage: !!bool true
12+
testProject: DevProject
913
- version: 2020.2
1014
enableCodeCoverage: !!bool true
15+
testProject: DevProject
16+
1117
trunk_editor:
1218
- version: trunk
1319
enableCodeCoverage: !!bool true
20+
testProject: DevProject
21+
1422
test_platforms:
1523
- name: win
1624
type: Unity::VM
@@ -24,6 +32,7 @@ test_platforms:
2432
type: Unity::VM
2533
image: package-ci/ubuntu:stable
2634
flavor: b1.medium
35+
2736
packages:
2837
- name: com.unity.ml-agents
2938
assembly: Unity.ML-Agents
@@ -70,7 +79,7 @@ test_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
7079
flavor: {{ platform.flavor}}
7180
commands:
7281
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
73-
- upm-ci project test -u {{ editor.version }} --project-path Project --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
82+
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
7483
{% if editor.enableCodeCoverage %}
7584
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
7685
{% endif %}
@@ -88,6 +97,7 @@ test_{{ package.name }}_{{ platform.name }}_{{ editor.version }}:
8897
pull_request.target match "release.+") AND
8998
NOT pull_request.draft AND
9099
(pull_request.changes.any match "com.unity.ml-agents/**" OR
100+
pull_request.changes.any match " {{ editor.testProject }}/**" OR
91101
{% if package.name == "com.unity.ml-agents.extensions" %}
92102
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
93103
{% endif %}
@@ -116,7 +126,7 @@ test_{{ package.name }}_{{ platform.name }}_trunk:
116126
- python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
117127
- unity-downloader-cli -u trunk -c editor --wait --fast
118128
- npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
119-
- upm-ci project test -u {{ editor.version }} --project-path Project --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
129+
- upm-ci project test -u {{ editor.version }} --project-path {{ editor.testProject }} --package-filter {{ package.name }} {{ coverageOptions }} --extra-utr-arg "reruncount=2"
120130
{% if editor.enableCodeCoverage %}
121131
- python3 ml-agents/tests/yamato/check_coverage_percent.py upm-ci~/test-results/ {{ package.minCoveragePct }}
122132
{% endif %}

.yamato/compressed-sensor-test.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{% metadata_file .yamato/test_versions.metafile %}
2+
---
3+
{% for editor in test_editors %}
4+
test_compressed_obs_{{ editor.version }}:
5+
name: Test Compressed Sensor Observation {{ editor.version }}
6+
agent:
7+
type: Unity::VM::osx
8+
image: ml-agents/ml-agents-bokken-mac:0.1.4-492264
9+
flavor: b1.small
10+
variables:
11+
UNITY_VERSION: {{ editor.version }}
12+
commands:
13+
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
14+
- python -u -m ml-agents.tests.yamato.setup_venv
15+
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_compressed_sensor.py --env=artifacts/testPlayer-TestGridCompressed
16+
- ./venv/bin/python ml-agents/tests/yamato/scripts/run_compressed_sensor.py --env=artifacts/testPlayer-TestTextureCompressed
17+
dependencies:
18+
- .yamato/standalone-build-test.yml#test_mac_standalone_{{ editor.version }}
19+
triggers:
20+
cancel_old_ci: true
21+
expression: |
22+
(pull_request.target eq "master" OR
23+
pull_request.target match "release.+") AND
24+
NOT pull_request.draft AND
25+
(pull_request.changes.any match "com.unity.ml-agents/**" OR
26+
pull_request.changes.any match "com.unity.ml-agents.extensions/**" OR
27+
pull_request.changes.any match "Project/**" OR
28+
pull_request.changes.any match "ml-agents/**" OR
29+
pull_request.changes.any match "ml-agents-envs/**" OR
30+
pull_request.changes.any match ".yamato/compressed-sensor-test.yml") AND
31+
NOT pull_request.changes.all match "**/*.md"
32+
{% endfor %}

.yamato/gym-interface-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
test_editors:
2-
- version: 2019.4
1+
{% metadata_file .yamato/test_versions.metafile %}
32
---
43
{% for editor in test_editors %}
54
test_gym_interface_{{ editor.version }}:

.yamato/python-ll-api-test.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
test_editors:
2-
- version: 2019.4
1+
{% metadata_file .yamato/test_versions.metafile %}
32
---
43
{% for editor in test_editors %}
54
test_mac_ll_api_{{ editor.version }}:

.yamato/standalone-build-test.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
test_editors:
2-
- version: 2018.4
3-
- version: 2019.3
1+
{% metadata_file .yamato/test_versions.metafile %}
42
---
53
{% for editor in test_editors %}
64
test_mac_standalone_{{ editor.version }}:
@@ -13,10 +11,15 @@ test_mac_standalone_{{ editor.version }}:
1311
UNITY_VERSION: {{ editor.version }}
1412
commands:
1513
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
14+
# TODO remove the "--user" command and the path prefix when we can migrate away from the custom bokken image
15+
- python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade --user
16+
- /Users/bokken/Library/Python/3.7/bin/unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
1617
- python -u -m ml-agents.tests.yamato.standalone_build_tests
1718
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/Examples/Basic/Scenes/Basic.unity
1819
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/Examples/Bouncer/Scenes/Bouncer.unity
1920
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/Examples/WallJump/Scenes/WallJump.unity
21+
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/TestScenes/TestCompressedGrid/TestGridCompressed.unity
22+
- python -u -m ml-agents.tests.yamato.standalone_build_tests --scene=Assets/ML-Agents/TestScenes/TestCompressedTexture/TestTextureCompressed.unity
2023
triggers:
2124
cancel_old_ci: true
2225
expression: |

.yamato/test_versions.metafile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# List of editor versions for standalone-build-test and its dependencies.
2+
test_editors:
3+
- version: 2018.4
4+
- version: 2019.4
5+
- version: 2020.1
6+
# Waiting on a barracuda fix, see https://jira.unity3d.com/browse/MLA-1464
7+
# - version: 2020.2

.yamato/training-int-tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
test_editors:
2-
- version: 2018.4
3-
- version: 2019.4
4-
- version: 2020.1
1+
{% metadata_file .yamato/test_versions.metafile %}
52
---
63
{% for editor in test_editors %}
74
test_mac_training_int_{{ editor.version }}:
@@ -14,6 +11,9 @@ test_mac_training_int_{{ editor.version }}:
1411
UNITY_VERSION: {{ editor.version }}
1512
commands:
1613
- pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
14+
# TODO remove the "--user" command and the path prefix when we can migrate away from the custom bokken image
15+
- python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade --user
16+
- /Users/bokken/Library/Python/3.7/bin/unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
1717
- python -u -m ml-agents.tests.yamato.training_int_tests
1818
# Backwards-compatibility tests.
1919
# If we make a breaking change to the communication protocol, these will need

0 commit comments

Comments
 (0)