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

Soufianej server 1.0 #62

Merged
merged 20 commits into from
Aug 2, 2024
Merged

Soufianej server 1.0 #62

merged 20 commits into from
Aug 2, 2024

Commits on Jul 15, 2024

  1. 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
    Soufiane Jounaid authored and Soufiane Jounaid committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    bf43eba View commit details
    Browse the repository at this point in the history
  2. 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.
    Soufiane Jounaid committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    4b00222 View commit details
    Browse the repository at this point in the history
  3. Initial implementation of hardware module

    Incomplete
    Soufiane Jounaid committed Jul 15, 2024
    Configuration menu
    Copy the full SHA
    6b0085c View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2024

  1. 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
    Soufiane Jounaid committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    4d29fd7 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    07b105f View commit details
    Browse the repository at this point in the history

Commits on Jul 18, 2024

  1. Configuration menu
    Copy the full SHA
    caaf5eb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0708ccf View commit details
    Browse the repository at this point in the history
  3. 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
    Soufiane Jounaid authored and JOUNAIDSoufiane committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    0e4cbf1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    720d3d8 View commit details
    Browse the repository at this point in the history
  5. typo

    JOUNAIDSoufiane committed Jul 18, 2024
    Configuration menu
    Copy the full SHA
    d114355 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8af1ba3 View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2024

  1. 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.
    JOUNAIDSoufiane committed Jul 19, 2024
    Configuration menu
    Copy the full SHA
    035384b View commit details
    Browse the repository at this point in the history

Commits on Jul 22, 2024

  1. Lease 1.0, incomplete

    JOUNAIDSoufiane committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    cfc33bd View commit details
    Browse the repository at this point in the history
  2. more fixes

    JOUNAIDSoufiane committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    af7cd1e View commit details
    Browse the repository at this point in the history
  3. Fix doc formatting

    JOUNAIDSoufiane committed Jul 22, 2024
    Configuration menu
    Copy the full SHA
    16ff785 View commit details
    Browse the repository at this point in the history

Commits on Jul 31, 2024

  1. Configuration menu
    Copy the full SHA
    ddaea69 View commit details
    Browse the repository at this point in the history
  2. 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.
    JOUNAIDSoufiane committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    6eed7c8 View commit details
    Browse the repository at this point in the history
  3. Merge branch 'soufianej-lease-1.0' of github.com:ChameleonCloud/pytho…

    …n-chi into soufianej-lease-1.0
    JOUNAIDSoufiane committed Jul 31, 2024
    Configuration menu
    Copy the full SHA
    c259d02 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2024

  1. Server 1.0

    Implemented a redesign of the server module's OOP interfaces
    
    class Server
    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__(
    	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”,
    )
    Args
    name - the name of the instance
    reservation_id - the uuid of the host reservation to draw this instance on. Can be obtained via my_lease.node_reservations[0][“id”]
    image_name the name of the image to boot
    image - Image object optionally given instead of image_name.
    flavor_name - the name of the flavor
    key_name - the keypair to use for this instance
    keypair - Keypair object optionally given instead of key_name
    network_name - the network to launch this server on.
    
    submit(
    	count=1,
    	wait_for_active: bool = True, #
    	wait_timeout: seconds,
    	show=[”widget”, “text”].
    	idempotent=False,
    ) -> [Server]
    Args:
    count - The number of servers to create with these details.
    wait_for_active - If true, this method will block until the lease is in an active state.
    wait_timeout - how many seconds to wait until a timeout.
    idempotent - If true, first try to get a server with the same name. If one does not exist, run submit as normal.
    Submits this server object to be created.  If count is greater than 1, several servers will be created, and the list of Server objects will be returned, instead of self being modified in place.
    Implementation: This should cache the details for the server in the fields.
    delete() -> None
    wait(status=”active” : str) -> None
    Waits until the server is a given status
    show(
    	type=[“text”, “widget”] : str,
    	wait_for_active : bool,
    ) -> None
    Displays this server in the format specified by the user. Either a textual representation printed to stdout or as a widget table. If wait_for_active and type=widget, then the widget representation will display immediately, and update once the server status changes. If wait_for_active and type=text, displays once server is active.
    check_connectivity(
    	wait=True : bool,
    	port=22 : int,
    	timeout=500 : int,
    	type=[“widget”, “text”]: str
    ) -> bool
    Args
    wait - Whether to wait for connectivity, or check once
    port - the port to check on
    timeout - how many seconds to wait for
    type - The type of output to display. Will output a timer showing how long this function has waited for. If set to None, displays nothing.
    Periodically checks that the given port is open, and returns true if a TCP connection can be made to it.
    associate_floating_ip(fip=None : str)
    args:
    fip the fip to associate to this instance, which must be allocated to the project. If none, will allocate a new IP to the project, and associate that. Can be gotten from a lease via my_lease.fip_reservations[0][“address”]
    Associates a fip to the server.
    detach_floating_ip(fip : str)
    args
    fip the fip to detach from this server.
    ssh_connection()
    Returns a Fabric Connection object that may be used to run SSH commands.
    upload(
    	file : str,
    	remote_path=”” : str,
    )
    Uploads the file or directory specified to the remote path
    execute(command: str)
    Runs a command over SSH on the node.
    list_servers() -> [Server]
    Returns all servers in the current project
    get_server(name) -> Server
    Gets the a server with the given name.
    class Flavor
    Fields
    disk: int
    ram: int
    vcpus: int
    name: str
    get_flavors() -> [Flavor]
    Gets a list of all flavors
    JOUNAIDSoufiane committed Aug 1, 2024
    Configuration menu
    Copy the full SHA
    ccc71f0 View commit details
    Browse the repository at this point in the history

Commits on Aug 2, 2024

  1. Configuration menu
    Copy the full SHA
    9c961ff View commit details
    Browse the repository at this point in the history