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

Python-chi 1.0 #66

Merged
merged 18 commits into from
Sep 26, 2024
Merged

Python-chi 1.0 #66

merged 18 commits into from
Sep 26, 2024

Conversation

Mark-Powers
Copy link
Contributor

@Mark-Powers Mark-Powers commented Sep 18, 2024

Soufiane Jounaid and others added 17 commits July 18, 2024 09:38
Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen
* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: Bool), sets openstack debug logging to true,
  including HTTP request logs
- _is_ipynb() -> Bool, checks if the code is running within an ipy
  notebook. Used to determine whether to execute widgets

* Added custom exceptions

Raised when argument is not valid. These errors might be fixed by checking hardware catalog or documentation. Examples where this might be seen are:
- Site name is not valid
- Node type is not valid
- e.g. Resource does not exist

Raised when a request has valid arguments, but the resources are being used incorrectly, or can’t be used as requested. This type of error might depend on the time the notebook is run, due to the shared nature of the testbed.
Examples:
- Nodes matching filters (e.g. node_type) are unavailable
- Cannot allocate FIP
- Allocation expires soon
- Allocation has insufficient SUs for request

Raised when an error occurs with some Chameleon resource.
For example, if your node is having hardware issues, and so fails to provision, this will be raised.

Replaced thrown exceptions with their appropriate custom exception
accross all modules.

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* Changed one more exception

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* typo

---------

Co-authored-by: Soufiane Jounaid <[email protected]>
Co-authored-by: Soufiane Jounaid <[email protected]>
Co-authored-by: Mark Powers <[email protected]>
* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: Bool), sets openstack debug logging to true,
  including HTTP request logs
- _is_ipynb() -> Bool, checks if the code is running within an ipy
  notebook. Used to determine whether to execute widgets

* Added custom exceptions

Raised when argument is not valid. These errors might be fixed by checking hardware catalog or documentation. Examples where this might be seen are:
- Site name is not valid
- Node type is not valid
- e.g. Resource does not exist

Raised when a request has valid arguments, but the resources are being used incorrectly, or can’t be used as requested. This type of error might depend on the time the notebook is run, due to the shared nature of the testbed.
Examples:
- Nodes matching filters (e.g. node_type) are unavailable
- Cannot allocate FIP
- Allocation expires soon
- Allocation has insufficient SUs for request

Raised when an error occurs with some Chameleon resource.
For example, if your node is having hardware issues, and so fails to provision, this will be raised.

Replaced thrown exceptions with their appropriate custom exception
accross all modules.

* Initial implementation of hardware module

Incomplete

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* Changed one more exception

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* typo

* Hardware module 1.0

Used to query hardware on Chameleon. the get_nodes() methods fetches a
list of nodes in the currently selected site in form of a list of Node
dataclass.

* Using allocation API to determine next free timeslot

---------

Co-authored-by: Soufiane Jounaid <[email protected]>
Co-authored-by: Soufiane Jounaid <[email protected]>
Co-authored-by: Mark Powers <[email protected]>
* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: Bool), sets openstack debug logging to true,
  including HTTP request logs
- _is_ipynb() -> Bool, checks if the code is running within an ipy
  notebook. Used to determine whether to execute widgets

* Added custom exceptions

Raised when argument is not valid. These errors might be fixed by checking hardware catalog or documentation. Examples where this might be seen are:
- Site name is not valid
- Node type is not valid
- e.g. Resource does not exist

Raised when a request has valid arguments, but the resources are being used incorrectly, or can’t be used as requested. This type of error might depend on the time the notebook is run, due to the shared nature of the testbed.
Examples:
- Nodes matching filters (e.g. node_type) are unavailable
- Cannot allocate FIP
- Allocation expires soon
- Allocation has insufficient SUs for request

Raised when an error occurs with some Chameleon resource.
For example, if your node is having hardware issues, and so fails to provision, this will be raised.

Replaced thrown exceptions with their appropriate custom exception
accross all modules.

* Initial implementation of hardware module

Incomplete

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* Changed one more exception

* Python-chi 1.0 context module

Added the following new methods:

- list_sites(show: [None, “widget”, “text”] = None) -> [str]
- list_projects(show: [None, “widget”, “text”] = None) -> [str]
- use_site(site_name: str = DEFAULT_SITE) -> None
- use_project(project_id: str = None) -> None
- choose_site() -> None, displays a dropdown widget to choose the site
- choose_project() -> None, displays a dropdown widget to choose the project
- check_credentials() -> None, prints authentication metadata
- set_log_level(debug: str), changes logging level to either ERROR or
  DEBUG, including HTTP request logs if the latter is chosen

* typo

* Hardware module 1.0

Used to query hardware on Chameleon. the get_nodes() methods fetches a
list of nodes in the currently selected site in form of a list of Node
dataclass.

* Lease 1.0, incomplete

* more fixes

* Fix doc formatting

* Adding review comments

* Lease 1.0, missing event retrieval

Implemented a new OOP interface for lease and added widget
representations.

list_leases and get_lease methods now return Lease objects instead of
dict.

---------

Co-authored-by: Soufiane Jounaid <[email protected]>
Co-authored-by: Soufiane Jounaid <[email protected]>
* Server 1.0

Implemented a redesign of the server module's OOP interfaces

### Add Server and Flavor Classes for Instance Management

#### Server Class
**Fields**
- `reservation_id: str`
- `addresses: {network: [ip,]}`
  - @Property which if an id is set, fetches the latest addresses
- `created_at: datetime`
- `flavor: str`
- `host_id: str`
- `host_status: str`
- `name: str`
- `hypervisor_hostname: str`
- `id: str`
- `image: Image`
- `is_locked: bool`
- `keypair: Keypair`
- `status`
  - @Property which if an id is set, fetches the latest status

**__init__**
```python
def __init__(
    name: str,
    reservation_id: str,
    image_name="CC-Ubuntu-22.04": str,
    image: Image,
    flavor_name="baremetal": str,
    key_name="$USER-jupyterhub",
    keypair: Keypair,
    network_name="sharednet1",
)
* Chi.Container 1.0 and added device res to Lease1.0

Implemented redesign of chi.container and added device reservations to
the lease module

* Fixed Backwards compat
* Chi.Container 1.0 and added device res to Lease1.0

Implemented redesign of chi.container and added device reservations to
the lease module

* Fixed Backwards compat

* Chi.magic (incomplete)

* Fixed more backwards compatibility issues and finished implementation of chi.util

* Added next_free_timeslot implementation

* reformatting comments

* Improvements accross the board, and finalized features

* Improvements to stability and error reporting

---------

Co-authored-by: Mark Powers <[email protected]>
@Mark-Powers Mark-Powers marked this pull request as ready for review September 20, 2024 18:09
@Mark-Powers Mark-Powers changed the title Dev Python-chi 1.0 Sep 26, 2024
@Mark-Powers Mark-Powers merged commit 16b6624 into master Sep 26, 2024
1 check failed
@Mark-Powers Mark-Powers mentioned this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants