aurora-scheduler / australis

Aurora Scheduler client written in Go
Apache License 2.0
6 stars 10 forks source link

fetch capacity and simulate task fitting #33

Closed lenhattan86 closed 2 years ago

lenhattan86 commented 2 years ago

CHANGES

  1. fetch capacity report in details. for example:
    $ ./australis fetch capacity -s http://localhost:8081 --toJSON | jq .
    INFO[0000] Scheduler URL:  http://localhost:8081
    INFO[0000] gorealis clientConfig url: http://localhost:8081/api
    INFO[0000] Fetching capacity from  http://localhost:8081/offers
    {
    "non-dedicated": {
    "cpus": {
      "8": 2
    },
    "disk": {
      "54699": 2
    },
    "mem": {
      "6935": 2
    },
    "ports": {
      "1000": 2
    }
    },
    "vagrant/bar": {
    "cpus": {
      "8": 1
    },
    "disk": {
      "54699": 1
    },
    "mem": {
      "6935": 1
    },
    "ports": {
      "1000": 1
    }
    }
    }

2 simulate fitting tasks where we try to find at most how many tasks can fit at the moment. For example:

$ ./australis simulate fit -s http://localhost:8081 test/task_config.yaml
INFO[0000] Scheduler URL:  http://localhost:8081
INFO[0000] gorealis clientConfig url: http://localhost:8081/api
INFO[0000] Compute how many tasks can be fit in the remaining cluster capacity
1

TEST DONE

NOTES

This PR depends on another PR on gorealis: https://github.com/aurora-scheduler/gorealis/pull/18