跳转到主要内容

Mobius 多测试平台框架

项目描述

Mobius-python

目录

描述

Mobius API 是一个 Python 库,它简化了各种云(如 FABRIC、Chameleon)的原生云接口,并添加了许多常用于创建实验的附加功能。

开始使用 Mobius API 的最简单方法是使用下面的示例。

    # Create a controller obect
    # Default slice name is picked up from the config file
    controller = Controller(config_file_location="./config.yml")
    # User specified slice name is used to identify the resources
    #controller = Controller(config_file_location="./config.yml", slice_name="test-slice")
    # Provision the resources as specified in the configuration file
    controller.create()
    # Get the provisioned resources
    resources = controller.get_resources()
    # Print the resources provisioned
    for r in resources:
        print(r)
        print(r.list_nodes())

用户应提供一个包含其凭证和资源参数的配置文件 config.yml。可以使用模板 mobius/config/config_template.yml 创建 config.yml。以下是需要更新的参数列表。

  • 更新用于已配置的 VM/Bare Metals 的 SSH 公钥和私钥文件
runtime:
  slice-private-key-location: /Users/kthare10/.ssh/id_rsa
  slice-public-key-location: /Users/kthare10/.ssh/id_rsa.pub
  • 更新 FABRIC 凭据
    • 用户 FABRIC 令牌的位置
    • 用户的堡垒用户名
    • 用户 Fabric 堡垒私钥
    • 用户的 Project Id
fabric:
  token-location: /Users/kthare10/renci/code/fabric/notebooks/tokens.json
  bastion-user-name: kthare10_0011904101
  bastion-key-location: /Users/kthare10/.ssh/fabric-bastion
  project_id: b9847fa1-13ef-49f9-9e07-ae6ad06cda3f
  • 更新 Chameleon 凭据
    • 用户名
    • 密码
    • 密钥对
    • 项目名称
    • 项目 Id
chameleon:
  user: kthare10
  password: 
  key_pair: kthare10
  project_name: CH-822154
  project_id:
    tacc: a400724e818d40cbba1a5c6b5e714462
    uc: ae76673270164b048b59d3bd30676721
    kvm: a400724e818d40cbba1a5c6b5e714462
    edge:
  • 更新资源计数
    • 根据资源应配置的位置,设置计数为 0 或更多。
    • 如果需要在其他位置使用资源,请复制并添加更多资源块
    • 根据需要更改其他参数
resources:
    - resource:
        type: VM
        site: RENC # use FABRIC.RANDOM to choose a random site instead
        count: 1
        image: default_rocky_8
        nic_model: NIC_Basic # NIC_Basic(SRIOV), NIC_ConnectX_5 => 25GB, NIC_ConnectX_6 => 100GB
        name_prefix: node
        network:
          type: IPv6 # Allowed values IPv4 or IPv6
        flavor:
          cores: 2
          ram: 8
          disk: 10

    - resource:
        type: Baremetal
        site: KVM@TACC
        count: 1
        image: CC-CentOS8
        network:
          type: sharednet1
        name_prefix: node
        flavor:
          name: m1.large

安装

您可以使用以下命令进行安装

pip install mobius-py

要求

需要 Python 3.9 或更高版本

项目详情


下载文件

下载您平台对应的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源代码分发

mobius-py-1.3.1.tar.gz (17.0 kB 查看哈希)

上传时间 源代码

构建分发

mobius_py-1.3.1-py3-none-any.whl (25.5 kB 查看哈希)

上传时间 Python 3

由以下支持