Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support org_name and job price info sent by API #2404

Merged
merged 6 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.D/2404.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Report job price in `neuro job status`, add support of organisation names in jobs.
6 changes: 6 additions & 0 deletions neuro-cli/src/neuro_cli/formatters/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ def __call__(self, job_status: JobDescription) -> RenderableType:
table.add_row("Tags", text)
table.add_row("Owner", job_status.owner or "")
table.add_row("Cluster", job_status.cluster_name)
if job_status.org_name:
table.add_row("Organisation", job_status.org_name)
if job_status.description:
table.add_row("Description", job_status.description)
status_text = fmt_status(job_status.status)
Expand All @@ -122,6 +124,10 @@ def __call__(self, job_status: JobDescription) -> RenderableType:
table.add_row("Working dir", job_status.container.working_dir)
if job_status.preset_name:
table.add_row("Preset", job_status.preset_name)
table.add_row(
"Price (credits / hour)", f"{job_status.price_credits_per_hour:.4f}"
)
table.add_row("Current cost", f"{job_status.price_credits_per_hour:.4f}")

resources = Table(box=None, show_header=False, show_edge=False)
resources.add_column()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Job test-job
Owner owner
Cluster default
Description test job description
Status pending
Image test-image
Command test-command
Resources Memory 16.0M
CPU 0.1
Round Robin True
Preemptible Node True
TTY False
Created Sep 25 2018 at 12:28
Job test-job
Owner owner
Cluster default
Description test job description
Status pending
Image test-image
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
Round Robin True
Preemptible Node True
TTY False
Created Sep 25 2018 at 12:28
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
Job test-job
Owner owner
Cluster default
Description test job description
Status pending
Image test-image
Command test-command
Resources Memory 16.0M
CPU 0.1
Round Robin True
Preemptible Node True
TTY False
Created 2018-09-25T12:28:21.298672+00:00
Job test-job
Owner owner
Cluster default
Description test job description
Status pending
Image test-image
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
Round Robin True
Preemptible Node True
TTY False
Created 2018-09-25T12:28:21.298672+00:00
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Resources Memory 16.0M
CPU 0.1
TTY False
Disk volumes /mnt/disk1 disk:disk1 READONLY
/mnt/disk2 disk:/otheruser/disk2
/mnt/disk3 disk://othercluster/otheruser/disk3
Http URL http://local.host.test/
Http port 80
Http authentication True
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Finished Sep 25 2018 at 12:28
Exit code 123
Description ErrorDesc
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Disk volumes /mnt/disk1 disk:disk1 READONLY
/mnt/disk2 disk:/otheruser/disk2
/mnt/disk3 disk://othercluster/otheruser/disk3
Http URL http://local.host.test/
Http port 80
Http authentication True
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Finished Sep 25 2018 at 12:28
Exit code 123
Description ErrorDesc
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Resources Memory 16.0M
CPU 0.1
TTY False
Disk volumes /mnt/disk1 disk:disk1 READONLY
/mnt/disk2 disk:/otheruser/disk2
/mnt/disk3 disk://othercluster/otheruser/disk3
Http URL http://local.host.test/
Http port 80
Http authentication True
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:59.759433+00:00
Finished 2018-09-25T12:28:59.759433+00:00
Exit code 123
Description ErrorDesc
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Disk volumes /mnt/disk1 disk:disk1 READONLY
/mnt/disk2 disk:/otheruser/disk2
/mnt/disk3 disk://othercluster/otheruser/disk3
Http URL http://local.host.test/
Http port 80
Http authentication True
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:59.759433+00:00
Finished 2018-09-25T12:28:59.759433+00:00
Exit code 123
Description ErrorDesc
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Job test-job
Owner test-user
Cluster default
Description test job description
Status running (ContainerRunning)
Image test-image
Entrypoint /usr/bin/make
Command test
Resources Memory 16.0M
CPU 0.1
TTY False
Internal Hostname host.local
Http URL http://local.host.test/
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Job test-job
Owner test-user
Cluster default
Description test job description
Status running (ContainerRunning)
Image test-image
Entrypoint /usr/bin/make
Command test
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Internal Hostname host.local
Http URL http://local.host.test/
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
Job test-job
Owner test-user
Cluster default
Description test job description
Status running (ContainerRunning)
Image test-image
Entrypoint /usr/bin/make
Command test
Resources Memory 16.0M
CPU 0.1
TTY False
Internal Hostname host.local
Http URL http://local.host.test/
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:24.759433+00:00
Job test-job
Owner test-user
Cluster default
Description test job description
Status running (ContainerRunning)
Image test-image
Entrypoint /usr/bin/make
Command test
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Internal Hostname host.local
Http URL http://local.host.test/
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:24.759433+00:00
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Resources Memory 16.0M
CPU 0.1
TTY False
Http URL http://local.host.test/
Http port 80
Http authentication True
Environment ENV_NAME_1 __value1__
ENV_NAME_2 **value2**
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Finished Sep 25 2018 at 12:28
Exit code 123
Description ErrorDesc
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Http URL http://local.host.test/
Http port 80
Http authentication True
Environment ENV_NAME_1 __value1__
ENV_NAME_2 **value2**
Created Sep 25 2018 at 12:28
Started Sep 25 2018 at 12:28
Finished Sep 25 2018 at 12:28
Exit code 123
Description ErrorDesc
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Resources Memory 16.0M
CPU 0.1
TTY False
Http URL http://local.host.test/
Http port 80
Http authentication True
Environment ENV_NAME_1 __value1__
ENV_NAME_2 **value2**
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:59.759433+00:00
Finished 2018-09-25T12:28:59.759433+00:00
Exit code 123
Description ErrorDesc
Job test-job
Name test-job-name
Owner test-user
Cluster default
Description test job description
Status failed (ErrorReason)
Image image:test-image:sometag
Command test-command
Price (credits / hour) 15.0000
Current cost 15.0000
Resources Memory 16.0M
CPU 0.1
TTY False
Http URL http://local.host.test/
Http port 80
Http authentication True
Environment ENV_NAME_1 __value1__
ENV_NAME_2 **value2**
Created 2018-09-25T12:28:21.298672+00:00
Started 2018-09-25T12:28:59.759433+00:00
Finished 2018-09-25T12:28:59.759433+00:00
Exit code 123
Description ErrorDesc
Loading