Skip to content

[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

Merged
merged 3 commits into from
May 24, 2021

Conversation

chriselion
Copy link
Contributor

@chriselion chriselion commented May 14, 2021

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:

  • 0.16.1 to 0.20.0 are supported
  • 0.21.0 to 0.25.x are unsupported, but still compatible (warn, but allow training)
  • 0.26.0 and higher are incompatible, no training possible

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)

  • Bug fix

Checklist

  • Added tests that prove my fix is effective or that my feature works
  • Updated the changelog (if applicable)
  • Updated the documentation (if applicable)

@chriselion chriselion requested a review from surfnerd May 14, 2021 22:30
@@ -1 +1 @@
m_EditorVersion: 2018.4.17f1
Copy link
Contributor Author

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)
Copy link
Contributor Author

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.");
Copy link
Contributor Author

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");
Copy link
Contributor Author

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.

@chriselion chriselion merged commit d69ce6c into release_2_verified May 24, 2021
@delete-merged-branch delete-merged-branch bot deleted the MLA-1981-dont-train-new-python branch May 24, 2021 16:30
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants