add request name to admin policy #7840
                
     Open
            
            
          
      
        
          +251
        
        
          −47
        
        
          
        
      
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Add request_name to Admin Policy's input, allowing Admin Policy to selectively act on certain requests or only act on a subset of requests.
There are some quick benefits that can be realized from this PR. The most obvious is having a certain admin policy not act on certain requests, such as Optimize or Validate.
As an example, when a
launchrequest is submitted through either CLI or SDK, the codepath command actually first calls "Validate" on the DAG and then calls "Optimize" on the DAG before calling "Launch". Now imagine the skypilot admin writes an admin policy like below (taken from one of skypilot example admin policies):This policy doesn't actually need to be applied in either "Validate" or "Optimize" call, just the "Launch" call. With this PR, the admin can write this policy instead:
avoiding unnecessary work.
A better example where having
request_nameon hand isEnforceAutostopPolicy(also taken from publicly available examples):The problem with this admin policy as it exists now is twofold:
statuscall, this policy can add significant unnecessary latency to a launch request.By adding request name, we solve both of these problems:
Tested (run the relevant ones):
bash format.sh/smoke-test(CI) orpytest tests/test_smoke.py(local)/smoke-test -k test_name(CI) orpytest tests/test_smoke.py::test_name(local)/quicktest-core(CI) orpytest tests/smoke_tests/test_backward_compat.py(local)