OpenMined PyGrid CLI 用于基础设施和云部署
项目描述
部署 & CLI
OpenMined PyGrid CLI 提供了必要的支持,用于将各种 PyGrid 应用程序(包括(域、网络和工作者))的基础设施和部署管理到主要云提供商(AWS、GCP、Azure)通过 CLI 中集成的 Terraform 和 TerraScript 实现。
安装Terraform
查看说明
安装CLI
使用pip(推荐)
pip install pygrid-cli
手动安装
要开始,首先通过以下命令安装CLI
克隆PyGrid仓库
git clone https://github.com/OpenMined/PyGrid.git
然后通过pip安装python包
pip install -e .
CLI说明
使用PyGrid CLI非常简单,通过此命令 pygrid deploy
然后按照以下命令中的说明成功部署特定的pygrid应用程序
CLI命令列表
将域部署到AWS
pygrid deploy --provider aws --app domain
将网络部署到Azure
pygrid deploy --provider azure --app network
CLI说明示例
$ pygrid deploy [7h 19m]
Welcome to OpenMined PyGrid CLI
Cloud Provider: (AWS, GCP, AZURE) [AWS]: AWS
PyGrid App: (Domain, Network) [Domain]: Domain
Please enter path to your aws credentials json file [/Users/amrmkayid/.aws/credentials.json]:
Will you need to support Websockets? [y/N]: N
How many servers do you wish to deploy? (All are managed under the load balancer) [1]: 1
#1: PyGrid Domain ID: domain-demo
#1: Port number of the socket.io server [5000]:
? Please select your desired AWS region eu-west-2
? Please select at least two availability zones. (Not sure? Select the first two) done (3 selections)
? Please select an AWS instance category. General Purpose Instances
? Please select your desired AWS instance. Instance: t2.xlarge Memory: 16.0 GB CPUs: 4
? Please set a username for your Database amrmkayid
? Enter a password for your Database (length > 8) **********
? Enter the password again **********
Your current configration are:
{
"pygrid_root_path": "/Users/amrmkayid/.pygrid/cli",
"output_file": "/Users/amrmkayid/.pygrid/cli/config_2021-03-30_011924.json",
"provider": "aws",
"app": {
"name": "domain",
"count": 1
},
"root_dir": "/Users/amrmkayid/.pygrid/apps/aws/domain",
"serverless": false,
"websockets": false,
"apps": [
{
"id": "domain-demo",
"port": 5000
}
],
"vpc": {
"region": "eu-west-2",
"av_zones": [
"eu-west-2a",
"eu-west-2b",
"eu-west-2c"
],
"instance_type": {
"InstanceType": "t2.xlarge"
}
}
}
Continue? [y/N]:
全服务器和服务器无部署
资源管理器(PM2)
云服务提供商
PyGrid CLI 为以下云服务提供商提供全面支持
获取云凭证
AWS 凭证
您需要获取
{
"aws_access_key_id": "XXXXXXXXXXXXXXXXXXXX",
"aws_secret_access_key": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
并将凭证存储在您的主目录中的此文件夹 ~/.aws/credentials.json
- 查找密钥的说明在此处:[https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys)
GCP 凭证
您需要使用 GCP 服务帐户 提供身份验证并获取所需凭证
在此处添加凭证的说明:[https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials](https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started#adding-credentials)
或通过使用 GCloud CLI 并通过此命令登录到您的 GCP 提供商
gcloud auth application-default login
AZURE 凭证
您需要这些密钥
application_id = "APPLICATION_ID"
subscription_id = "SUBSCRIPTION_ID"
tenant_id = "TENANT_ID"
key = "KEY"
并将它们作为 AZURE 凭证提供给 PyGrid CLI
-
获取 subscription_id 值的说明:[https://blogs.msdn.microsoft.com/mschray/2015/05/13/getting-your-azure-guid-subscription-id/](https://blogs.msdn.microsoft.com/mschray/2015/05/13/getting-your-azure-guid-subscription-id/)
-
获取 tenant_id、application_id、key 值的说明:[https://docs.microsoft.com/en-ca/azure/active-directory/develop/howto-create-service-principal-portal](https://docs.microsoft.com/en-ca/azure/active-directory/develop/howto-create-service-principal-portal)
项目详情
下载文件
下载您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。
源分布
构建分布
pygrid-cli-0.5.0.tar.gz 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 9604f0e5b3a28cba1733717008ff0c428d2c1d18c28d31f6cdf8c96206692f1e |
|
MD5 | 1797f7c79df7112a7cdb16bc83c617cd |
|
BLAKE2b-256 | d65de807d5bf5076b9910f8e3f6b2a47decedb318e6fd04ca6f10e9feb92ac73 |
pygrid_cli-0.5.0-py3-none-any.whl 的散列
算法 | 散列摘要 | |
---|---|---|
SHA256 | 00ff1de5606daf6620ccfb8d7e074b2d42ff20616ff64d4fa782448bef06d2e0 |
|
MD5 | 6b7c11acf548794baf4c3c7458071447 |
|
BLAKE2b-256 | 6c83c86d319e5ffec557120c015742829a20297e4e7c7065cfe1cb4cec9b370a |