17
1 Social IRC bots in the cloud with Node.js and MongoDB Marek Jelen PaaS Evangelist, Red Hat MongoLondon, 2013

Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

Embed Size (px)

DESCRIPTION

Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

Citation preview

Page 1: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

1

Social IRCbots in the cloud

with Node.js and MongoDB

Marek JelenPaaS Evangelist, Red HatMongoLondon, 2013

Page 2: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

2

i. basic understanding what cloud is and what it is not

ii. you are a developer and you know what Node.js

iii. basic knowledge of MongoDB

iv. questions are good!

v. questions are awesome!

vi. discussion is preferred to my monologue

My expectations

Page 3: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

3

What is IRC?• Communication protocol• Open (RFC1459) & Simple• Text based

• Realtime-communication• Group chat & One-to-One chat• Users => #channels <= Bots• Clients, Bouncers, Bots

Page 4: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

4

Basic IRC commands• /join #openshif• /msg mjelen This is awesome• /me is presenting in London• /topic Don't be afraid to ask questions.

Page 5: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

5

Is it any good?• Basic communication channel of tech companies• Community building environment• Support channel for users• etc. etc. etc.

• OpenSource servers & clients (standalone, web)

Page 6: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

6

What is OpenShift?

Red Hat's free, auto-scaling Platform as a Service (PaaS) for applications in the cloud.

Page 7: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

7

Page 8: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

8

Looks great, but what’s the catch?

• OpenShif is free-as-in-beer & free-as-in-freedom • Three times 0.5GB RAM/1GB storage • Need more resources, just ask!• We are in Developer Preview• Sign up at openshift.com• Promo code: MongoDBLondon

Page 9: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

9

Three flavours

• OpenSource project => OpenShif Origin

• Enterprise ready product => OpenShif Enterprise

• Service by Red Hat => OpenShif Online

Page 10: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

10

And now, let's buildAnd now, let's build

some botssome bots

Page 11: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

11

My bots on OpenShift (1)• Create new deployment environment• rhc app create ircbot nodejs• clones a git repository locally• setups node.js environment• allows you ssh access• provides logs tailing• sets public DNS records

Page 12: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

12

My bots on OpenShift (2)• Enter the directory• cd ircbot

• Install dependencies• npm install irc -s

• Write the code

Page 13: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

13

My bots on OpenShift (3)• Record changes (when needed)• git add package.json server.js

• Commit the changes• git commit -m “My first commit”

• And deploy• git push [origin [master]]

Page 14: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

14

My bots on OpenShift (4)• Add MongoDB to the mix• rhc cartridge add mongodb-2.2 -a ircbot

• Add RockMongo to inspect MongoDB• rhc cartridge add rockmongo-1.1 -a ircbot

• Install dependencies• npm install -S mongojs

• Write the code• Connect to MongoDB from application

Page 15: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

15

My bots on OpenShift (5)• Record changes (when needed)• git add package.json server.js

• Commit the changes• git commit -m “My first commit”

• And deploy• git push (origin (master))

Page 16: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

16

Conclusion• Three flavors of OpenShif • Origin, Enterprise, Online

• Sign up for Online for free• Promo code: MongoLondon

• IRC is fun• Open, Simple, Feature-full

• Node.js makes it simple to write apps• MongoDB helps with data persistence

Page 17: Social IRC bots in the Cloud with OpenShift - Mongo London presentation by Marek Jelen

17

[email protected]@marek_jelen

http://openshift.redhat.com