Fix #5620. UbuntuL16.04 is not supported in github action. Remove this type of OS.
And fix Lint issue
This commit is contained in:
Binyang2014 2021-10-19 22:25:57 -07:00 коммит произвёл GitHub
Родитель 6c505462d2
Коммит 4839405399
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 16 добавлений и 16 удалений

12
.github/workflows/continuous-integration.yml поставляемый
Просмотреть файл

@ -17,7 +17,7 @@ jobs:
strategy:
matrix:
python: [2.7]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout
@ -45,7 +45,7 @@ jobs:
strategy:
matrix:
python: [3.7]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout
@ -70,7 +70,7 @@ jobs:
strategy:
matrix:
go: [1.13.8]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout
@ -95,7 +95,7 @@ jobs:
strategy:
matrix:
node: [10]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout
@ -146,7 +146,7 @@ jobs:
strategy:
matrix:
node: [8, 10]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout
@ -169,7 +169,7 @@ jobs:
strategy:
matrix:
node: [10]
os: [ubuntu-16.04, ubuntu-latest]
os: [ubuntu-18.04, ubuntu-latest]
steps:
- name: Checkout

10
.github/workflows/lint.yml поставляемый
Просмотреть файл

@ -13,7 +13,7 @@ on:
jobs:
docs:
name: Lint docs
runs-on: ubuntu-16.04
runs-on: ubuntu-18.04
steps:
- name: Checkout
@ -33,7 +33,7 @@ jobs:
spelling:
name: Spelling check
runs-on: ubuntu-16.04
runs-on: ubuntu-18.04
steps:
- name: Checkout
@ -48,7 +48,7 @@ jobs:
pylint-deployment:
name: pylint of deployment scripts
runs-on: ubuntu-16.04
runs-on: ubuntu-18.04
steps:
- name: Checkout
@ -69,7 +69,7 @@ jobs:
pylint-alert-manager:
name: pylint of alert-manager
runs-on: ubuntu-16.04
runs-on: ubuntu-18.04
steps:
- name: Checkout
@ -94,7 +94,7 @@ jobs:
strategy:
matrix:
node: [10]
os: [ubuntu-16.04]
os: [ubuntu-18.04]
steps:
- name: Checkout

Просмотреть файл

@ -71,9 +71,9 @@ def get_related_jobs(rest_url):
offset = 0
limit = 5000
headers = {'Authorization': "Bearer {}".format(TOKEN)}
headers = {'Authorization': f"Bearer {TOKEN}"}
while True:
resp = requests.get(rest_url+"limit={}&offset={}".format(limit, offset), headers=headers)
resp = requests.get(rest_url+f"limit={limit}&offset={offset}", headers=headers)
resp.raise_for_status()
jobs = resp.json()
jobs_related += jobs
@ -99,7 +99,7 @@ def get_usage_info(job_gpu_percent, job_gpu_hours, user_usage_result, rest_url):
for v in job_gpu_percent["data"]["result"]:
job_name = v["metric"]["job_name"]
matched_job = list(
filter(lambda job: "{}~{}".format(job["username"], job["name"]) == job_name,
filter(lambda job: f"{job['username']}~{job['name']}" == job_name,
jobs_related))
# ingore unfounded jobs
if not matched_job:
@ -147,9 +147,9 @@ def get_usage_info(job_gpu_percent, job_gpu_hours, user_usage_result, rest_url):
job_info["gpu_number"] = str(job_info["gpu_number"])
job_info["duration"] = str(job_info["duration"])
job_info["start_time"] = job_info["start_time"].strftime("%y-%m-%d %H:%M:%S")
job_info["resources_occupied"] = "{:.2f}".format(job_info["resources_occupied"])
job_info["resources_occupied"] = f"{job_info['resources_occupied']:.2f}"
for user_info in user_infos.values():
user_info["resources_occupied"] = "{:.2f}".format(user_info["resources_occupied"])
user_info["resources_occupied"] = f"{user_info['resources_occupied']:.2f}"
# sort usage info by resources occupied
job_usage = sorted(job_infos.values(), key=lambda x: float(x["resources_occupied"]), reverse=True)