Skip to content

Commit

Permalink
Upgrade protobuf to 4.25.x
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-mccarthy-unity committed Mar 15, 2024
1 parent fb2af76 commit d451cef
Show file tree
Hide file tree
Showing 90 changed files with 3,606 additions and 3,665 deletions.
12 changes: 6 additions & 6 deletions .yamato/protobuf-generation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ test_linux_protobuf_generation:
image: ml-agents/ml-agents-ubuntu-18.04:latest
flavor: b1.large
variables:
GRPC_VERSION: "1.14.1"
GRPC_TOOLS_VERSION: "2.62.0"
CS_PROTO_PATH: "com.unity.ml-agents/Runtime/Grpc/CommunicatorObjects"
commands:
- |
sudo apt-get update && sudo apt-get install -y nuget
eval "$($HOME/anaconda/bin/conda shell.bash hook)"
conda activate python3.10
nuget install Grpc.Tools -Version $GRPC_VERSION -OutputDirectory protobuf-definitions/
nuget install Grpc.Tools -Version $GRPC_TOOLS_VERSION -OutputDirectory protobuf-definitions/
python3 -m pip install --upgrade pip --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python3 -m pip install grpcio==1.48.2 grpcio-tools==1.48.2 protobuf==3.19.6 six==1.16.0 mypy-protobuf==1.16.0 --progress-bar=off --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
python3 -m pip install grpcio==1.62.1 grpcio-tools==1.62.1 protobuf==4.25.3 six==1.16.0 mypy-protobuf==3.5.0 --progress-bar=off --index-url https://artifactory.prd.it.unity3d.com/artifactory/api/pypi/pypi/simple
pushd protobuf-definitions
chmod +x Grpc.Tools.$GRPC_VERSION/tools/linux_x64/protoc
chmod +x Grpc.Tools.$GRPC_VERSION/tools/linux_x64/grpc_csharp_plugin
COMPILER=Grpc.Tools.$GRPC_VERSION/tools/linux_x64 ./make.sh
chmod +x Grpc.Tools.$GRPC_TOOLS_VERSION/tools/linux_x64/protoc
chmod +x Grpc.Tools.$GRPC_TOOLS_VERSION/tools/linux_x64/grpc_csharp_plugin
COMPILER=Grpc.Tools.$GRPC_TOOLS_VERSION/tools/linux_x64 ./make.sh
popd
mkdir -p artifacts
touch artifacts/proto.patch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: mlagents_envs/communicator_objects/agent_action.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#pragma warning disable 1591, 0612, 3021, 8981
#region Designer generated code

using pb = global::Google.Protobuf;
Expand Down Expand Up @@ -32,38 +32,48 @@ static AgentActionReflection() {
"VW5pdHkuTUxBZ2VudHMuQ29tbXVuaWNhdG9yT2JqZWN0c2IGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Unity.MLAgents.CommunicatorObjects.AgentActionProto), global::Unity.MLAgents.CommunicatorObjects.AgentActionProto.Parser, new[]{ "VectorActionsDeprecated", "Value", "ContinuousActions", "DiscreteActions" }, null, null, null)
new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Unity.MLAgents.CommunicatorObjects.AgentActionProto), global::Unity.MLAgents.CommunicatorObjects.AgentActionProto.Parser, new[]{ "VectorActionsDeprecated", "Value", "ContinuousActions", "DiscreteActions" }, null, null, null, null)
}));
}
#endregion

}
#region Messages
internal sealed partial class AgentActionProto : pb::IMessage<AgentActionProto> {
[global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
internal sealed partial class AgentActionProto : pb::IMessage<AgentActionProto>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<AgentActionProto> _parser = new pb::MessageParser<AgentActionProto>(() => new AgentActionProto());
private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pb::MessageParser<AgentActionProto> Parser { get { return _parser; } }

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public static pbr::MessageDescriptor Descriptor {
get { return global::Unity.MLAgents.CommunicatorObjects.AgentActionReflection.Descriptor.MessageTypes[0]; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public AgentActionProto() {
OnConstruction();
}

partial void OnConstruction();

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public AgentActionProto(AgentActionProto other) : this() {
vectorActionsDeprecated_ = other.vectorActionsDeprecated_.Clone();
value_ = other.value_;
Expand All @@ -73,6 +83,7 @@ public AgentActionProto(AgentActionProto other) : this() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public AgentActionProto Clone() {
return new AgentActionProto(this);
}
Expand All @@ -86,6 +97,7 @@ public AgentActionProto Clone() {
/// mark as deprecated in communicator v1.3.0
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<float> VectorActionsDeprecated {
get { return vectorActionsDeprecated_; }
}
Expand All @@ -94,6 +106,7 @@ public AgentActionProto Clone() {
public const int ValueFieldNumber = 4;
private float value_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public float Value {
get { return value_; }
set {
Expand All @@ -107,6 +120,7 @@ public float Value {
= pb::FieldCodec.ForFloat(50);
private readonly pbc::RepeatedField<float> continuousActions_ = new pbc::RepeatedField<float>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<float> ContinuousActions {
get { return continuousActions_; }
}
Expand All @@ -117,16 +131,19 @@ public float Value {
= pb::FieldCodec.ForInt32(58);
private readonly pbc::RepeatedField<int> discreteActions_ = new pbc::RepeatedField<int>();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public pbc::RepeatedField<int> DiscreteActions {
get { return discreteActions_; }
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override bool Equals(object other) {
return Equals(other as AgentActionProto);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public bool Equals(AgentActionProto other) {
if (ReferenceEquals(other, null)) {
return false;
Expand All @@ -142,6 +159,7 @@ public bool Equals(AgentActionProto other) {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override int GetHashCode() {
int hash = 1;
hash ^= vectorActionsDeprecated_.GetHashCode();
Expand All @@ -155,12 +173,17 @@ public override int GetHashCode() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
vectorActionsDeprecated_.WriteTo(output, _repeated_vectorActionsDeprecated_codec);
if (Value != 0F) {
output.WriteRawTag(37);
Expand All @@ -171,9 +194,28 @@ public void WriteTo(pb::CodedOutputStream output) {
if (_unknownFields != null) {
_unknownFields.WriteTo(output);
}
#endif
}

#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
vectorActionsDeprecated_.WriteTo(ref output, _repeated_vectorActionsDeprecated_codec);
if (Value != 0F) {
output.WriteRawTag(37);
output.WriteFloat(Value);
}
continuousActions_.WriteTo(ref output, _repeated_continuousActions_codec);
discreteActions_.WriteTo(ref output, _repeated_discreteActions_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public int CalculateSize() {
int size = 0;
size += vectorActionsDeprecated_.CalculateSize(_repeated_vectorActionsDeprecated_codec);
Expand All @@ -189,6 +231,7 @@ public int CalculateSize() {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(AgentActionProto other) {
if (other == null) {
return;
Expand All @@ -203,7 +246,11 @@ public void MergeFrom(AgentActionProto other) {
}

[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
Expand Down Expand Up @@ -231,7 +278,42 @@ public void MergeFrom(pb::CodedInputStream input) {
}
}
}
#endif
}

#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
[global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10:
case 13: {
vectorActionsDeprecated_.AddEntriesFrom(ref input, _repeated_vectorActionsDeprecated_codec);
break;
}
case 37: {
Value = input.ReadFloat();
break;
}
case 50:
case 53: {
continuousActions_.AddEntriesFrom(ref input, _repeated_continuousActions_codec);
break;
}
case 58:
case 56: {
discreteActions_.AddEntriesFrom(ref input, _repeated_discreteActions_codec);
break;
}
}
}
}
#endif

}

Expand Down

This file was deleted.

Loading

0 comments on commit d451cef

Please sign in to comment.