梁斌penny_Penny Pinching in the Cloud:如何以10美元的价格运行为期两天的虚拟会议

梁斌penny

梁斌penny

DotNetConf Logo

We've just finished Day One of "DotNetConf" our community-run free online conference for developers who love the .NET development platform and open source!

我们刚刚结束了由社区运营的免费在线会议“ DotNetConf ”的第一天,该会议由热爱.NET开发平台和开源代码的开发人员组成!

UPDATE: All the Videos from both days of DotNetConf are now online and available for on-demand viewing!

更新:这两天DotNetConf的所有视频现在都可以在线观看,并且可以按需观看

会议平台 (The Conference Platform)

It seems funny to call the software our conference runs on a "platform" as that sounds very "enterprisey" and official. In the past we've done aspConf and mvcConf with sponsors who helped pay for things. We used Channel 9 and had a studio and streamed either from Seattle or using Live Meeting.

称我们的会议运行在“平台”上的软件听起来很可笑,这听起来非常“企业化”和正式。 过去,我们与赞助付费的赞助商合作过aspConfmvcConf 。 我们使用了第9频道并设有一个工作室,并从西雅图或使用Live Meeting进行流媒体播放。

However, this year we wanted to do it on the cheap and more distributed. We wanted speakers from ALL over in all time zones. How cheap? About USD$10ish we figure. I'll get a complete bill later, but we basically wanted to scale up, do the talks and scale down.

但是,今年我们想以便宜且分布更广的方式来做。 我们希望所有时区的所有人都来演讲。 便宜吗我们估计大约10美元。 稍后我会收到一份完整的帐单,但我们基本上想扩大规模,进行会谈并缩小规模。

视频广播和屏幕共享 (Video Broadcasting and Screen-sharing)

  • This year we are using Google Hangouts with their "Hangouts On Air" feature. A "dotnetconf" Google Account invites the presenter to a Hang Out and check the "on air" box before start the hangout. Then we use the Hangout Toolbox to dynamically add on screen graphics and speaker labels. Everyone sets their resolution to 1280x768 and the live stream ends scaling down to 480p.

    今年,我们将Google Hangouts与“ Hangouts直播”功能结合使用。 在发起视频群聊之前,“ dotnetconf” Google帐户邀请演示者加入视频群聊并选中“直播”框。 然后,我们使用环聊工具箱动态添加屏幕图形和扬声器标签。 每个人都将其分辨率设置为1280x768,直播流将缩小到480p。
  • Once you hit "Start Broadcast" you're given a YouTube link to the live stream. When you hit End Broadcast, the resulting video is ready to go on your YouTube page within minutes. The hangout owner (me or Javier) then clicks "Hide in Broadcast" and fades away. You can see I'm faded away in the below screenshot. I'm there, but only if I need to be. When there's only one active presenter the Hangout turns into a full screen affair, which is what we want.

    点击“开始广播”后,您会获得一个指向直播流的YouTube链接。 当您点击“结束播放”时,生成的视频可在几分钟之内准备好在您的YouTube页面播放。 视讯聚会的拥有者(我或Javier)然后按一下[隐藏在广播中]并消失。 您可以在下面的屏幕截图中看到我已经淡出。 我在那里,但只有在我需要的时候。 当只有一名活跃的演示者时,环聊会变成全屏显示,这就是我们想要的。

  • Important Note: Rather than an 8 hour Hangout, we started and stopped as each speaker did their talk. This means that our talks are already discrete on the YouTube page. The YouTube videos can have their start and end times trimmed so the start isn't so rough.

    重要说明:我们不是在8小时的视讯聚会中而是在每个演讲者讲话时开始和停止。 这意味着我们的演讲在YouTube页面上已经是离散的。 YouTube视频的开始时间和结束时间可以调整,因此开始并不是那么困难。

Google Hangouts On Air

数据库 (The Database)

Surprise! There is no database. There is no need for one. We're running a two page site using ASP.NET Web Pages written in WebMatrix. It runs in the Azure cloud but since our dataset (speakers, schedule, the video stream location, etc) isn't changing a lot, we put all the data in XML files. It's data, sure, but it's a poor man's database. Why pay for more than we need?

惊喜! 没有数据库。 不需要一个。 我们正在使用WebMatrix编写的ASP.NET Web Pages运行两个页面的站点。 它运行在Azure云中,但是由于我们的数据集(扬声器,时间表,视频流位置等)变化不大,因此我们将所有数据都放在XML文件中。 当然是数据,但这是一个穷人的数据库。 为什么要付出比我们​​所需更多的钱?

How do we update the "database" during the talk? Get ready to have an opinion. The data is in Dropbox. (Yes, it could have been SkyDrive, or another URL, but we used DropBox)

演讲期间我们如何更新“数据库”? 准备发表意见。 数据在Dropbox中。 (是的,可能是SkyDrive或其他URL,但我们使用了DropBox)

Our Web App pulls the data from Dropbox URLs and caches it. Works pretty nice.

我们的Web应用程序从Dropbox URL中提取数据并进行缓存。 效果很好。

<appSettings>
<add key="url.playerUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/VideoStreams.xml" />
<add key="url.scheduleUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/Schedule.xml" />
<add key="url.speakerUrl" value="https://dl.dropboxusercontent.com/s/fancypantsguid/Speakers.xml" />
<add key="Microsoft.ServiceBus.ConnectionString" value="Endpoint=sb://[your namespace].servicebus.windows.net;SharedSecretIssuer=owner;SharedSecretValue=[your secret]" />
</appSettings>

The code is simple, as code should be. Wanna show the schedule? And yes , it's a TABLE. It's a table of the schedule. Nyah.

代码很简单,应该如此。 想显示时间表吗? 是的,这是一张桌子。 这是时间表的表。 Nyah。

@foreach(var session in schedule) {
var confTime = session.Time;
var pstZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
var attendeeTime = TimeZoneInfo.ConvertTimeToUtc(confTime, pstZone);
<tr>
<td>
<p>@confTime.ToShortTimeString() (PDT)</p>
<p>@attendeeTime.ToShortTimeString() (GMT)</p>
</td>
<td>
<div class="speaker-info">
<h4>@session.Title</h4>
<br>
<span class="company-name"><a class="speaker-website" href="/speakers.cshtml?speaker=@session.Twitter">@session.Name</a></span>
<br>
<p>@session.Abstract</p>
</div>
</td>
</tr>
}

向外扩展 (Scaling Out)

Scaling DotNetConf

We've been on an extra small Azure Website and then switched to two large (and finally, two medium as large was totally overkill) web sites. 

我们曾经在一个额外的小型Azure网站上使用,然后切换到两个大型网站(最后,两个中等大小的网站完全被淘汰了)。

We scale up (and hence, pay) only during the conference and turn it down to Small when we're done. No need to spend money if we don't need to.

我们仅在会议期间扩大规模(并因此付费),完成后将其缩小为“小”。 如果我们不需要,不需要花钱。

Scaling DotNetConf to Large

使用SignalR实时更新站点 (Updating the Site in Real-time with SignalR)

Because the YouTube link changes with each Hangout, we had the problem that attendees of the conference would have to hit refresh themselves to get the new URL. There's a number of solutions to this that I'm sure you're already thinking about. We could meta refresh, refresh on a timer, but these aren't on demand. We also wanted to show a few videos during the downtime. One of us preps the next speaker while the other queues up videos to watch.

由于YouTube链接随每个环聊而变化,因此存在一个问题,即会议与会者必须自行刷新以获取新的URL。 我确信您已经在考虑许多解决方案。 我们可以进行元刷新,在计时器上刷新,但是这些不是必需的。 我们还想在停机期间显示一些视频。 我们中的一个准备下一位演讲者,而另一个则将视频排队观看。

We realized this was a problem at about 10pm PST last night. Javier and I got on Skype and came up with this late night hack.

我们意识到这是昨晚太平洋标准时间晚上10点左右的问题。 哈维尔和我上了Skype,并想出了这个深夜黑客。

What if everyone had SignalR running while their were watching the videos? Then we could push out the next YouTube video from an admin console.

如果每个人都在观看视频时让SignalR运行该怎么办? 然后,我们可以从管理控制台中推出下一个YouTube视频。

So visualize this. There's the watcher (you), there's a admin (me) and there's the server (the Hub).

因此,将其可视化。 有观察者(您),有管理员(我)和服务器(集线器)。

The watcher has this on their main page after including the /signalr/hub JavaScript:

包含/ signalr / hub JavaScript之后,观察者将其放在主页上:

$(function () {
var youtube = $.connection.youTubeHub;
$.connection.hub.logging = true;

youtube.client.updateYouTube = function (message, password) {
$("#youtube").attr("src", "http://www.youtube.com/embed/" + message + "?autoplay=1");
};
$.connection.hub.start();

$.connection.hub.disconnected(function () {
setTimeout(function () {
$.connection.hub.start();
}, 5000);
});
});

The watcher is listening, er, watching, for a SignalR message from the server with the YouTube video short code. When we get it, we swap out the iFrame. Simple and it works.

观察者正在听,看,看来自服务器的带有YouTube视频短代码的SignalR消息。 收到后,我们换出了iFrame。 简单且有效。

Here's the admin console where we put in the next YouTube code (I'm using Razor in ASP.NET Web Pages in WebMatrix, so this is mixed HTML/JS):

这是管理控制台,我们在其中放入下一个YouTube代码(我在WebMatrix的ASP.NET网页中使用Razor,因此这是HTML / JS混合):

<div id="container">
<input type="text" id="videoId" name="videoId"><br/>
<input type="text" id="password" name="passsword" placeholder="password"><br/>
<button id="playerUpdate" name="playerUpdate">Update Player</button>
</div>

@section SignalR {
<script>
$(function () {
var youtube = $.connection.youTubeHub;
$.connection.hub.logging = true;

$.connection.hub.start().done(function () {
$('#playerUpdate').click(function () {
youtube.server.update($('#videoId').val(), $('#password').val());
});
});
$.connection.hub.disconnected(function() {
setTimeout(function() {
$.connection.hub.start();
}, 5000);
});
});
</script>
}

We put in the short code, the password and update. All this must be complex eh? What's the powerful SignalR backend up running in the cloud backed by the power of Azure and Service Bus look like? Surely that code must be too complex to show on a simple blog, eh? Strap in, friends.

我们输入短代码,密码并进行更新。 所有这些必须很复杂吗? 在Azure和Service Bus的强大支持下,在云中运行的强大SignalR后端是什么样的? 当然,代码必须太复杂而无法显示在简单的博客上,是吗? 带上朋友们。

public class YouTubeHub : Microsoft.AspNet.SignalR.Hub
{
public void update(string message, string password)
{
if (password.ToLowerInvariant() == "itisasecret")
{
Clients.All.updateYouTube(message);
ConfContext.SetPlayerUrl(message);
}
}
}

This is either a purist's nightmare or a pragmatists dream. Either way, we've been running it all day and it works. Between talks we pushed in pre-recorded talks and messages, then finally when the live talk started we pushed that one as well.

这要么是纯粹主义者的噩梦,要么是实用主义者的梦想。 无论哪种方式,我们都一直在运行它,并且它可以正常工作。 在对话之间,我们推送了预先录制的对话和消息,然后最终当现场对话开始时,我们也推送了该对话和消息。

We also updated the DropBox links with the current Video Stream so that new visitors showing up would get the latest video, as new site visitors wouldn't have been connected when the video "push" message went out.

我们还用当前的视频流更新了DropBox链接,以使出现的访问者可以获得最新的视频,因为当视频“推送”消息发出时,新的站点访问者将不会被连接。

What about scale out? We sometimes have two machines in the farm so we need the SignalR "push updated youtube video message" to travel across a scale-out backplane. That took another 10 minutes.

那横向扩展呢? 有时我们在农场中有两台机器,因此我们需要SignalR“推送更新的youtube视频消息”以跨横向扩展底板传输。 又花了10分钟。

使用Azure Service Bus扩展SignalR (Scaling out with SignalR using the Azure Service Bus)

We used the SignalR 1.1 Beta plus Azure Service Bus Topics for scale out and added an Azure Service Bus to our account. Our app startup changed, adding this call to UseServiceBus():

我们使用SignalR 1.1 BetaAzure Service Bus主题进行横向扩展,并将Azure Service Bus添加到我们的帐户中。 我们的应用启动发生了变化,将此调用添加到UseServiceBus():

string poo = "Endpoint=sb://dotnetconf-live-bus.servicebus.windows.net/;SharedSecretIssuer=owner;SharedSecretValue=g57totalsecrets=";   
GlobalHost.DependencyResolver.UseServiceBus(poo,"dotnetconf");
RouteTable.Routes.MapHubs();

Now SignalR uses the Service Bus Topics for "Pub/Sub" to pass notifications between the two web servers. I can push a new video from Web 1 and it is sent to everyone on Web 1 and Web 2 (or Web N) via SignalR's realtime persistent connection.

现在,SignalR使用“ Pub / Sub”的服务总线主题在两个Web服务器之间传递通知。 我可以从Web 1推送新视频,然后通过SignalR的实时持久连接将其发送到Web 1和Web 2(或Web N)上的每个人。

image

We'll delete this Service Bus Topic as soon as we are done. I would hate for the bill to get up into the nickels. ;) Here's example pricing from the Azure site:

完成后,我们将立即删除此服务总线主题。 我不希望该法案付诸东流。 ;)这是Azure网站的示例定价

432,000 Service Bus messages cost 432,000/10,000 * $0.01 = 44 * $0.01 = $0.44 per day.

每天432,000条服务总线消息的成本为432,000 / 10,000 * $ 0.01 = 44 * $ 0.01 = $ 0.44。

I'm not sure how many messages we've done, but I can rest assured it won't cost a pile, so that's a relief.

我不确定我们已经完成了多少条消息,但是我可以放心,它不会花费很多,所以这是一种缓解。

谢谢社区! (Thank you to the Community!)

  • Big thanks to designer Jin Yang who created the dotnetConf logo and design. Tweet @jzy and tell him you think he is special. Thanks to Dave Ward for converting Jzy's design into HTML!

    非常感谢设计了dotnetConf徽标和设计的设计师Jin Yang 。 鸣叫@jzy,并告诉他您认为他很特别。 感谢Dave Ward将Jzy的设计转换为HTML!

  • Kudos and thanks to Javier Lozano for his coding, his organizing, his brainstorming and his tireless hard work. It was also cool for him to sit with me for hours last night while we hacked on SignalR and the DotNetConf.net site.

    感谢,哈维尔·洛扎诺( Javier Lozano)的编码,组织,头脑风暴和不懈的努力。 昨晚当我们在SignalR和DotNetConf.net网站上遭到黑客入侵时,他和我一起坐了几个小时也很酷。

  • Thanks to David Fowler for saying "it'll just take 10 minutes to add Service Bus." 

    感谢David Fowler所说的“添加Service Bus仅需10分钟”。
  • Thanks to Eric Hexter and Jon Galloway for their organizational abilities and generous gifts of time on all the *conf events!

    感谢Eric HexterJon Galloway在所有* conf活动中的组织能力和慷慨的时间礼物!

  • But mostly, thanks to the speakers who volunteered their time and presented and the community who showed up to watch, interact and play with us!

    但最重要的是,感谢那些自愿参与并发表演讲的演讲者以及出现现场与我们观看,互动和娱乐的社区

Sponsor: The Windows Azure Developer Challenge is on.  Complete 5 programming challenges for a chance at spot prizes, Stage prizes and the Grand Prize. Over $16,000 is up for grabs with 65 chances to win!

赞助商: Windows Azure开发人员挑战赛即将开始。 完成5个编程挑战,有机会获得现场奖,舞台奖和大奖。 超过$ 16,000的奖金有65个获胜的机会!

翻译自: https://www.hanselman.com/blog/penny-pinching-in-the-cloud-how-to-run-a-two-day-virtual-conference-for-10

梁斌penny

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值