-
Notifications
You must be signed in to change notification settings - Fork 4.3k
[MLA-1981] Don't allow connections to newer python trainers #5370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MLA-1981] Don't allow connections to newer python trainers #5370
Conversation
@@ -1 +1 @@ | |||
m_EditorVersion: 2018.4.17f1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This (and the manifest) were pretty old. Just affects Project, but it's annoying to keep excluding them.
@@ -99,6 +100,41 @@ public RpcCommunicator(CommunicatorInitParameters communicatorInitParameters) | |||
} | |||
|
|||
internal static bool CheckPythonPackageVersionIsCompatible(string pythonLibraryVersion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff is messy; the old code was renamed to CheckPythonPackageVersionIsSupported.
PythonTrainerVersions.s_MinSupportedVersion, | ||
PythonTrainerVersions.s_MaxSupportedVersion | ||
); | ||
throw new UnityAgentsException("Incompatible trainer version."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This gets caught and a different exception is thrown below.
|
||
// Any version > to this is known to be incompatible and we will block training. | ||
// Covers any patch to the release before the 2.0.0 package release. | ||
internal static Version s_MaxCompatibleVersion = new Version("0.25.999"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just in case we do a 0.25.2 patch release.
Proposed change(s)
Version 0.26.0 (and higher) of the python trainers product files incompatible with the 1.0.x versions of the package. To prevent confusion and frustration, don't allow connections with these versions.
Note that the old logic for trainers that don't produce .nn files is still there with a warning; this is a separate hard error. I'm reluctant to make the old range a hard failure, since that would be a behavior change.
To summarize:
Also note that the old logic would warn on anything that wasn't in an X.Y.Z format (e.g. "1.2.3.dev4"). In this case, we try a little harder to extract the numerical part of the version (so that we can determine the version for clones of the github
main
branch), but don't block if we can't parse (to prevent a potential behavior change).Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
https://jira.unity3d.com/browse/MLA-1981
Types of change(s)
Checklist