@@ -539,19 +539,27 @@ def _start_api_server(deploy: bool = False,
539539 'is not a local URL' )
540540
541541 # Check available memory before starting the server.
542- avail_mem_size_gb : float = common_utils .get_mem_size_gb ()
543- # pylint: disable=import-outside-toplevel
544- import sky .jobs .utils as job_utils
545- max_memory = (server_constants .MIN_AVAIL_MEM_GB_CONSOLIDATION_MODE
546- if job_utils .is_consolidation_mode (on_api_restart = True )
547- else server_constants .MIN_AVAIL_MEM_GB )
548- if avail_mem_size_gb <= max_memory :
549- logger .warning (
550- f'{ colorama .Fore .YELLOW } Your SkyPilot API server machine only '
551- f'has { avail_mem_size_gb :.1f} GB memory available. '
552- f'At least { max_memory } GB is recommended to support higher '
553- 'load with better performance.'
554- f'{ colorama .Style .RESET_ALL } ' )
542+ # Skip this warning if postgres is used, as:
543+ # 1) that's almost certainly a remote API server;
544+ # 2) the actual consolidation mode config is stashed in the database,
545+ # and the value of `job_utils.is_consolidation_mode` will not be
546+ # the actual value in the db, but only None as in this case, the
547+ # whole YAML config is really just `db: <URI>`.
548+ if skypilot_config .get_nested (('db' ,), None ) is None :
549+ avail_mem_size_gb : float = common_utils .get_mem_size_gb ()
550+ # pylint: disable=import-outside-toplevel
551+ import sky .jobs .utils as job_utils
552+ max_memory = (server_constants .MIN_AVAIL_MEM_GB_CONSOLIDATION_MODE
553+ if job_utils .is_consolidation_mode (
554+ on_api_restart = True ) else
555+ server_constants .MIN_AVAIL_MEM_GB )
556+ if avail_mem_size_gb <= max_memory :
557+ logger .warning (
558+ f'{ colorama .Fore .YELLOW } Your SkyPilot API server machine '
559+ f'only has { avail_mem_size_gb :.1f} GB memory available. '
560+ f'At least { max_memory } GB is recommended to support higher '
561+ 'load with better performance.'
562+ f'{ colorama .Style .RESET_ALL } ' )
555563
556564 args = [sys .executable , * API_SERVER_CMD .split ()]
557565 if deploy :
@@ -560,8 +568,6 @@ def _start_api_server(deploy: bool = False,
560568 args += [f'--host={ host } ' ]
561569 if metrics_port is not None :
562570 args += [f'--metrics-port={ metrics_port } ' ]
563- # Use this argument to disable the internal signal file check.
564- args += ['--start-with-python' ]
565571
566572 if foreground :
567573 # Replaces the current process with the API server
0 commit comments