k8s tensorflow
Online learning
Kubeflow实战系列
Prepare
了解ksonnet
初探Google之Kubeflow (采用的是0.8.0)install dep
install ks
Kubeflow 安利:在 Kubernetes 上进行机器学习ksonnet功能类似helm kubernetes应用的包管理工具。 可以对比存裸部署spark
Kubeflow 入门Jupyter notebook入门教程(上) - CSDN博客 Jupyter notebook教程 (more)
Docker 入门教程
最新的安装方式:
KSURL="https://github.com/kubeflow/kubeflow/releases/latest"
LASTURL=""
LASTURL=$(curl $KSURL -s -L -I -o /dev/null -w '%{url_effective}')
if (test $? -ne ); then
LASTURL=$(wget -O /dev/null --content-disposition $KSURL >& |awk '/^Location: /{print $2}')
if [ $? -ne ]; then
echo "Error: Can not find the latest ksonnet version by wget."
fi
fi LATES=${LASTURL##*/}
echo $LATES mkdir kubeflow_$LATES
cd kubeflow_$LATES
export KUBEFLOW_TAG=$LATES curl https://raw.githubusercontent.com/kubeflow/kubeflow/${KUBEFLOW_TAG}/scripts/download.sh | bash
echo "Please run:"
echo "export KUBEFLOW_SRC=`pwd`"
echo "export KFAPP=~/kfapp"
cat > `pwd`/kubeflow.env <<EOL
export KUBEFLOW_TAG=$LATES
export KUBEFLOW_SRC=`pwd`
export KFAPP=~/kfapp
EOL
echo "Please run the commnad before doing any kubeflow setting up:"
echo "source `pwd`/kubeflow.env"
------------------------------------------------
以下是陈旧的安装方式源代码安装ksonnet脚本(ksonnet的变化很大, 经常出问题。 不建议源码安装)
go get -u github.com/golang/dep/cmd/dep
go get github.com/ksonnet/ksonnet # Build and install binary under shortname `ks` into $GOPATH/bin
cd $GOPATH/src/github.com/ksonnet/ksonnet
sudo -E -H make install
export KUBECONFIG=/var/run/kubernetes/admin.kubeconfig
安装最最新发布版的ksonnet
KSURL="https://github.com/ksonnet/ksonnet/releases/latest"
LASTURL=""
LASTURL=$(curl $KSURL -s -L -I -o /dev/null -w '%{url_effective}')
if (test $? -ne ); then
LASTURL=$(wget -O /dev/null --content-disposition $KSURL >& |awk '/^Location: /{print $2}')
if [ $? -ne ]; then
echo "Error: Can not find the latest ksonnet version by wget."
fi
fi
LATES=""
if [ "$LASTURL" = "$KSURL" ]; then
echo "Error: Not find the latest ksonnet version by curl."
else
if test -n "$LASTURL"; then
echo "OK: Find the latest ksonnet version."
else
echo "Error: Not find the latest ksonnet version by wget."
fi
fi
LATES=${LASTURL##*/}
if [[ $LATES =~ ^v[-.]{,}$ ]]; then
LATES=${LATES#v}
fi
wget https://github.com/ksonnet/ksonnet/releases/download/v$LATES/ks_${LATES}_linux_amd64.tar.gz GOROOT=/usr/local
tar -C $GOROOT/bin -xzf ks_${LATES}_linux_amd64.tar.gz --wildcards --no-anchored 'ks'
ln -s $GOROOT/bin/ks_${LATES}_linux_amd64/ks $GOROOT/bin/ks
# tar --extract --file=ks_0..0_linux_amd64.tar.gz ks_0..0_linux_amd64/ks
Using Kubeflow (翻译) (中文) (latest EN)
(中文简要介绍)
ks init my-kubeflow
sudo chown $USER:$USER ~/my-kubeflow -R
cd my-kubeflow
ks registry add kubeflow \
github.com/google/kubeflow/tree/master/kubeflow
ks pkg install kubeflow/core
ks pkg install kubeflow/tf-serving
ks pkg install kubeflow/tf-job
ks generate core kubeflow-core --name=kubeflow-core
check kubectl contexts:
kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: REDACTED
server: https://localhost:6443/
name: local-up-cluster
contexts:
- context:
cluster: local-up-cluster
user: local-up-cluster
name: local-up-cluster
current-context: local-up-cluster
kind: Config
preferences: {}
users:
- name: local-up-cluster
user:
client-certificate-data: REDACTED
client-key-data: REDACTED
Jupyter启动之后运行tf的example
Troubleshooting
1.
$ sudo -E -H ks pkg install kubeflow/core
ERROR GET https://api.github.com/repos/google/kubeflow/commits/master: 403 API rate limit exceeded for 134.134.139.74. (But here's the good news: Authenticated requests get a higher rate limit. Check out the documentation for more details.) [rate reset in 26m21s]
403 API rate limit of 60 still exceeded
GTOKEN=801c4f41553571107afa06d459c0910900aeb5fb
GTOKEN=5d67c71ea35d85a5459e6e05a3075363d438b8c7
export GITHUB_TOKEN=$GTOKEN
echo "GITHUB_TOKEN=$GTOKEN" >> ~/.profile
2. Can not ks apply default -c kubeflow-core with ks 0.9.5
rollback to v0.8.0
@seekyiyi I have the same problem using v0.9.1(or dev build) version of ksonnet, but I use v0.8.0 can be solved.
centos 下安装go
git clone https://github.com/jamesarems/gocentos.git
cd gocentos
sh InstallGO.sh
source /etc/profile
go get -u github.com/golang/dep/cmd/dep
echo 'GOROOT=`go env |grep "GOROOT" |cut -d "=" -f2`
GOROOT=${GOROOT#\"}
GOROOT=${GOROOT%\"}
echo $GOROOT GOPATH=`go env |grep GOPATH |cut -d "=" -f `
GOPATH=${GOPATH%\"}
GOPATH=${GOPATH#\"}
echo $GOPATH
declare -x GOROOT
declare -x GOPATH
export PATH=${PATH}:${GOROOT}/bin:${GOPATH}/bin' >> ~/.bashrc source ~/.bashrc
echo $GOPATH
go get github.com/ksonnet/ksonnet
cd $GOPATH/src/github.com/ksonnet/ksonnet
make install
export KUBECONFIG=/root/config
ks init my-kubeflow
wget -O /dev/null --content-disposition https://github.com/ksonnet/ksonnet/releases/latest --server-response 2>&1 | awk '(NR==1){SRC=$3;} /^ Location: /{DEST=$2} END{ print SRC, DEST}' https://github.com/ksonnet/ksonnet/releases/latest https://github.com/ksonnet/ksonnet/releases/tag/v0.11.0
setup local registry (git hub)
Sharing a local registry with minikube(推荐)
Kubernetes镜像仓库-Harbor的Helm部署
在kubernetes 集群上搭建docker 私有仓库Harbor
Get latest Github app version:
# cat github-latest.sh
#!/bin/bash
URL=$
APPURL=${URL%/releases/latest*}
APP=${APPURL##*/}
LASTURL=""
LASTURL=$(curl $URL -s -L -I -o /dev/null -w '%{url_effective}')
if (test $? -ne ); then
LASTURL=$(wget -O /dev/null --content-disposition $URL >& |awk '/^Location: /{print $2}')
if [ $? -ne ]; then
echo "Error: Can not find the latest $APP version by wget."
fi
fi
LATES=""
if [ "$LASTURL" = "$URL" ]; then
echo "Error: Not find the latest $APP version by curl."
else
if test -n "$LASTURL"; then
echo "OK: Find the latest $APP version."
else
echo "Error: Not find the latest $APP version by wget."
fi
fi
LATES=${LASTURL##*/}
if [[ $LATES =~ ^v[-.]{,}$ ]]; then
LATES=${LATES#v}
fi
echo "Version:$LATES"
exit
URL=https://github.com/goharbor/harbor/releases/latest
V=`./github-latest.sh $URL|grep Version: |cut -d ":" -f2` BIN=https://storage.googleapis.com/harbor-releases/harbor-offline-installer-v$V.tgz wget $BIN
k8s tensorflow的更多相关文章
- TensorFlow的开源与Hadoop的开源
最近看TensorFlow代码的时候,用Git pull下来最新的master一看,哇好多的更新,然后点击去之前看到一半的cc文件继续看,好多地方都改变了.但是一看Git log,有好多巨大的comm ...
- Tensorflow serving with Kubernetes
1.Build docker image 由于自己build镜像总是遇到问题,此处暂时借用dockerhub上的一个镜像 docker.io/mochin/tensorflow-serving 将此镜 ...
- kubeflow 创建tensorflow过程
online deployable ,install k8s 代码 Kubeflow有三个核心组件 TFJob Operator 和 Controller: 作为Kubernetes的扩展,来简化分布 ...
- 『TensorFlow』卷积层、池化层详解
一.前向计算和反向传播数学过程讲解
- 使用NNI的scikit-learn以及Tensorflow分析
一.NNI简介 NNI (Neural Network Intelligence) 是自动机器学习(AutoML)的工具包. 它通过多种调优的算法来搜索最好的神经网络结构和(或)超参,并支持单机.本地 ...
- K8S全栈容器服务如何助力企业云化创新?
容器编排管理平台Kubernetes在实践两年多后,市场主导地位被正式确定,随着首批认证服务商的宣布,围绕着容器的应用编排部署服务已然成熟,Kubernetes开始在商业场景为企业创造价值.华为云在K ...
- Tensorflow Serving介绍及部署安装
TensorFlow Serving 是一个用于机器学习模型 serving 的高性能开源库.它可以将训练好的机器学习模型部署到线上,使用 gRPC 作为接口接受外部调用.更加让人眼前一亮的是,它支持 ...
- 从零开始入门 K8s | 可观测性:监控与日志
作者 | 莫源 阿里巴巴技术专家 一.背景 监控和日志是大型分布式系统的重要基础设施,监控可以帮助开发者查看系统的运行状态,而日志可以协助问题的排查和诊断. 在 Kubernetes 中,监控和日志 ...
- 一文看懂 K8s 日志系统设计和实践
上一篇中我们介绍了为什么需要一个日志系统.为什么云原生下的日志系统如此重要以及云原生下日志系统的建设难点,相信DevOps.SRE.运维等同学看了是深有体会的.本篇文章单刀直入,会直接跟大家分享一下如 ...
随机推荐
- winrar自解压释放路径详解
因为在 WINRAR 的帮助文件中没有对自解压路径和系统的环境变量之间作说明,所以,很多人只知道,其自解压路径可以智能定位到系统的 PROGRAM FILES 目录,而不知道它其实还可以智能定位到系统 ...
- response的contentType的类型值Response.ContentType
MIME类型的含义 MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型,当该扩展名文件被访问的时候,浏览器会自动使用指定应用程序来打开.多用于指定一些客户端自定义的文件名,以及一些媒体 ...
- 安装python sklearn经验总结
1. 需要安装 numpy, scipy, 和sklearn和ipython,Cython sklearn,ipython, Cython都可以通过pip来安装.但scipy,可能还有numpy必须通 ...
- iOS 上传自己的库到cocoapod
最近自己写了个库,传到github上,想让自己的库支持cocoapod,这里我看了很多相关文章.下面我就写下详细步骤以及会遇到的问题. 我们会使用trunk的方式提交到cocoa pod 这是2014 ...
- 关于事件循环机制event loop
setTimeout(()=> { console.log('settimeout') },100) console.log('开始') console.log('结束') new Promis ...
- 用URLRewriter重写url
用url重新一般都是使用URLRewriter库,基本上都是一些配置,在webconfig中 首先配置configuration节点 <configSections> <sectio ...
- VC6.0 error LNK2001: unresolved external symbol __imp__ntohl@4
--------------------Configuration: oxToint1 - Win32 Debug-------------------- Linking... main.obj : ...
- python将目录切换为脚本所在目录
os.chdir(os.path.abspath(os.path.dirname(sys.argv[0])))
- [3]传奇3服务器源码分析一 DBServer
留存 服务端下载地址: 点击这里
- TCP连接图示
转移2018.4.6 自己总结绘图