浏览代码

run build job on bigger flavor (#4819)

* run build job on bigger flavor

* log to stdout

* skip editor download for training
/MLA-1734-demo-provider
GitHub 4 年前
当前提交
c54c402f
共有 4 个文件被更改,包括 12 次插入8 次删除
  1. 2
      .yamato/standalone-build-test.yml
  2. 2
      .yamato/training-int-tests.yml
  3. 1
      ml-agents/tests/yamato/standalone_build_tests.py
  4. 15
      ml-agents/tests/yamato/yamato_utils.py

2
.yamato/standalone-build-test.yml


agent:
type: Unity::VM
image: package-ci/ubuntu:stable
flavor: b1.medium
flavor: b1.large
variables:
UNITY_VERSION: {{ editor.version }}
commands:

2
.yamato/training-int-tests.yml


sudo apt-get update && sudo apt-get install -y python3-venv
python3 -m venv venv && source venv/bin/activate
python -m pip install pyyaml --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python -m pip install unity-downloader-cli --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple --upgrade
unity-downloader-cli -u {{ editor.version }} -c editor --wait --fast
python -u -m ml-agents.tests.yamato.training_int_tests
dependencies:
- .yamato/standalone-build-test.yml#test_linux_standalone_{{ editor.version }}

1
ml-agents/tests/yamato/standalone_build_tests.py


output_path=executable_name,
scene_path=scene_path,
build_target=build_target,
log_output_path=None, # Log to stdout so we get timestamps on the logs
)
if returncode == 0:

15
ml-agents/tests/yamato/yamato_utils.py


output_path: str = None,
scene_path: str = None,
build_target: str = None,
log_output_path: str = f"{get_base_output_path()}/standalone_build.txt",
log_output_path: Optional[str] = f"{get_base_output_path()}/standalone_build.txt",
) -> int:
"""
Run BuildStandalonePlayerOSX test to produce a player. The location defaults to

"Unity.MLAgents.StandaloneBuildTest.BuildStandalonePlayerOSX",
]
os.makedirs(os.path.dirname(log_output_path), exist_ok=True)
subprocess.run(["touch", log_output_path])
test_args += ["-logfile", log_output_path]
if log_output_path:
os.makedirs(os.path.dirname(log_output_path), exist_ok=True)
subprocess.run(["touch", log_output_path])
test_args += ["-logfile", log_output_path]
else:
# Log to stdout
test_args += ["-logfile", "-"]
if output_path is not None:
output_path = os.path.join(get_base_output_path(), output_path)

# Print if we fail or want verbosity.
if verbose or res.returncode != 0:
subprocess.run(["cat", log_output_path])
if log_output_path:
subprocess.run(["cat", log_output_path])
return res.returncode

正在加载...
取消
保存