lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
317 stars 105 forks source link

[Standalone] Add new cli commands for listing jobs and workers #1186

Closed JosepSampe closed 11 months ago

JosepSampe commented 11 months ago

For example:

josep@ubuntu:~$ lithops job list -b ibm_vpc
2023-11-03 17:11:03,052 [INFO] config.py:139 -- Lithops v3.0.2.dev0 - Python3.10
2023-11-03 17:11:03,245 [INFO] ibm_vpc.py:92 -- IBM VPC client created - Region: eu-gb
2023-11-03 17:11:11,866 [INFO] cli.py:680 -- Listing jobs submitted to VM instance lithops-master-b2ae13 (158.175.185.335)

Job ID         Function Name    Submitted                Runtime      Total Tasks  Status
-------------  ---------------  -----------------------  ---------  -------------  --------
d7d1f0-0-A000  hello()          2023-11-03 16:06:09 UTC  python3                1  done
cc7d66-0-A000  hello()          2023-11-03 16:09:44 UTC  python3                1  done

Total jobs: 2

josep@ubuntu:~$ lithops worker list -b ibm_vpc
2023-11-03 17:11:20,383 [INFO] config.py:139 -- Lithops v3.0.2.dev0 - Python3.10
2023-11-03 17:11:20,584 [INFO] ibm_vpc.py:92 -- IBM VPC client created - Region: eu-gb
2023-11-03 17:11:36,675 [INFO] cli.py:730 -- Listing available workers in VM instance lithops-master-b2ae13 (158.175.185.335)

Worker Name                        Instance Type      Worker Processes  Runtime    Execution Mode    Status
---------------------------------  ---------------  ------------------  ---------  ----------------  --------
lithops-worker-d7d1f0-0-a000-0000  bx2-4x16                          4  python3    reuse             active
lithops-worker-cc7d66-0-a000-0000  cx2-2x4                           2  python3    reuse             active

Total workers: 2

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.