gcp devops

By: Edward Krueger and Douglas Franklin.

作者: 爱德华·克鲁格 ( Edward Krueger)和道格拉斯·富兰克林 ( Douglas Franklin) 。

In this article, we will cover how to set up a cloud computing instance to run Python with or without Jupyter Notebook. Then we show how to connect that instance to Github for a smooth cloud workflow.

在本文中,我们将介绍如何设置云计算实例以在有或没有Jupyter Notebook的情况下运行Python。 然后,我们展示了如何将该实例连接到Github,以实现流畅的云工作流程。

We utilize cloud computing instances to get flexible Python and Jupyter environments while maintaining the reproducibility of enterprise data science platforms.

我们利用云计算实例来获得灵活的Python和Jupyter环境,同时保持企业数据科学平台的可重复性。

These AI platform notebooks come configured with many data science and analytics packages, including NumPy, Pandas, Scikit-learn and TensorFlow. Typically, we would discourage the use of bloated virtual machines. However, package bloat on our analytics machine isn’t as much of a problem because we only save the result (model, data, report) for later use. Needing only this result and the few packages needed to run our model allows us to disregard the numerous packages on the VM.

这些AI平台笔记本配置了许多数据科学和分析软件包,包括NumPy,Pandas,Scikit-learn和TensorFlow。 通常,我们不鼓励使用of肿的虚拟机。 但是,由于我们只保存结果(模型,数据,报告)供以后使用,因此我们的分析机上的软件包膨胀并不是什么大问题。 只需要这个结果和运行模型所需的几个软件包,就可以忽略VM上的众多软件包。

For example, in this Medium article, we push an NLP mode to the cloud without having to worry about dependencies.

例如,在这篇中型文章中,我们将NLP模式推到了云端,而不必担心依赖关系。

Note that AI platform notebooks have all of the client packages for GCP services installed and are already authenticated to allow easy access to anything within the same GCP project. Additionally, this platform gives us not just access to Jupyter Notebooks, but also a Python console and a CLI where we can run BASH commands.

请注意,AI平台笔记本电脑已安装了所有用于GCP服务的客户端软件包,并且已经过身份验证,可以轻松访问同一GCP项目中的任何内容。 此外,该平台使我们不仅可以访问Jupyter Notebook,而且还可以使用Python控制台和CLI来运行BASH命令。

取得GCP帐户 (Getting a GCP account)

Google’s AI Platform Notebooks offer a JupyterLab and Python environment for data scientists and machine learning developers to experiment, develop, and deploy models into production. Users can create instances running JupyterLab that come pre-installed with common packages.

Google的AI平台笔记本为数据科学家和机器学习开发人员提供JupyterLab和Python环境,以进行实验,开发并将模型部署到生产中。 用户可以创建预装有通用软件包的运行JupyterLab的实例。

Before we can set up an AI Platform Notebook, we will have to set up an account and billing, don’t worry new users get $300 in free credits!

在我们设置AI Platform Notebook之前,我们必须先设置一个帐户并进行结算,不要担心新用户将获得300美元的免费积分!

Visit GCP AI Platform and click ‘go to console.’

访问GCP AI平台 ,然后单击“转到控制台”。

Be sure to click ‘Enable API’ below to access notebooks.

确保单击下面的“启用API”以访问笔记本。

Enable API
启用API

Once we have billing set up, we can start a project.

设置好帐单后,我们可以开始一个项目。

启动您的第一个GCP AI Platform Notebook实例 (Starting up your first GCP AI Platform Notebook Instance)

Now we need to select the hardware we want our virtual machine to run on. Be sure to set up the cheapest machine possible if you are testing this out!

现在,我们需要选择要在其上运行虚拟机的硬件。 如果要进行测试,请务必设置最便宜的机器!

Once we have the API enabled, the popup selections will change to those seen below, click ‘Go to instances page’ to get started.

启用API后,弹出式菜单选择将变为以下所示,单击“转到实例页面”开始使用。

Click GO TO INSTANCES PAGE
单击转到实例页面

The instances page might have you select ‘Enable API’ another time, be sure to do so. Then click on the ‘New Instance’ button and select ‘Python 2 and 3.’

实例页面可能会让您再次选择“启用API”,请务必选择。 然后点击“新实例”按钮并选择“ Python 2和3”。

Notebook Instances
笔记本实例

This will open up an options menu where you’ll input the region you’d like to use. Note that different regions can have different pricing. Once you have a region selected, you will want to click ‘Customize’ and select the machine with the least RAM to have the lowest cost. In our case, it is the ‘n1-standard-1’ VM with 3.75GB of RAM.

这将打开一个选项菜单,您可以在其中输入要使用的区域。 请注意,不同地区的定价可能不同。 选定区域后,将需要单击“自定义”,然后选择RAM最少的机器以降低成本。 在我们的案例中,它是具有3.75GB RAM的“ n1-standard-1” VM。

This instance will only generate fees when it is running and can be easily paused at any time! If needed, you can swap out hardware with the dropdown menus seen below while the instance is paused.

该实例仅在运行时才会产生费用,并且可以随时轻松暂停! 如果需要,您可以在实例暂停时通过下面显示的下拉菜单交换硬件。

Selecting a low-cost machine
选择低成本机器

Now we can use SSH to connect our VM to GitHub to allow us to push and pull to our repositories with ease.

现在,我们可以使用SSH将虚拟机连接到GitHub,从而使我们可以轻松地push存储库pushpull

设置SSH (Setting Up SSH)

Be aware you will only have to do this once per instance.

请注意,每个实例只需执行一次。

使用SSH连接到GitHub (Connecting to GitHub with ssh)

  1. Generate an ssh key by running ssh-keygen and accepting the defaults by leaving them blank and pressing the enter key. This command generates files at user/.ssh/id_rsa that you’ll need to enter into GitHub.

    通过运行ssh-keygen生成ssh密钥,并通过将其保留为空白并按Enter键来接受默认值。 此命令在user/.ssh/id_rsa处生成文件,您需要将这些文件输入GitHub。

ssh-keygen
ssh-keygen

2. Copy your public key to your clipboard. One way to do this is by running cat ~/.ssh/id_rsa.pub to return the public key text into your console, display its contents, and then copy with the mouse and keyboard.

2.将您的公钥复制到剪贴板。 一种方法是运行cat ~/.ssh/id_rsa.pub将公钥文本返回到控制台,显示其内容,然后使用鼠标和键盘进行复制。

using cat to get our key
用猫拿到我们的钥匙

3. Go to github.com and sign in.

3.转到gi​​thub.com并登录。

4. Click your profile image in the top right and then click “Settings.”

4.单击右上角的个人资料图片,然后单击“设置”。

5. On the left-hand side, click “SSH and GPG keys.”

5.在左侧,单击“ SSH和GPG密钥”。

6. On the top right, click “New SSH key.”

6.在右上方,单击“新建SSH密钥”。

7. Set the title to whatever you like. The “Title” is your choice, but it will help you identify what computer this authorization authorizes. Paste the copied key into the “Key” field and press “Add SSH key.”

7.将标题设置为任何您喜欢的名称。 您可以选择“标题”,但这将帮助您确定此授权授权的计算机。 将复制的密钥粘贴到“密钥”字段中,然后按“添加SSH密钥”。

8. Go back to your computer and run eval 'ssh-agent -s' to start your ssh authentication agent.

8.返回计算机并运行eval 'ssh-agent -s'以启动ssh身份验证代理。

Steps 8 and 9 adding our ssh-key
步骤8和9添加我们的ssh-key

9. Run ssh-addto add your private key so that the agent can authenticate the public key.

9.运行ssh-add添加您的私钥,以便代理可以验证公钥。

10. Set your git configuration so that GitHub knows who you are by running git config --global user.email you@email.com and git config --global user.name username, where the email and username are those attached to your GitHub account.

10.设置您的git配置,以便GitHub通过运行git config --global user.email you@email.comgit config --global user.name username知道您的git config --global user.name username ,其中电子邮件和用户名是附加到GitHub上的电子邮件和用户名帐户。

Now you can git clone any repository you have access too right onto the VM, make changes to the code, and push them back to the repository!

现在,您可以git clone任何有权访问的存储库直接git clone到VM上,对代码进行更改,然后将其推回到存储库中!

结论 (Conclusion)

We’ve discussed how to set up a cloud computing instance to run Python, BASH, and Jupyter Notebooks and how to connect that instance to Github for an easy and secure cloud workflow.

我们已经讨论了如何设置一个云计算实例来运行Python,BASH和Jupyter Notebook,以及如何将该实例连接到Github,以实现简单而安全的云工作流程。

This workflow is great because it is so reproducible! Teams using VMs like this will encounter less of the ‘it works on my machine’ bugs. Using ssh to connect the cloud VM and our remote repositories provide a safe connection to protect your data. Additionally, if you want to run code on expensive hardware, you don’t have to buy that hardware! Instead, run what you need and pause your instance to save costs.

这个工作流程很棒,因为它是如此的可复制! 使用此类VM的团队将遇到较少的“在我的计算机上运行”错误。 使用ssh连接云VM和我们的远程存储库可提供安全的连接来保护您的数据。 此外,如果您想在昂贵的硬件上运行代码,则不必购买该硬件! 而是运行所需的内容并暂停实例以节省成本。

We hope this guide has been helpful and that your coding skills are leveling up with us!

我们希望本指南对您有所帮助,并且您的编码技能正在与我们一起发展!

翻译自: https://towardsdatascience.com/using-gcp-ai-platform-notebooks-as-reproducible-data-science-environments-964cba32737

gcp devops


http://www.taodudu.cc/news/show-997626.html

相关文章:

  • 电力现货市场现货需求_现货与情绪:现货铜市场中的自然语言处理与情绪评分
  • sap wm内向交货步骤_内向型人在数据科学中成功的五个有效步骤
  • 数据库备份策略 分布式_管理优秀的分布式数据团队的4种基本策略
  • 深度学习 免费课程_2020年排名前三的免费深度学习课程
  • 机器学习:分类_机器学习基础:K最近邻居分类
  • 将PDF和Gutenberg文档格式转换为文本:生产中的自然语言处理
  • 协方差意味着什么_“零”到底意味着什么?
  • 全栈入门_启动数据栈入门包(2020)
  • marlin 三角洲_三角洲湖泊和数据湖泊-入门
  • 机器学习 建立模型_建立生产的机器学习系统
  • 风能matlab仿真_发现潜力:使用计算机视觉对可再生风能发电场的主要区域进行分类(第1部分)
  • 实验人员考评指标_了解实验指标
  • nba数据库统计_NBA板块的价值-从统计学上讲
  • 两个链接合并_如何找到两个链接列表的合并点
  • 工程师的成熟模型_数据工程师的成熟度
  • scrape创建_确实在2分钟内对Scrape公司进行了评论和评分
  • 如何不认识自己
  • plotly python_使用Plotly for Python时的基本思路
  • java项目经验行业_行业研究以及如何炫耀您的项目
  • 数据科学 python_适用于数据科学的Python vs(和)R
  • r怎么对两组数据统计检验_数据科学中最常用的统计检验是什么
  • 深度学习概述_深度感测框架概述
  • 为什么即使在班级均衡的情况下,准确度仍然令人困扰
  • 接受拒绝算法_通过算法拒绝大学学位
  • 为什么用scrum_为什么Scrum糟糕于数据科学
  • 使用集合映射和关联关系映射_使用R进行基因ID映射
  • 详尽kmp_详尽的分步指南,用于数据准备
  • SMSSMS垃圾邮件检测器的专业攻击
  • 使用Python进行地理编码和反向地理编码
  • grafana 创建仪表盘_创建仪表盘前要问的三个问题

gcp devops_将GCP AI平台笔记本用作可重现的数据科学环境相关推荐

  1. 给AI新手推荐的十篇最佳数据科学文章

    朋友们,我是床长! 如需转载请标明出处:http://blog.csdn.net/jiangjunshow 作为AI科学的初学者,一些好的文章能够快速带我们入门这一充满了未知和挑战的领域.下面这些文章 ...

  2. 求职清单!AI商业落地企业Top100;『数据科学:理论、模型、算法与分析』电子书;超快多线程DataFrame 8K★;前沿论文 | ShowMeAI资讯日报

  3. 数据库数据过长避免_为什么要避免使用商业数据科学平台

    数据库数据过长避免 让我们从一个类比开始 (Let's start with an analogy) Stick with me, I promise it's relevant. 坚持下去,我保证这 ...

  4. 阿里飞天大数据飞天AI平台“双生”系统正式发布,9大全新数据产品集中亮相

    作者 | 夕颜 责编 | 唐小引 出品 | AI科技大本营(ID:rgznai100) 如今,大数据和 AI 已经成为两个分不开的词汇,没有大数据,AI 就失去了根基:没有 AI,数据不会呈现爆发式的 ...

  5. Gartner:2020 年 AI 平台魔力象限:意外多多

    来源:云头条 众多企业决策者向市场研究公司Gartner寻求企业软件堆栈方面的建议.魔力象限报告是Gartner发布的最可信.最真实.最权威的研究报告之一.由于它影响企业的采购决策,因此诸多供应商竭力 ...

  6. 谷歌发布端到端AI平台,还有用于视频和表格的AutoML、文档理解API等多款工具

    谷歌又有了大动作.在大洋彼岸的谷歌Cloud Next conference大会上,谷歌一口气发布了多款AI新品和工具,主要包括: 端到端的AI平台 用于处理视频和表格数据的AutoML Tables ...

  7. netflix 开源_Netflix的Polynote是一个新的开源框架,可用来构建更好的数据科学笔记本

    netflix 开源 I recently started a new newsletter focus on AI education. TheSequence is a no-BS( meanin ...

  8. 2020 数据科学平台领域最具商业合作价值企业盘点

    "点赞+在看+分享本篇文章到朋友圈,截图发送给数据猿小编(ID:datayuanfw1)即可进入数据猿核心读者群,并获现金红包1份.提示:添加小编微信,需注明公司.职务.姓名. 大数据产业创 ...

  9. 打通数据价值链,百分点数据科学基础平台实现数据到决策的价值转换 | 爱分析调研

    随着企业数据规模的大幅增长,如何利用数据.充分挖掘数据价值,服务于企业经营管理成为当下企业数字化转型的关键. 如何挖掘数据价值?企业需要一步步完成数据价值链条的多个环节,如数据集成.数据治理.数据建模 ...

最新文章

  1. 微软:97%电子邮件属于垃圾邮件
  2. android 平板安装程序开发者,android – 限制平板电脑中的应用安装
  3. 显式接口成员实现你知道吗??
  4. Python对区间内回文素数的判断
  5. oracle11存储过程,oracle 存储过程执行报错ORA-12828
  6. mac Sourcetree 账号密码输入错误后, 重新输入的方法
  7. 一个奇怪现象的分析过程
  8. 饭后Android 第三餐-XUI框架(XUI介绍,使用方法,控件使用(九个Button,导航栏,可伸缩布局,顶部弹出框))
  9. 局域网内连接其他计算机共享的打印机
  10. PS放大图片而不模糊的操作方法
  11. python说句心里话a_python第一周作业
  12. 用Nmap工具查找Downadup/Conficker的蠕虫病毒源
  13. binomial检验_R卡方检验的详细解析过程_R计算二项Binomial分布的P
  14. SFP光模块电气接口参数详解
  15. 小程序商城和社区团购小程序,商家应该选哪个?
  16. 单片机遥控开关mos管
  17. 中维带你揭秘倾斜摄影三维实景
  18. //菱形,内藏十字架
  19. 袁宝华 oracle,关键词优化难易分析_SEO优化难度分析 - 站长工具
  20. 在linux中连接mysql数据库服务器_Linux下连接Mysql服务器的方式

热门文章

  1. [原创]java获取word里面的文本
  2. 2017-12-07 socket 读取问题
  3. 快速排序和快速选择(quickSort and quickSelect)算法
  4. mvn编写主代码与测试代码
  5. Console.Write(程序猿?开发?写代码?编程?移动、网页、桌面开发?Oh,我连菜鸟都不是!);...
  6. C++primer plus第六版课后编程题答案8.3(正解)
  7. 扩展编写jquery插件的方法
  8. oracle左右连接的另外表示方法
  9. Nokia N70 Production Video
  10. Spring整合JMS——基于ActiveMQ实现(一)