mlrun 部署及测试可用性

  1. 给k8s 集群中容器运行时配置代理

    然后重启docker
  2. 部署mlrun
    kubectl create namespace mlrun
    helm repo add mlrun https://mlrun.github.io/ce
    export http_proxy=xxx.xx.x.x
    export https_proxy=xxx.xx.x.x
    helm repo update
    helm pull mlrun-ce/mlrun-ce
    自己搭建的私有仓库无法在mlrun 中使用(只能使用公有docker仓库),需要手动修改配置文件
    run-ce/charts/nuclio/values.yaml
    在这里插入图片描述
    helm --namespace mlrun install mlrun-ce --wait --timeout 960s --set global.registry.url= ./mlrun-ce
    registry-url: 私有仓库地址
  3. demo 使用
    !pip install -U typing-extensions --proxy=http://x.x.x.x:10800/

########## For TF.Keras: ##########
#!pip uninstall tensorflow -y
#!pip install -U tensorflow==2.7.0

########## For PyTorch: ##########
!pip install -U torch1.10 --proxy=http://x.x.x.x:10800/
!pip install -U torchvision
0.11.1 --proxy=http://x.x.x.x:10800/

pip 使用 中需添加 代理不然会失败

Import the function:

import os
os.environ[‘HTTP_PROXY’]=“http://x.x.x.x:10800”
os.environ[‘HTTPS_PROXY’]=“http://x.x.x.x:10800”
open_archive_function = mlrun.import_function(“hub://open_archive”)
del(os.environ[‘HTTP_PROXY’])
del(os.environ[‘HTTPS_PROXY’])

Print the function’s documentation:

open_archive_function.doc()
python 代码执行中也不要添加代理
dataset_path = get_dataset_path()
open_archive_function.set_env(name=“HTTP_PROXY”, value=“http://x.x.x.x:10800”)
open_archive_function.set_env(name=“HTTPS_PROXY”, value=“http://x.x.x.x:10800”)
open_archive_function.set_env(name=“NO_PROXY”, value=“mlrun-api”)
部署的k8s 资源也需增加代理配置

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值