mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge remote-tracking branch 'LCTT/master'
This commit is contained in:
commit
55c4923237
@ -0,0 +1,60 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chenmu-kk)
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12803-1.html)
|
||||
[#]: subject: (Most enterprise networks can't handle big data loads)
|
||||
[#]: via: (https://www.networkworld.com/article/3440519/most-enterprise-networks-cant-handle-big-data-loads.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
大多数企业网络无法处理大数据负载
|
||||
======
|
||||
|
||||
> 随着网络中流动着越来越多的数据,由于领导力和技术问题,网络正在滞后于数据的发展速度。
|
||||
|
||||
![](https://images.idgesg.net/images/article/2019/08/gettyimages-811109186-100808291-large.jpg)
|
||||
|
||||
又过了一周,另一项调查发现,IT 已经无法跟上不断膨胀的数据过载。这次的问题将主要是网络带宽和整体性能。
|
||||
|
||||
管理咨询公司埃森哲对 [300 名 IT 专业人士进行的一项调查][1] 发现,大多数人认为他们企业网络无法胜任处理大数据的任务和物联网部署的任务。只有 43% 的受访公司表示他们的网络已经准备好支持云服务、物联网和其他数字技术。
|
||||
|
||||
一个关键原因(58%)是“IT 与商业需求之间的错位”,这延缓了这些项目的进展。这是一个不同寻常的发现,因为 85% 的受访者还表示他们的网络已经完全或者大体上已经准备好支持企业的数字化计划。那么,究竟是哪一种情况呢?
|
||||
|
||||
第二和第三大时常提及的障碍是“业务需求和运营需求间固有的复杂性”以及“对带宽、性能等方面的需求超过交付能力”,各占 45%。
|
||||
|
||||
由于分析技术和其他大数据技术的推动,大量传输的数据持续涌入网络线路,网络瓶颈持续增长。调查发现,带宽需求并未得到满足,目前的网络性能依旧达不到要求。
|
||||
|
||||
其他原因还包括缺乏网络技术、设备扩展和设备老化。
|
||||
|
||||
### 网络性能问题的一个解决方案:SDN
|
||||
|
||||
埃森哲发现,大多数公司表示 [软件定义网络(SDN)][5] 是应对带宽和性能挑战的解决方案,77% 的受访企业在调查中表示正在部署 SDN 或者已完成部署。它指出,虽然 SDN 可能在组织的某部分中存在,它并不总是在整个企业范围内统一地推出。
|
||||
|
||||
如今看来,似乎从未有人有足够的预算来满足他们所有的 IT 雄心,但 31% 受访者认为为网络改善提供资金是“简单的”,而且是在网络基础设施团队的控制范围内,相较于直接下属(13%)或基础设施/网络主管和副总裁(19%),首席信息官/首席技术官更可能将融资过程报告为“轻松”(40%)。
|
||||
|
||||
报告指出,“仅靠传统网络无法支持数字时代所需的创新和性能。”报告呼吁拥抱新技术,但没有提到 SDN 的名字。同时它还呼吁首席执行官和他们直接下属间加强合作,因为很明显,双方在看待问题的方式上存在分歧。
|
||||
|
||||
报告总结说,“我们认为需要一种新的网络范式来确保网络满足当前和未来的业务需求。然而,尽管有进步的迹象,但变革的步伐缓慢。公司必须承担起重担,才能实现统一和标准化企业能力,提供必要的带宽、性能和安全,以支持当前和未来的业务需求”。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3440519/most-enterprise-networks-cant-handle-big-data-loads.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chenmu-kk](https://github.com/chenmu-kk)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.accenture.com/_acnmedia/pdf-107/accenture-network-readiness-survey.pdf#zoom=50
|
||||
[2]: https://www.networkworld.com/article/3209131/lan-wan/what-sdn-is-and-where-its-going.html
|
||||
[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html
|
||||
[6]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/
|
||||
[7]: https://www.networkworld.com/article/3405522/how-network-pros-acquire-skills-for-sdn-programmable-networks.html
|
||||
[8]: https://www.facebook.com/NetworkWorld/
|
||||
[9]: https://www.linkedin.com/company/network-world
|
@ -1,28 +1,28 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: reviewer: (wxy)
|
||||
[#]: publisher: (wxy)
|
||||
[#]: url: (https://linux.cn/article-12804-1.html)
|
||||
[#]: subject: (5 open source tools I can't live without)
|
||||
[#]: via: (https://opensource.com/article/20/10/open-source-tools)
|
||||
[#]: author: (Victoria Martinez de la Cruz https://opensource.com/users/vkmc)
|
||||
|
||||
5 个我不能离开的开源工具
|
||||
5 个我不可或缺的开源工具
|
||||
======
|
||||
通过将这些工具放在自己的技囊中,提高终端内外的工作效率。
|
||||
![woman on laptop sitting at the window][1]
|
||||
|
||||
前段时间,我参与了一个在科技人士中广为流传的 Twitter 话题。挑战是什么?只挑选五个你不能没有的工具。我开始结合我的日常生活来思考这个问题,只挑出五个工具并不容易。我使用了许多我认为必不可少的工具,比如我的 [IRC][2] 客户端来与同事和朋友联系(是的,我仍然使用 IRC),一个好的文本编辑器来做事情,一个日历应用来保持有条不紊,以及当需要更直接的互动时的一个视频会议平台。
|
||||
> 通过将这些工具放在自己的技能包中,提高你在终端内、外的工作效率。
|
||||
|
||||
所以,让我给这个挑战来个转折:选出五个能提高你工作效率的开源工具。这是我的清单。请在评论中分享你的清单。
|
||||
![](https://img.linux.net.cn/data/attachment/album/202011/08/185810ffjljj7o830fboz3.jpg)
|
||||
|
||||
前段时间,我参与了一个在科技人士中广为流传的 Twitter 话题。“挑战?只挑选五个你不能没有的工具。”我开始结合我的日常生活来思考这个问题,只挑出五个工具并不容易。我使用了许多我认为必不可少的工具,比如用来与同事和朋友联系的 [IRC][2] 客户端(是的,我仍然使用 IRC),一个用来做各种事情的出色的文本编辑器,一个用来保持有条不紊的日历应用,以及当需要更直接的互动时的一个视频会议平台。
|
||||
|
||||
所以,让我给这个挑战来个变化:选出五个能提高你工作效率的开源工具。这是我的清单。请在评论中分享你的清单。
|
||||
|
||||
### tmate
|
||||
|
||||
![tmate screenshot][3]
|
||||
|
||||
(Victoria Marinez de la Cruz, [CC BY-SA 4.0][4])
|
||||
|
||||
tmate 是著名的 [tmux][5] 终端多路复用器的一个分支,它允许你启动一个 tmux 会话并通过 SSH 共享。你可以用它来进行[配对编程][6](这是我的主要使用场景),也可以用来进行远程控制。
|
||||
哦,我喜欢这个工具。`tmate` 是著名的 [tmux][5] 终端多路复用器的一个复刻,它允许你启动一个 `tmux` 会话并通过 SSH 共享。你可以用它来进行[结对编程][6](这是我的主要使用场景),也可以用来进行远程控制。
|
||||
|
||||
如果你经常与你的团队成员合作,并且你想要一个简单的、与发行版无关的、开源的方式与他们一起编程(而且共享终端访问对你来说已经足够了),这绝对是你必须加到列表中的东西。
|
||||
|
||||
@ -30,15 +30,15 @@ tmate 是著名的 [tmux][5] 终端多路复用器的一个分支,它允许你
|
||||
|
||||
### ix
|
||||
|
||||
ix 是一个命令行粘贴板。你不需要安装任何东西。你可以通过 `curl` 到 [ix.io][9] 站点来创建新的粘贴。例如, `echo Hello world. | curl -F 'f:1=<-' ix.io` 会给你一个到 ix.io 的链接,那里粘贴了消息 “Hello world” 的信息。当你想分享日志用于调试或在没有桌面环境的服务器上保存配置文件时,这非常方便。
|
||||
`ix` 是一个命令行粘贴板。你不需要安装任何东西。你可以通过 `curl` 到 [ix.io][9] 站点来创建新的粘贴。例如,`echo Hello world. | curl -F 'f:1=<-' ix.io` 会给你一个到 ix.io 的链接,那里粘贴了消息 “Hello world” 的信息。当你想分享日志用于调试或在没有桌面环境的服务器上保存配置文件时,这非常方便。
|
||||
|
||||
有一个缺点是源码还没有公布,尽管它的目的是免费和开源。如果你是作者,并且正在阅读这篇文章,请发布代码,这样我们就可以为打磨过程做出贡献。
|
||||
有一个缺点是源码还没有公布,尽管它的目的是自由开源。如果你是作者,并且正在阅读这篇文章,请发布代码,这样我们就可以为打磨它的过程做出贡献。
|
||||
|
||||
### asciinema
|
||||
|
||||
是的,这是另一个终端工具,asciinema 可以让你记录你的终端。使用它的方法有很多,但我一般用它来制作 demo 演示。它非常容易使用,而且有很多 Linux 发行版和其他平台的软件包。
|
||||
是的,这是另一个终端工具,`asciinema` 可以让你记录你的终端。使用它的方法有很多,但我一般用它来制作演示。它非常容易使用,而且有很多 Linux 发行版和其他平台的软件包。
|
||||
|
||||
要想知道它是如何工作的,可以看看这个[酷炫的 demo][10]。是不是很棒?
|
||||
要想知道它是如何工作的,可以看看这个[酷炫的演示][10]。是不是很棒?
|
||||
|
||||
在 [asciinema 的网站][11]上获取更多信息,在 [GitHub][12] 上访问其源代码。
|
||||
|
||||
@ -46,11 +46,9 @@ ix 是一个命令行粘贴板。你不需要安装任何东西。你可以通
|
||||
|
||||
![pomodoro timer gnome][13]
|
||||
|
||||
(Victoria Martinez de la Cruz, [CC BY-SA 4.0][4])
|
||||
好了,关于终端工具的介绍就到此为止。现在我想和大家分享一下这个简单的宝物,它让你的工作变得有条不紊。你听说过 [番茄工作法][14] 吗?Pomodoro 基本上是一个时间管理工具。它使用一个番茄形状的计时器,帮助你将时间分成工作时间和休息时间(默认情况下,25 分钟的工作后有 5 分钟的休息时间)。而且,每隔 4 个“番茄”之后,你就会有更长的休息时间(默认为 15 分钟)。这样做的目的是让你在工作时间内保持专注,而在休息时间内进行伸展和放松。
|
||||
|
||||
好了,关于终端工具的介绍就到此为止。现在我想和大家分享一下这个简单的宝物,它让你的工作变得有条不紊。你听说过 [Pomodoro Technique][14] 吗?Pomodoro 基本上是一个时间管理工具。它使用一个番茄形状的计时器,帮助你将时间分成工作时间和休息时间(默认情况下,25 分钟的工作后有 5 分钟的休息时间)。而且,每隔 4 个 pomodoro 之后,你就会有更长的休息时间(默认为 15 分钟)。这样做的目的是让你在工作时间内保持专注,而在休息时间内进行伸展和放松。
|
||||
|
||||
这听起来非常非常简单,你可能会对让一个番茄形状的时钟来控制你的生活感到犹豫,但它确实帮助我更好地组织起来,避免在试图同时专注于许多事情时感到疲惫。
|
||||
这听起来非常非常简单,你可能会对让一个番茄形状的时钟来控制你的生活感到犹豫,但它确实帮助我变得跟有条理,并且在试图同时专注于许多事情时避免感到疲惫。
|
||||
|
||||
无论你是什么角色,我都强烈推荐这种做法。而在众多实现它的不同工具中,我推荐 GNOME Pomodoro 应用。它适用于主要的 GNU/Linux 发行版,所以它需要你使用 GNOME 桌面环境(这可能是它的缺点)。
|
||||
|
||||
@ -58,7 +56,7 @@ ix 是一个命令行粘贴板。你不需要安装任何东西。你可以通
|
||||
|
||||
### Jitsi
|
||||
|
||||
最后但并非最不重要的是 Jitsi。当你在一个远程、全球分布的团队中工作时,你需要一种与人们联系的方式。即时通讯是好的,但有时最好还是开个快速会议,面对面地讨论事情(嗯,看到对方的脸)。有很多[视频会议工具][17]可用,但我很喜欢 Jitsi。不仅因为它是免费和开源的,还因为它提供了一个简洁、实用的界面。你可以设置自己的 Jitsi 服务器(用于商业目的),但你也可以通过访问 [Jitsi Meet][18] 网站来试用一个公共的 Jitsi 实例。
|
||||
最后但同样重要的是 Jitsi。当你在一个远程、遍布全球的团队中工作时,你需要一种与人们联系的方式。即时通讯是好的,但有时最好还是开个快速会议,面对面地讨论事情(嗯,看到对方的脸)。有很多[视频会议工具][17]可用,但我很喜欢 Jitsi。不仅因为它是免费和开源的,还因为它提供了一个简洁、实用的界面。你可以设置自己的 Jitsi 服务器(用于商业目的),但你也可以通过访问 [Jitsi Meet][18] 网站来试用一个公共的 Jitsi 实例。
|
||||
|
||||
设置这种会议的一个好做法是:只有在你心中有明确的议程时才使用它。而且要时刻问自己,这个会议能不能用电子邮件代替?遵循这些准则,谨慎使用 Jitsi,你的工作日将会非常高效!
|
||||
|
||||
@ -75,7 +73,7 @@ via: https://opensource.com/article/20/10/open-source-tools
|
||||
作者:[Victoria Martinez de la Cruz][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
校对:[wxy](https://github.com/wxy)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,166 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Add sound to your Python game)
|
||||
[#]: via: (https://opensource.com/article/20/9/add-sound-python-game)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
Add sound to your Python game
|
||||
======
|
||||
Hear what happens when your hero fights, jumps, collects loot, and more
|
||||
by adding sounds to your game. Learn how in the 13th article in this
|
||||
series on creating a platformer in Pygame.
|
||||
![Colorful sound wave graph][1]
|
||||
|
||||
This is part 13 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are:
|
||||
|
||||
1. [Learn how to program in Python by building a simple dice game][4]
|
||||
2. [Build a game framework with Python using the Pygame module][5]
|
||||
3. [How to add a player to your Python game][6]
|
||||
4. [Using Pygame to move your game character around][7]
|
||||
5. [What's a hero without a villain? How to add one to your Python game][8]
|
||||
6. [Add platforms to your game][9]
|
||||
7. [Simulate gravity in your Python game][10]
|
||||
8. [Add jumping to your Python platformer game][11]
|
||||
9. [Enable your Python game player to run forward and backward][12]
|
||||
10. [Using Python to set up loot in Pygame][13]
|
||||
11. [Add scorekeeping to your Python game][14]
|
||||
12. [Add throwing mechanics to your Python game][15]
|
||||
|
||||
|
||||
|
||||
Pygame provides an easy way to integrate sounds into your Python video game. Pygame's [mixer module][16] can play one or more sounds on command, and by mixing those sounds together, you can have, for instance, background music playing at the same time you hear the sounds of your hero collecting loot or jumping over enemies.
|
||||
|
||||
It is easy to integrate the mixer module into an existing game, so—rather than giving you code samples showing you exactly where to put them—this article explains the four steps required to get sound in your application.
|
||||
|
||||
### Start the mixer
|
||||
|
||||
First, in your code's setup section, start the mixer process. Your code already starts Pygame and Pygame fonts, so grouping it together with these is a good idea:
|
||||
|
||||
|
||||
```
|
||||
pygame.init()
|
||||
pygame.font.init()
|
||||
pygame.mixer.init() # add this line
|
||||
```
|
||||
|
||||
### Define the sounds
|
||||
|
||||
Next, you must define the sounds you want to use. This requires that you have the sounds on your computer, just as using fonts requires you to have fonts, and using graphics requires you to have graphics.
|
||||
|
||||
You also must bundle those sounds with your game so that anyone playing your game has the sound files.
|
||||
|
||||
To bundle a sound with your game, first create a new directory in your game folder, right along with the directory you created for your images and fonts. Call it `sound`:
|
||||
|
||||
|
||||
```
|
||||
`s = 'sound'`
|
||||
```
|
||||
|
||||
Even though there are plenty of sounds on the internet, it's not necessarily _legal_ to download them and give them away with your game. It seems strange because so many sounds from famous video games are such a part of popular culture, but that's how the law works. If you want to ship a sound with your game, you must find an open source or [Creative Commons][17] sound that gives you permission to give the sound away with your game.
|
||||
|
||||
There are several sites that specialize in free and legal sounds, including:
|
||||
|
||||
* [Freesound][18] hosts sound effects of all sorts.
|
||||
* [Incompetech][19] hosts background music.
|
||||
* [Open Game Art][20] hosts some sound effects and music.
|
||||
|
||||
|
||||
|
||||
Some sound files are free to use only if you give the composer or sound designer credit. Read the conditions of use carefully before bundling any with your game! Musicians and sound designers work just as hard on their sounds as you work on your code, so it's nice to give them credit even when they don't require it.
|
||||
|
||||
To give your sound sources credit, list the sounds that you use in a text file called `CREDIT`, and place the text file in your game folder.
|
||||
|
||||
You might also try making your own music. The excellent [LMMS][21] audio workstation is easy to use and ships with lots of interesting sounds. It's available on all major platforms and exports to [Ogg Vorbis][22] (OGG) audio format.
|
||||
|
||||
### Add sound to Pygame
|
||||
|
||||
When you find a sound that you like, download it. If it comes in a ZIP or TAR file, extract it and move the sounds into the `sound` folder in your game directory.
|
||||
|
||||
If the sound file has a complicated name with spaces or special characters, rename it. The filename is completely arbitrary, and the simpler it is, the easier it is for you to type into your code.
|
||||
|
||||
Most video games use OGG sound files because the format provides high quality in small file sizes. When you download a sound file, it might be an MP3, WAVE, FLAC, or another audio format. To keep your compatibility high and your download size low, convert these to Ogg Vorbis with a tool like [fre:ac][23] or [Miro][24].
|
||||
|
||||
For example, assume you have downloaded a sound file called `ouch.ogg`.
|
||||
|
||||
In your code's setup section, create a variable representing the sound file you want to use:
|
||||
|
||||
|
||||
```
|
||||
`ouch = pygame.mixer.Sound(os.path.join(s, 'ouch.ogg'))`
|
||||
```
|
||||
|
||||
### Trigger a sound
|
||||
|
||||
To use a sound, all you have to do is call the variable when you want to trigger it. For instance, to trigger the `OUCH` sound effect when your player hits an enemy:
|
||||
|
||||
|
||||
```
|
||||
for enemy in enemy_hit_list:
|
||||
pygame.mixer.Sound.play(ouch)
|
||||
score -= 1
|
||||
```
|
||||
|
||||
You can create sounds for all kinds of actions, such as jumping, collecting loot, throwing, colliding, and whatever else you can imagine.
|
||||
|
||||
### Add background music
|
||||
|
||||
If you have music or atmospheric sound effects you want to play in your game's background, you can use the `music` function of Pygame's mixer module. In your setup section, load the music file:
|
||||
|
||||
|
||||
```
|
||||
`music = pygame.mixer.music.load(os.path.join(s, 'music.ogg'))`
|
||||
```
|
||||
|
||||
And start the music:
|
||||
|
||||
|
||||
```
|
||||
`pygame.mixer.music.play(-1)`
|
||||
```
|
||||
|
||||
The `-1` value tells Pygame to loop the music file infinitely. You can set it to anything from `0` and beyond to define how many times the music should loop before stopping.
|
||||
|
||||
### Enjoy the soundscapes
|
||||
|
||||
Music and sound can add a lot of flavor to your game. Try adding some to your Pygame project!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/9/add-sound-python-game
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
|
||||
[2]: https://www.python.org/
|
||||
[3]: https://www.pygame.org/news
|
||||
[4]: https://opensource.com/article/17/10/python-101
|
||||
[5]: https://opensource.com/article/17/12/game-framework-python
|
||||
[6]: https://opensource.com/article/17/12/game-python-add-a-player
|
||||
[7]: https://opensource.com/article/17/12/game-python-moving-player
|
||||
[8]: https://opensource.com/article/18/5/pygame-enemy
|
||||
[9]: https://opensource.com/article/18/7/put-platforms-python-game
|
||||
[10]: https://opensource.com/article/19/11/simulate-gravity-python
|
||||
[11]: https://opensource.com/article/19/12/jumping-python-platformer-game
|
||||
[12]: https://opensource.com/article/19/12/python-platformer-game-run
|
||||
[13]: https://opensource.com/article/19/12/loot-python-platformer-game
|
||||
[14]: https://opensource.com/article/20/1/add-scorekeeping-your-python-game
|
||||
[15]: https://opensource.com/article/20/9/add-throwing-python-game
|
||||
[16]: https://www.pygame.org/docs/ref/mixer.html
|
||||
[17]: https://opensource.com/article/20/1/what-creative-commons
|
||||
[18]: https://freesound.org
|
||||
[19]: https://incompetech.filmmusic.io
|
||||
[20]: https://opengameart.org
|
||||
[21]: https://opensource.com/life/16/2/linux-multimedia-studio
|
||||
[22]: https://en.wikipedia.org/wiki/Vorbis
|
||||
[23]: https://www.freac.org/index.php/en/downloads-mainmenu-330
|
||||
[24]: http://getmiro.com
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (xiao-song-123)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,137 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (4 ways to run Kubernetes locally)
|
||||
[#]: via: (https://opensource.com/article/20/11/run-kubernetes-locally)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brson)
|
||||
|
||||
4 ways to run Kubernetes locally
|
||||
======
|
||||
Set up a local development environment or just try out the container
|
||||
orchestration platform with these tools.
|
||||
![Business woman on laptop sitting in front of window][1]
|
||||
|
||||
[Kubernetes][2] is an open source orchestration platform for containers. Developed by Google, it offers an open source system for automating deployment, scaling, and managing containerized applications. Although most people run Kubernetes in a cloud environment, running a Kubernetes cluster locally is not only possible, it has at least two benefits:
|
||||
|
||||
* You can quickly try out Kubernetes before deciding to use it as your primary platform to deploy your application.
|
||||
* You can set it up as a local development environment before pushing anything to a public cloud, thus allowing separation between the development environment and the production environment.
|
||||
|
||||
|
||||
|
||||
Setting up a local Kubernetes environment as your development environment is the recommended option, no matter your situation, because this setup can create a safe and agile application-deployment process.
|
||||
|
||||
Fortunately, there are multiple platforms that you can try out to run Kubernetes locally, and they are all open source and available under the [Apache 2.0][3] license.
|
||||
|
||||
* [Minikube][4] has the primary goals of being the best tool for local Kubernetes application development, and to support all Kubernetes features that fit.
|
||||
* [kind][5] runs local Kubernetes clusters using Docker container "nodes."
|
||||
* [CodeReady Containers][6] (CRC) manages a local OpenShift 4.x cluster optimized for testing and development purposes.
|
||||
* [Minishift][7] helps you run OpenShift 3.x clusters locally by running a single-node OpenShift cluster inside a virtual machine (VM).
|
||||
|
||||
|
||||
|
||||
### Minikube
|
||||
|
||||
![Minikube][8]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
[Minikube][10] is the most well-known and popular choice to run a Kubernetes environment on a local computer. No matter what operating system you use, [Minikube's documentation][11] offers an easy [installation][12] guide for you. Generally, installing Minikube is as simple as running two commands:
|
||||
|
||||
|
||||
```
|
||||
$ curl -LO <https://storage.googleapis.com/minikube/releases/latest/minikube-PLATFORM-amd64>
|
||||
$ sudo install minikube-PLATFORM-amd64 /usr/local/bin/minikube
|
||||
```
|
||||
|
||||
Minikube quickly sets up a local Kubernetes cluster on Linux, macOS, or Windows with the following features:
|
||||
|
||||
* Supports the latest Kubernetes release (+6 previous minor versions)
|
||||
* Cross-platform (Linux, macOS, Windows)
|
||||
* Deploys as a VM, a container, or on bare-metal
|
||||
* Multiple container runtimes (CRI-O, containerd, Docker)
|
||||
* Docker API endpoint for blazing-fast image pushes
|
||||
* LoadBalancer, filesystem mounts, FeatureGates, and other advanced features
|
||||
* Add-ons for easily installing Kubernetes applications
|
||||
|
||||
|
||||
|
||||
Because Minikube is an open source project, you can contribute to its [source code][4].
|
||||
|
||||
### kind
|
||||
|
||||
![kind][13]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
[kind][14]'s developers describe it as "a tool for running local Kubernetes clusters using Docker container 'nodes.'" It was designed for testing Kubernetes but may also be used for local development or continuous integration.
|
||||
|
||||
kind supports:
|
||||
|
||||
* Multi-node (including high-availability) clusters
|
||||
* Building Kubernetes release builds from source
|
||||
* Make/Bash/Docker or Bazel, in addition to pre-published builds
|
||||
* Linux, macOS, and Windows
|
||||
|
||||
|
||||
|
||||
In addition, kind is a Cloud Native Computing Foundation (CNCF)-certified conformant Kubernetes installer. Because it's open source, you can find kind's [source code][5] in its GitHub repository.
|
||||
|
||||
### CodeReady Container (CRC)
|
||||
|
||||
![CodeReady Container][15]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
If you want to try the latest version of OpenShift locally, try Red Hat [CodeReady Containers][16] (CRC). CRC brings a minimal OpenShift 4.x cluster to your local computer that provides a minimal environment for development and testing purposes. CRC is mainly targeted for use on developers' desktops.
|
||||
|
||||
You can find CodeReady Container's [source code][6] on GitHub, also available under the Apache 2.0 license.
|
||||
|
||||
### Minishift
|
||||
|
||||
![Minishift][17]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
The [Minishift][7] project [helps you run a version of OpenShift][18] with [OKD][19] locally with a single-node OpenShift cluster inside a virtual machine. You can use it to [try OpenShift][20] or to develop for the cloud, on your local host.
|
||||
|
||||
Like the other tools on this list, Minishift is open source, and you can access its [source code][7] on GitHub.
|
||||
|
||||
### Kubernetes for the people
|
||||
|
||||
As you can see, there are several ways to try out Kubernetes in your local environment. Did I miss anything? Feel free to leave a comment to ask a question or make a suggestion.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/11/run-kubernetes-locally
|
||||
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/brson
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
|
||||
[2]: https://kubernetes.io/
|
||||
[3]: https://www.apache.org/licenses/LICENSE-2.0
|
||||
[4]: https://github.com/kubernetes/minikube
|
||||
[5]: https://github.com/kubernetes-sigs/kind
|
||||
[6]: https://github.com/code-ready/crc
|
||||
[7]: https://github.com/minishift/minishift
|
||||
[8]: https://opensource.com/sites/default/files/uploads/1_minikube.jpg (Minikube)
|
||||
[9]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[10]: https://minikube.sigs.k8s.io/docs/
|
||||
[11]: https://minikube.sigs.k8s.io/docs
|
||||
[12]: https://minikube.sigs.k8s.io/docs/start/
|
||||
[13]: https://opensource.com/sites/default/files/uploads/2_kind.jpg (kind)
|
||||
[14]: https://kind.sigs.k8s.io
|
||||
[15]: https://opensource.com/sites/default/files/uploads/4_crc.jpg (CodeReady Container)
|
||||
[16]: https://code-ready.github.io/crc
|
||||
[17]: https://opensource.com/sites/default/files/uploads/3_minishift.jpg (Minishift)
|
||||
[18]: https://www.redhat.com/sysadmin/kubernetes-cluster-laptop
|
||||
[19]: https://www.okd.io/
|
||||
[20]: https://www.redhat.com/sysadmin/learn-openshift-minishift
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,5 +1,5 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: ( )
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
|
@ -1,66 +0,0 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (chenmu-kk)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Most enterprise networks can't handle big data loads)
|
||||
[#]: via: (https://www.networkworld.com/article/3440519/most-enterprise-networks-cant-handle-big-data-loads.html)
|
||||
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
|
||||
|
||||
大多数企业网络无法处理大数据负载
|
||||
======
|
||||
随着越来越多的数据通过网络传输,由于领导力和技术问题,数据网络跟上数据传输速度的工作正在滞后。
|
||||
Metamorworks / Getty Images
|
||||
|
||||
又过了一周,另一项调查发现,IT已经无法跟上不断膨胀的数据过载。这次问题将围绕着网络带宽和整体性能展开。
|
||||
|
||||
管理咨询公司埃森哲(Accenture)对[300名IT专业人士进行的一项调查][1] 发现,大多数人感觉他们企业网络无法胜任处理大数据的任务和物联网 (IoT) 部署。只有43%的受访公司表示他们的网络已经准备好支持云服务、物联网和其他数字技术。
|
||||
|
||||
**[ Learn more about SDN: Find out [where SDN is going][2] and learn the [difference between SDN and NFV][3]. | Get regularly scheduled insights: [Sign up for Network World newsletters][4]. ]**
|
||||
|
||||
一个关键原因(58%)是“IT与商业需求的不一致性”,这减缓了这些项目的推出。这是一个不同寻常的发现,因为85%的受访者也表示他们的网络已经完全或者大体上已经准备好支持企业的数字化计划。到底是哪一个呢?
|
||||
|
||||
第二和第三大时常提及的障碍是“业务需求和运营需求间固有的复杂性”以及“对带宽、性能等方面的需求超过交付能力”,各占45%。
|
||||
|
||||
由于分析技术和其他大数据技术的推动,大量传输数据持续涌入网络线路,网络瓶颈持续增长。调查发现,带宽需求并未满足,目前的网络性能依旧达不到要求。
|
||||
|
||||
其他原因还包括缺乏网络技术、设备扩展和设备老化。
|
||||
|
||||
### 网络性能问题的一个解决方案:SDN
|
||||
|
||||
埃森哲发现,大多数公司表示 [软件定义网络 (SDN)][5] 是应对带宽和性能挑战的解决方案,77%的受访企业在调查中表示正在部署SDN或者已完成部署。它指出,虽然SDN可能在组织的某部分中存在,它并不总是在整个企业范围内统一地推出。
|
||||
|
||||
**** From HPE: [ITaaS and Corporate Storage Technology][6]: This blog explains why pay-per-use IT models, such as ITaaS, could be the next chapter in IT infrastructure. (Sponsored) ****
|
||||
|
||||
如今看来,似乎从未有人有足够的预算来满足他们所有的IT雄心,但31%受访者认为网络改善筹资“简单”。而且在网络基础设施团队的控制下,首席信息官/首席技术官更可能将融资过程报告为“轻松”(40%),相较于直接下属(13%)或基础设施/网络主管和副总裁(19%)。
|
||||
|
||||
报告指出,“仅靠传统网络无法支持数字时代所需的创新和性能。”呼吁拥抱新技术,但没有提到SDN的名字。同时呼吁首席执行官和他们直接下属间加强合作,因为很明显,双方在看待问题的方式上存在分歧。
|
||||
|
||||
报告总结说,“我们认为需要一种新的网络范式来确保网络满足当前和未来的业务需求。然而,尽管有进步的迹象,但改变的步伐缓慢。公司必须承担起重担,才能实现统一和标准化企业能力,提供必要的带宽、性能和安全,以支持当前和未来的业务需求”。
|
||||
|
||||
**[ Now see: [How network pros acquire skills for SDN, programmable networks][7] ]**
|
||||
|
||||
Join the Network World communities on [Facebook][8] and [LinkedIn][9] to comment on topics that are top of mind.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.networkworld.com/article/3440519/most-enterprise-networks-cant-handle-big-data-loads.html
|
||||
|
||||
作者:[Andy Patrizio][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[chenmu-kk](https://github.com/chenmu-kk)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.networkworld.com/author/Andy-Patrizio/
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://www.accenture.com/_acnmedia/pdf-107/accenture-network-readiness-survey.pdf#zoom=50
|
||||
[2]: https://www.networkworld.com/article/3209131/lan-wan/what-sdn-is-and-where-its-going.html
|
||||
[3]: https://www.networkworld.com/article/3206709/lan-wan/what-s-the-difference-between-sdn-and-nfv.html
|
||||
[4]: https://www.networkworld.com/newsletters/signup.html
|
||||
[5]: https://www.networkworld.com/article/3209131/what-sdn-is-and-where-its-going.html
|
||||
[6]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/
|
||||
[7]: https://www.networkworld.com/article/3405522/how-network-pros-acquire-skills-for-sdn-programmable-networks.html
|
||||
[8]: https://www.facebook.com/NetworkWorld/
|
||||
[9]: https://www.linkedin.com/company/network-world
|
166
translated/tech/20200928 Add sound to your Python game.md
Normal file
166
translated/tech/20200928 Add sound to your Python game.md
Normal file
@ -0,0 +1,166 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (robsean)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (Add sound to your Python game)
|
||||
[#]: via: (https://opensource.com/article/20/9/add-sound-python-game)
|
||||
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
|
||||
|
||||
添加声音到你的 Python 游戏
|
||||
======
|
||||
通过添加声音到你的游戏中,听听当你的英雄战斗,跳跃,收集战利品时会发生什么。学习如何在这一 Pygame 系列的第十三篇文章中,创建一个声音平台类精灵。
|
||||
![彩色声波图][1]
|
||||
|
||||
这是仍在进行中的关于使用 [Pygame][3] 模块来在 [Python 3][2] 中创建电脑游戏的第十三部分。先前的文章是:
|
||||
|
||||
1. [通过构建一个简单的掷骰子游戏去学习怎么用 Python 编程][4]
|
||||
2. [使用 Python 和 Pygame 模块构建一个游戏框架][5]
|
||||
3. [如何在你的 Python 游戏中添加一个玩家][6]
|
||||
4. [用 Pygame 使你的游戏角色移动起来][7]
|
||||
5. [如何向你的 Python 游戏中添加一个敌人][8]
|
||||
6. [在 Pygame 游戏中放置平台][9]
|
||||
7. [在你的 Python 游戏中模拟引力][10]
|
||||
8. [为你的 Python 平台类游戏添加跳跃功能][11]
|
||||
9. [使你的 Python 游戏玩家能够向前和向后跑][12]
|
||||
10. [在你的 Python 平台类游戏中放一些奖励][13]
|
||||
11. [添加计分到你的 Python 游戏][14]
|
||||
12. [在你的Python游戏中加入投掷技巧][15]
|
||||
|
||||
|
||||
|
||||
Pygame 提供了一种简单的方法来集成声音到你的 Python 电脑游戏中。Pygame 的 [mixer 模块][16] 可以依据命令播放一个或多个声音,并且你也可以将这些声音混合在一起,例如,你能够在听到你的英雄收集奖励或跳过敌人声音的同时播放背景音乐。
|
||||
|
||||
集成 mixer 模块到一个已存在的游戏中是很容易的,因此 — 并不是给予你代码示例来向你展示放置它们的准确位置 — 这篇文章分四个所需要的步骤来阐明如何在你应用程序中的获取声音。
|
||||
|
||||
### 启动 mixer
|
||||
|
||||
首先,在你代码的 setup 部分,启动 mixer 进程。你的代码已经启动 Pygame 和 Pygame 字体,因此将它们归类到一起是一个很好的主意:
|
||||
|
||||
|
||||
```
|
||||
pygame.init()
|
||||
pygame.font.init()
|
||||
pygame.mixer.init() # add this line
|
||||
```
|
||||
|
||||
### 定义声音
|
||||
|
||||
接下来,你必需定义你想要使用的声音。这样就要求你的计算机上有声音文件,就像使用字体就要求你有字体文件,使用图像就要求你有图像文件一样。
|
||||
|
||||
你还必需把这些声音与你的游戏捆绑在一起,以便任何玩你游戏的人都有声音文件。
|
||||
|
||||
为将一个声音与你的游戏捆绑在一起,首先在你的游戏目录中创建一个新的目录,就像你为你图像和字体创建的目录一样。称它为 `sound`:
|
||||
|
||||
|
||||
```
|
||||
s = 'sound'
|
||||
```
|
||||
|
||||
尽管在互联网上有很多声音文件,下载这些声音文件并将其与你的游戏一起分发并不一定是合法的。这看起来是很奇怪的,因为这么多来自著名电脑游戏的声音是流行文化的一部分,但法律就是这样运作的。如果你想与你的游戏一起分发一个声音文件,你必需找到一个开放源码或 [Creative Commons][17] 声音文件,它们准许与游戏一起提供声音。
|
||||
|
||||
这里有一些专门提供自由和合法的声音文件的网站,包括:
|
||||
|
||||
* [Freesound][18] 托管存储所有种类的音效。
|
||||
* [Incompetech][19] 托管存储背景音乐。
|
||||
* [Open Game Art][20] 托管存储一些音效和音乐。
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
一些声音文件只有当你给予作曲家或声音设计师一下费用时才是可以自由使用的。在与你的游戏捆绑前,仔细阅读使用条件!音乐家和声音设计师在声音上的工作就像你在代码上的工作一样努力,因此当他们不要一些费用时,给予他们一些费用也是极好的。
|
||||
|
||||
给予你的声音源文件一些费用,在一个名称为 `CREDIT` 的文本文件中列出你使用的声音,并在你的游戏文件夹中放置该文本文件。
|
||||
|
||||
你也可以尝试制作你自己的音乐。极好的 [LMMS][21] 音频工作站易于使用,并携带很多有趣的声音。它在所有主要的平台上都可以使用,也可以导出为 [Ogg Vorbis][22] (OGG) 音频格式。
|
||||
|
||||
### 添加声音到 Pygame
|
||||
|
||||
当你找到你喜欢的一个声音文件时,下载它。如果它来自一个 ZIP 或 TAR 文件中,提取它并将其移动到你游戏目录中的 `sound` 文件夹中。
|
||||
|
||||
如果声音文件有一个带有空格或特殊字符的名字,重新命名它。文件名称是完全随意的,它的名称越简单,你就越容易输入到你的代码中。
|
||||
|
||||
大多数的电脑游戏使用 OGG 格式声音文件,因为这种格式在占有较小空间的情况下提供高质量的声音。当你下载一个声音文件时,它可能是一个 MP3, WAVE, FLAC, 或者其它的音频格式。为保持你的文件的较高兼容性和降低下载文件大小,使用一个工具 (像 [fre:ac][23] 或 [Miro][24]) 来转换这些的文件格式为 Ogg 格式。
|
||||
|
||||
例如,假设你已经下载一个称为 ouch.ogg 的声音文件。
|
||||
|
||||
在你代码的 setup 部分中,创建一个代表这你想使用的声音文件的变量:
|
||||
|
||||
|
||||
```
|
||||
ouch = pygame.mixer.Sound(os.path.join(s, 'ouch.ogg'))
|
||||
```
|
||||
|
||||
### 触发一个声音
|
||||
|
||||
为使用一个声音,你所需要做的全部工作是,当你想触发声音时来调用变量。例如,当你的玩家击中一名敌人时,触发 `OUCH` 声音效果:
|
||||
|
||||
|
||||
```
|
||||
for enemy in enemy_hit_list:
|
||||
pygame.mixer.Sound.play(ouch)
|
||||
score -= 1
|
||||
```
|
||||
|
||||
你可以为所有的动作类型创建声音,例如,跳跃,收集奖励,投掷,碰撞,和任何你可以想象到的东西。
|
||||
|
||||
### 添加背景音乐
|
||||
|
||||
如果你有你想在你的游戏的背景中播放的音乐或令人激动的音效,你可以使用 Pygame 中的 mixer 模块中的`music` 函数。在你的 setup 部分中,加载音乐文件:
|
||||
|
||||
|
||||
```
|
||||
music = pygame.mixer.music.load(os.path.join(s, 'music.ogg'))
|
||||
```
|
||||
|
||||
然后,开始音乐:
|
||||
|
||||
|
||||
```
|
||||
pygame.mixer.music.play(-1)
|
||||
```
|
||||
|
||||
`-1` 值来告诉 Pygame 无限循环音乐文件。你可以将其设置为 `0` 或任意更高的数值,以定义音乐在停止前循环多少次。
|
||||
|
||||
### 享受声音时空
|
||||
|
||||
音乐和声音可以为你的游戏添加很多韵味。尝试添加一些声音到你的 Pygame 工程!
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/9/add-sound-python-game
|
||||
|
||||
作者:[Seth Kenlon][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[robsean](https://github.com/robsean)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/seth
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
|
||||
[2]: https://www.python.org/
|
||||
[3]: https://www.pygame.org/news
|
||||
[4]: https://opensource.com/article/17/10/python-101
|
||||
[5]: https://opensource.com/article/17/12/game-framework-python
|
||||
[6]: https://opensource.com/article/17/12/game-python-add-a-player
|
||||
[7]: https://opensource.com/article/17/12/game-python-moving-player
|
||||
[8]: https://opensource.com/article/18/5/pygame-enemy
|
||||
[9]: https://opensource.com/article/18/7/put-platforms-python-game
|
||||
[10]: https://opensource.com/article/19/11/simulate-gravity-python
|
||||
[11]: https://opensource.com/article/19/12/jumping-python-platformer-game
|
||||
[12]: https://opensource.com/article/19/12/python-platformer-game-run
|
||||
[13]: https://opensource.com/article/19/12/loot-python-platformer-game
|
||||
[14]: https://opensource.com/article/20/1/add-scorekeeping-your-python-game
|
||||
[15]: https://opensource.com/article/20/9/add-throwing-python-game
|
||||
[16]: https://www.pygame.org/docs/ref/mixer.html
|
||||
[17]: https://opensource.com/article/20/1/what-creative-commons
|
||||
[18]: https://freesound.org
|
||||
[19]: https://incompetech.filmmusic.io
|
||||
[20]: https://opengameart.org
|
||||
[21]: https://opensource.com/life/16/2/linux-multimedia-studio
|
||||
[22]: https://en.wikipedia.org/wiki/Vorbis
|
||||
[23]: https://www.freac.org/index.php/en/downloads-mainmenu-330
|
||||
[24]: http://getmiro.com
|
136
translated/tech/20201103 4 ways to run Kubernetes locally.md
Normal file
136
translated/tech/20201103 4 ways to run Kubernetes locally.md
Normal file
@ -0,0 +1,136 @@
|
||||
[#]: collector: (lujun9972)
|
||||
[#]: translator: (geekpi)
|
||||
[#]: reviewer: ( )
|
||||
[#]: publisher: ( )
|
||||
[#]: url: ( )
|
||||
[#]: subject: (4 ways to run Kubernetes locally)
|
||||
[#]: via: (https://opensource.com/article/20/11/run-kubernetes-locally)
|
||||
[#]: author: (Bryant Son https://opensource.com/users/brson)
|
||||
|
||||
本地运行 Kubernetes 的 4 种方法
|
||||
======
|
||||
设置一个本地开发环境,或者直接用这些工具尝试容器编排平台。
|
||||
![Business woman on laptop sitting in front of window][1]
|
||||
|
||||
[Kubernetes][2] 是一个开源的容器编排平台。它由 Google 开发,为自动化部署、扩展和管理容器化应用提供了一个开源系统。虽然大多数人在云环境中运行 Kubernetes,但在本地运行 Kubernetes 集群不仅是可能的,它还至少有两个好处:
|
||||
|
||||
* 在决定使用 Kubernetes 作为主要平台部署应用之前,你可以快速试用它。
|
||||
* 在将任何东西推送到公共云之前,你可以将其设置为本地开发环境,从而实现开发环境和生产环境之间的分离。
|
||||
|
||||
|
||||
|
||||
无论你的情况如何,将本地 Kubernetes 环境设置为你的开发环境都是推荐的选择,因为这种设置可以创建一个安全而敏捷的应用部署流程。
|
||||
|
||||
幸运的是,有多个平台可以让你尝试在本地运行 Kubernetes,它们都是开源的,并且都是 [Apache 2.0][3] 许可。
|
||||
|
||||
* [Minikube][4] 的主要目标是成为本地 Kubernetes 应用开发的最佳工具,并支持所有适合的 Kubernetes 特性。
|
||||
* [kind][5] 使用 Docker 容器“节点”运行本地 Kubernetes 集群。
|
||||
* [CodeReady Containers][6] (CRC) 管理为测试和开发目的优化的本地 OpenShift 4.x 集群。
|
||||
* [Minishift][7] 通过在虚拟机 (VM) 内运行单节点 OpenShift 集群,帮助你在本地运行 OpenShift 3.x 集群。
|
||||
|
||||
|
||||
|
||||
### Minikube
|
||||
|
||||
![Minikube][8]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
[Minikube][10] 是在本地计算机上运行 Kubernetes 环境的最知名和最流行的选择。无论你使用什么操作系统,[Minikube 的文档][11]都会为你提供一个简单的[安装][12]指南。一般来说,安装 Minikube 只需运行两条命令:
|
||||
|
||||
|
||||
```
|
||||
$ curl -LO <https://storage.googleapis.com/minikube/releases/latest/minikube-PLATFORM-amd64>
|
||||
$ sudo install minikube-PLATFORM-amd64 /usr/local/bin/minikube
|
||||
```
|
||||
|
||||
Minikube 可在Linux、macOS 或 Windows 上快速设置本地 Kubernetes 集群,其功能如下:
|
||||
|
||||
* 支持最新的 Kubernetes 版本(包括 6 个以前的小版本)
|
||||
* 跨平台 (Linux、macOS、Windows)
|
||||
* 以虚拟机、容器或裸机的形式部署
|
||||
* 多个容器运行时 (CRI-O、containerd、Docker)
|
||||
* 用于快速推送镜像的 Docker API 端点
|
||||
* 负载均衡器、文件系统挂载、FeatureGates 和其他高级功能
|
||||
* 用于轻松安装 Kubernetes 应用的附加组件
|
||||
|
||||
|
||||
|
||||
因为 Minikube 是一个开源项目,你可以对它的[源代码][4]做贡献。
|
||||
|
||||
### kind
|
||||
|
||||
![kind][13]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
[kind][14] 的开发者将其描述为“一个使用 Docker 容器“节点”运行本地 Kubernetes 集群的工具”。它是为测试 Kubernetes 而设计的,但也可能用于本地开发或持续集成。
|
||||
|
||||
kind 支持:
|
||||
|
||||
* 多节点(包括高可用性)集群。
|
||||
* 从源码构建 Kubernetes 版本
|
||||
* Make/Bash/Docker 或 Bazel,以及预发布构建。
|
||||
* Linux、MacOS 和 Windows
|
||||
|
||||
|
||||
|
||||
此外,kind 是一个经过云原生计算基金会 (CNCF) 认证的 Kubernetes 合规安装程序。因为它是开源的,你可以在它的 GitHub 仓库中找到 kind 的[源码][5]。
|
||||
|
||||
### CodeReady Container (CRC)
|
||||
|
||||
![CodeReady Container][15]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
如果你想在本地尝试最新版本的 OpenShift,可以尝试红帽的 [CodeReady Containers][16] (CRC)。CRC 将一个最小的 OpenShift 4.x 集群带到你的本地计算机上,为开发和测试目的提供一个最小的环境。CRC 主要针对开发者的桌面使用。
|
||||
|
||||
你可以在 GitHub 上找到 CodeReady Container 的[源码][6],也是在 Apache 2.0 许可下提供的。
|
||||
|
||||
### Minishift
|
||||
|
||||
![Minishift][17]
|
||||
|
||||
(Bryant Son, [CC BY-SA 4.0][9])
|
||||
|
||||
[Minishift][7] 项目帮助你在本地用 [OKD][19] 在虚拟机内的单节点 OpenShift 集群[运行一个版本的 OpenShift][18]。你可以用它来[尝试 OpenShift][20],或者在你的本地主机上为云开发。
|
||||
|
||||
和这个列表中的其他工具一样,Minishift 也是开源的,你可以在 GitHub 上访问它的[源码][7]。
|
||||
|
||||
### 为人服务的 Kubernetes
|
||||
|
||||
正如你所看到的,有几种方法可以在本地环境中试用 Kubernetes。我有遗漏么?欢迎留言提问或提出建议。
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://opensource.com/article/20/11/run-kubernetes-locally
|
||||
|
||||
作者:[Bryant Son][a]
|
||||
选题:[lujun9972][b]
|
||||
译者:[geekpi](https://github.com/geekpi)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://opensource.com/users/brson
|
||||
[b]: https://github.com/lujun9972
|
||||
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating)
|
||||
[2]: https://kubernetes.io/
|
||||
[3]: https://www.apache.org/licenses/LICENSE-2.0
|
||||
[4]: https://github.com/kubernetes/minikube
|
||||
[5]: https://github.com/kubernetes-sigs/kind
|
||||
[6]: https://github.com/code-ready/crc
|
||||
[7]: https://github.com/minishift/minishift
|
||||
[8]: https://opensource.com/sites/default/files/uploads/1_minikube.jpg (Minikube)
|
||||
[9]: https://creativecommons.org/licenses/by-sa/4.0/
|
||||
[10]: https://minikube.sigs.k8s.io/docs/
|
||||
[11]: https://minikube.sigs.k8s.io/docs
|
||||
[12]: https://minikube.sigs.k8s.io/docs/start/
|
||||
[13]: https://opensource.com/sites/default/files/uploads/2_kind.jpg (kind)
|
||||
[14]: https://kind.sigs.k8s.io
|
||||
[15]: https://opensource.com/sites/default/files/uploads/4_crc.jpg (CodeReady Container)
|
||||
[16]: https://code-ready.github.io/crc
|
||||
[17]: https://opensource.com/sites/default/files/uploads/3_minishift.jpg (Minishift)
|
||||
[18]: https://www.redhat.com/sysadmin/kubernetes-cluster-laptop
|
||||
[19]: https://www.okd.io/
|
||||
[20]: https://www.redhat.com/sysadmin/learn-openshift-minishift
|
Loading…
Reference in New Issue
Block a user