@@ -71,8 +71,9 @@ protected override MilvusBuilder Init()
7171 . WithEnvironment ( "ETCD_CONFIG_PATH" , MilvusEtcdConfigFilePath )
7272 . WithEnvironment ( "ETCD_DATA_DIR" , "/var/lib/milvus/etcd" )
7373 . WithResourceMapping ( EtcdConfig , MilvusEtcdConfigFilePath )
74- . WithWaitStrategy ( Wait . ForUnixContainer ( ) . UntilHttpRequestIsSucceeded ( request =>
75- request . ForPort ( MilvusManagementPort ) . ForPath ( "/healthz" ) ) ) ;
74+ . WithWaitStrategy ( Wait . ForUnixContainer ( ) . UntilContainerIsHealthy ( ) )
75+ . WithCreateParameterModifier ( parameterModifier =>
76+ parameterModifier . Healthcheck = Healthcheck . Instance ) ;
7677 }
7778
7879 /// <inheritdoc />
@@ -92,4 +93,27 @@ protected override MilvusBuilder Merge(MilvusConfiguration oldValue, MilvusConfi
9293 {
9394 return new MilvusBuilder ( new MilvusConfiguration ( oldValue , newValue ) ) ;
9495 }
96+
97+ /// <summary>
98+ /// This setup mirrors the behavior of Milvus's official configuration:
99+ /// https://github.com/milvus-io/milvus/blob/4def0255a928287f982f1d6b8c53ed32127bb84d/scripts/standalone_embed.sh#L56-L60
100+ /// </summary>
101+ private sealed class Healthcheck : HealthcheckConfig
102+ {
103+ private Healthcheck ( )
104+ {
105+ const long ninetySeconds = 90 * 1_000_000_000L ;
106+ Test = [ "CMD-SHELL" , $ "curl -f http://localhost:{ MilvusManagementPort } /healthz"] ;
107+ Interval = TimeSpan . FromSeconds ( 30 ) ;
108+ Timeout = TimeSpan . FromSeconds ( 20 ) ;
109+ StartPeriod = ninetySeconds ;
110+ Retries = 3 ;
111+ }
112+
113+ /// <summary>
114+ /// Gets the <see cref="HealthcheckConfig" /> instance.
115+ /// </summary>
116+ public static HealthcheckConfig Instance { get ; }
117+ = new Healthcheck ( ) ;
118+ }
95119}
0 commit comments