上海流浪汉沈

This post is only loosely Python related and not at all Plone related.

这篇文章与Python无关,与Plone无关。

This post is only loosely Python related and not at all Plone related, but I thought folks might enjoy hearing about Vagrant and Puppet because these tools may help you do your Plone and Python jobs better.

这篇文章仅与Python无关,而与Plone无关,但我认为人们可能会喜欢Vagrant和Puppet,因为这些工具可以帮助您更好地完成Plone和Python的工作。

For the past couple weeks I’ve been working on creating a virtual machine to bootstrap a kitsune environment. Kitsune is the Django site that powers support.mozilla.com. I’ve now reached what I call the 2nd milestone.

在过去的几周中,我一直在致力于创建虚拟机来引导Kitsune环境。 Kitsune是支持support.mozilla.com的Django网站。 我现在已经达到了我所说的第二个里程碑

大事记 (Milestones)

The milestones are as follows:

里程碑如下:

  1. Get the VM running to the point where one can type ./manage.py and receive the help output (and not a traceback). This sounds trivial but there is actually a lot of work involved to get to this point. Namely, figuring out how to make Puppet execute each of the required steps successfully, together. (You would expect to be able to just define the steps in order, but those with this expectation will be disappointed. I assume Puppet has their reasons, and they are probably even good ones.)
  2. Get the VM running to the point where one can open http://33.33.33.10:8000 from the host to see kitsune running. Once step #1 is done, this is actually easier than it sounds because I’m “cheating”. Test data has been imported and a syncdb has been run, but I’m using supervisor to manage the runserver process (for now).
  3. Get the VM running like it does in production. This will involve configuring Apacheand mod_wsgi as well as resolving any issues that remain with the app. I’ll rely on the kitsune team to help with this, as I’m still learning the app. This is the “exciting” part for me because I get to learn something new. While Vagrant and Puppet are also new to me, I consider these technologies part of my “past life” (as a system administrator) and Django sites part of my “future life” (as a web developer).
  1. 使VM运行到可以键入./manage.py并接收帮助输出(而不是回溯)的地步。 这听起来很琐碎,但要完成这一点实际上涉及很多工作。 即,弄清楚如何使Puppet一起成功执行每个必需的步骤。 (您希望能够按顺序定义步骤,但是那些期望如此的人会感到失望。我认为Puppet有他们的理由,甚至可能是很好的理由。)
  2. 使VM运行到可以从主机打开http://33.33.33.10:8000来查看kitsune运行的程度。 一旦完成了步骤1,实际上这比听起来容易,因为我在“作弊”。 测试数据已导入,并且已运行syncdb,但是我正在使用Supervisor管理Runserver进程(目前)。
  3. 使虚拟机像在生产环境中一样运行。 这将涉及配置Apachemod_wsgi以及解决应用程序中仍然存在的所有问题。 由于我仍在学习该应用程序,因此我将依靠kitsune团队来提供帮助。 这对我来说是“令人兴奋的”部分,因为我可以学习一些新知识。 尽管Vagrant和Puppet对我来说也是新手,但我认为这些技术是我“过去”(作为系统管理员)的一部分,而Django网站则是我“未来”(作为Web开发人员)的一部分。

Now about the technologies.

现在介绍技术。

流浪汉 (Vagrant)

I had heard of Vagrant before, but never tried it. I am now sorry I waited so long because the “cool factor” is very high. It requires that Virtualbox be installed, which I also danced around for too long before committing (being a former Parallels user).

我以前听说过Vagrant ,但从未尝试过。 我很抱歉等了这么长时间,因为“酷系数”很高。 它要求安装Virtualbox ,在提交之前(以前是Parallels用户),我也跳舞了很长时间。

On OS X Lion[1], installing Vagrant is simply a matter of:

在OS X Lion [1]上,安装Vagrant只需解决以下问题:

$ gem install vagrant
$ gem install vagrant

Once you have `vagrant` installed you can do:

一旦安装了“ vagrant”,您可以执行以下操作:

inside some revision-controlled directory and you have the beginnings of a virtual machine you can share with the masses. This is how kitsune-vagrant was born. Hopefully this shared virtual machine will eventually make some new developer’s life much easier.

在受版本控制的目录中,您便拥有了可以与大众共享的虚拟机。 这就是Kitsune-vagrant的诞生方式。 希望这个共享的虚拟机最终将使新开发者的生活更加轻松。

We now arrive at a fork in the road; though Vagrant makes it easy to follow both paths: Chef or Puppet (it supports both). I don’t recall what made me choose Puppet over Chef, but it might have been that the Socorro folks were using it already.

现在,我们到达了道路上的叉子。 尽管Vagrant可以很容易地遵循这两种路径:Chef或Puppet(它同时支持这两种)。 我不记得是什么让我选择了Puppet而不是Chef,但可能是Socorro员工已经在使用它 。

Once you decide on Puppet (and assuming you do), it’s pretty easy to figure out that your next move is to create a manifest file for Puppet to apply[2].

一旦确定了Puppet(并假设您愿意),就很容易确定下一步是为Puppet创建一个清单文件来应用[2]。

木偶 (Puppet)

My knowledge of Puppet is currently quite limited. Specifically, I only know how to create a manifest file. (Vagrant does the rest!) I imagine there is much more to Puppet, especially with regard to doing actual configuration management on production servers. But I have not explored any of that yet.

我对Puppet的知识目前非常有限。 具体来说,我只知道如何创建清单文件。 (剩下的工作由流浪者完成!)我想Puppet还有很多其他功能,尤其是在生产服务器上进行实际配置管理方面。 但是我还没有探索过任何一个。

However, I did learn quite a bit about Puppet just from writing the manifest. The first most important thing I learned is this: Puppet is in charge. It does things the way it wants to and you need to follow its rules. The first and biggest challenge is to achieve a linear execution of tasks.

但是,我只是从编写清单中就学到了很多有关Puppet的知识。 我学到的第一件最重要的事情是: 人偶负责 。 它以它想要的方式执行操作,您需要遵循其规则。 第一个也是最大的挑战是实现任务的线性执行。

You cannot write rules in order and hope for the best. This will fail spectacularly when something executes before something else was supposed to. The way around this is via `require =>` statements.

您不能按顺序编写规则,也不能期望最好。 当某个东西在其他东西本应执行之前执行时,这将严重失败。 解决这个问题的方法是通过`require =>`语句。

A grep through kitsune.pp reveals:

通过kitsune.pp的grep显示:

require => Exec['git_clone'],
require => Exec['db_sync'],
require => Exec['packages_upgrade'],
require => Exec['packages_update'],
require => Package[$packages_native],
require => Exec['git_clone'],
require => Exec['chown_kitsune'],
require => Exec['packages_compiled'],
require => Exec['packages_vendor'],
require => Exec['db_create'],
require => Exec['db_import'],
require => file['/etc/supervisor/supervisord.conf'],
require => Exec['supervisor_stop'],
require => Exec['git_clone'],
require => Exec['db_sync'],
require => Exec['packages_upgrade'],
require => Exec['packages_update'],
require => Package[$packages_native],
require => Exec['git_clone'],
require => Exec['chown_kitsune'],
require => Exec['packages_compiled'],
require => Exec['packages_vendor'],
require => Exec['db_create'],
require => Exec['db_import'],
require => file['/etc/supervisor/supervisord.conf'],
require => Exec['supervisor_stop'],

This roughly translates to the following workflow logic:

这大致转化为以下工作流程逻辑:

  • Ensure that `aptitude -y update; aptitude -y upgrade` have been run before you try to install the list of packages we require.
  • Ensure the list of packages we require is installed before we checkout the code.
  • Ensure the code has been checked out (and pip install / git submodule have been run) before you try to syncdb and run the application.
  • 确保`aptitude -y更新; 在尝试安装我们需要的软件包列表之前,已运行aptitude -y upgrade`。
  • 在签出代码之前,请确保已安装所需的软件包列表。
  • 在尝试同步并运行应用程序之前,请确保代码已签出(并且pip install / git子模块已运行)。

There is a bit more to it, but with that knowledge you should be able to read and understand kitsune.pp in full. I learned most of the remaining required puppeteering from this site:http://www.puppetcookbook.com/.

还有更多内容,但是有了这些知识,您应该可以完整阅读和理解kitsune.pp 。 我从该站点http://www.puppetcookbook.com/上了解了剩余的大多数必需的伪装。

Mozilla (Mozilla)

Oh my! This Mozilla work is a ton of fun[3]; I attribute this in part due to the structure of their organization: I was invited immediately to collaborate in IRC with the kitsune team and as a result, we all have something to show for it[4]. Next I will be working on the 3rd milestone! Hope to finish by the end of this week.

天啊! Mozilla的这项工作充满乐趣[3]; 我之所以将其归因于其组织结构:我被立即邀请与Kitsune团队在IRC中进行合作,结果,我们所有人都有所需要展示的东西[4]。 接下来,我将致力于第三个里程碑! 希望在本周末结束。

笔记 (Notes)

[1] This did not work on Snow Leopard, because `gem` is too old. However if you `brew install ruby` and try again, it should work.

[1]这在Snow Leopard上无效,因为`gem'太旧了。 但是,如果您“稍微安装ruby”并重试,它应该可以工作。

[2] I didn’t bother to investigate Chef, but I am curious about it.

[2]我没有去调查厨师,但是对此感到很好奇。

[3] And I hope this is only the beginning.

[3]我希望这仅仅是开始。

[4] I hope to get a Mozilla gig but even if I don’t, being able to do this type of work is very rewarding (which is why you will often hear people in open source say that to get paid for the type of work they do is a dream come true).

[4]我希望获得Mozilla的演出,但是即使我没有,能够做这种类型的工作也是非常有意义的(这就是为什么您经常听到开放源代码中的人说要为这种类型的工作获得报酬的原因他们所做的工作是梦想成真)。

翻译自: https://www.pybloggers.com/2011/10/vagrant-puppet-and-mozilla-oh-my/

上海流浪汉沈

上海流浪汉沈_流浪汉,木偶和Mozilla,我的天哪相关推荐

  1. 上海流浪汉沈_流浪汉厨师独奏

    上海流浪汉沈 要学习厨师的概念,我们可以从Vagrant使用chef-solo开始. 请参阅我以前在Vagrant上发布的文章以安装vagrant并了解更多信息. 接下来,让我们在机器上安装chef- ...

  2. 上海舟山沈家门普陀山2日游实用自驾攻略

    我们一行5人,自驾车(1.8升).给大家一些去自驾去沈家门的实用攻略,景点的介绍就不介绍了,相信很多朋友都在其他的旅游攻略中看了很多,这里就不在多写了,只写一点最实用的东西,方便大家出行. 日本旅游 ...

  3. 柯泰测试同步采集软件,上海近场测试设备_柯泰测试

    上海近场测试设备,柯泰测试 197dou,    • 合作用户-Partner. 上海近场测试设备, 可以建立一种自适应算法,在中低频段自动采用近场声全息的方法定位和识别噪声源,在高频段自动采用波束形 ...

  4. html小游戏代码_研发实践:Mozilla分享如何开发一款WebVR小游戏

    文章相关引用及参考:mozvr 本文来自Mozilla的Josh Marinacci (映维网 2019年02月06日)在倡导新技术时,我总是尝试采用现实世界开发者的方式,而对于WebVR,开发一款游 ...

  5. 上海富爸爸_放弃高薪选择财务自由之路(转)

    风靡一时的"富爸爸"系列丛书不知在全球制造了多少个"富爸爸",本文的主人公刘建平或许就算得上一个. 三年前,他宁愿放弃跨国公司的高薪而去选择一条看似虚无的&qu ...

  6. mozilla 源码_每日新闻摘要:Mozilla的Firefox Premium计划

    mozilla 源码 Mozilla's CEO, Chris Beard, made a surprising statement in an interview recently, a premi ...

  7. 推荐的上海python培训班_燃烧的蔬菜推推推

    游戏简介 游戏介绍 燃烧的蔬菜推推推官方是一款非常好玩的手机游戏,这款游戏提供的是最具特色的推币机玩法,而且这款游戏在玩法上非常合适,各种神秘道具就在你游戏中随机出现给你惊喜,各种精彩特色内容快来下载 ...

  8. 童程童美机器人编程上海虹口校区_呼市童程童美少儿编程学习中心

    呼市童程童美少儿编程学习中心,学习少儿编程就选童程童美,童程童美专注3-18岁少儿编程教育.历时多年,形成了以创意启蒙课程.人工智能编程.智能机器人编程.信息学奥赛编程等课程为核心的一站式编程教育平台 ...

  9. 摩根斯丹利 上海java开发_美团上海Java实习(已offer)面经(还没写完,转载)...

    实习简历投的晚,笔试四月初就完成,一直没有面试.可能原部门没有hc,期间还收到一次问我要不要转前端的电话,被我拒绝了.然后4月底收到美团金融的面试邀请. 第一面5.6(一个小时10分钟) 问的问题蛮多 ...

最新文章

  1. 异步备份和还原数据库:.NET发现之旅(六)
  2. Cookie的小知识
  3. 源码学习【HashMap第二篇】hashMap为什么size 是2的 n次方倍
  4. 基于 qiankun 的微前端应用实践
  5. 5.1.7 INSERT新增数据
  6. 求单链表结点的阶乘和
  7. perl - Java调用perl
  8. 斯威夫特山地车_斯威夫特字典
  9. 【NIPS 2017】基于深度强化学习的想象力增强智能体
  10. 修改chrome中HTML元素,自由更改网页中的任何内容:Hack this page
  11. boost升压电路 开环 PI 单闭环 双闭环 数学模型 PWM matlab仿真
  12. Linux 无线网卡驱动安装 Dell Inspiron R14-N4010 笔记本
  13. 计算机重启事件查看,事件查看器检查上一次电脑关机时间
  14. iphone13电话噪音大怎么办 苹果13怎么设置电话降噪
  15. TP5 生成微信小程序海报图
  16. 项目4-一元一次方程类
  17. mysql describe 分页_mysql之分页方式了解
  18. IE浏览器极限提速完全攻略(软媒原创)
  19. markdown(Latex)连乘符号
  20. c语言用质因数分解法求最大公约数,《分解质因数的方法求最大公约数》数学教案...

热门文章

  1. 为什么企业直播能够异军突起?
  2. 央视版笑傲江湖的价值观 (转)
  3. 《令人心动的offer(第二季)》学习笔记
  4. Linux游戏 0 A.D安装及汉化
  5. JPO 创建Excel相关问题解决
  6. 生活-象棋-蹩马腿-1
  7. 有哪些鲜为人知,但是很有意思的网站?
  8. 谷歌浏览器不能使用opener属性的问题和解决
  9. N1盒子Armbian折腾记
  10. 用MATLAB程序控制伺服电机,使用MATLAB和Arduino开发板进行步进电机控制