What does a DevOps person do all day when they’re not actively deploying things?

When I do DevOps, my ideal day is sitting with my feet up in the sunshine, doing very little active work. The monitoring alarms aren’t going off; the server alarms are quiet. The developers are happy; the managers are smiling.

That’s the purpose of DevOps. To put in place the system that means the workflow between customer – manager – engineer happens without your active input. Because the team has spent time building a devops system that means everyone can just keep working without having to stop and wait for someone else to say “OK, start again”.

The code passes the tests, so we can deploy it to staging; it passes on staging, so we can deploy it live.

If someone commits a code change that breaks, they know about it immediately; but it doesn’t break the code in production.

But when I’m sitting in the sunshine with my eyes closed, this DevOps person is thinking “how can we automate <that bit>? how do we make <this> more resilient?” So I’m not idle, just working on the next stage of scaling the project….

That’s what I think, anyway… What do you think?

Running out of disk space on OSX

I just recently ran out of space on my relatively new OSX desktop machine, which came with over a 1TB.

Strange! I thought.

Downloaded the excellent (and free) OmniDiskSweeper and let it run.

https://www.omnigroup.com/more/

Well, that would explain it. Nearly 1 TB of core files in /cores.

Removed them and set the hard limit to prevent their creation.

http://apple.stackexchange.com/questions/215410/os-x-el-capitan-cores-directory-taking-up-a-lot-of-space

And suddenly I have a very much happier machine ūüôā

How I Installed Kubernetes From Scratch on a Bytemark VM

I run Luzme, an ebook search system, which runs 24×7 on about 30 virtual machines in 7 countries on 6 continents.

This article explains how I setup Kubernetes from scratch on a set of VMs from Bytemark, to improve the way I use the infrastructure behind Luzme, using the new container-based technologies, such as Docker and Kubernetes,  to provide a better, more maintainable, more scalable system
Continue reading How I Installed Kubernetes From Scratch on a Bytemark VM

Firebase : How To Paginate – A Quick Guide

Pagination, or “How to Fetch a Data Set in Parts”

You want to provide a quick initial set of data to your Firebase user, say the first 5 blog posts. If they want more, you can serve up what is needed, always being considerate of their waiting time and network data usage.

This is a great design pattern, because it is optimising the right thing at the right time. At the start, you care most about speed, and giving the user something to work with. Then you care about giving them more of what they want.

It is often called “Pagination”, or “Chunking”.

In this article, I explain how to do this in Firebase.

Continue reading Firebase : How To Paginate – A Quick Guide

babel: “import path from ‘path’;” error

I set up a new project to use Google’s Web Toolkit framework, which uses babel in its gulpfile.

All looks good, but I get this error

$ gulp e2e-test
[09:01:05] Requiring external module babel-register
CWD/gulpfile.babel.js:27
import path from 'path';
^^^^^^

SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at loader (CWD/node_modules/babel-register/lib/node.js:158:5)

The cause: I need a .babelrc file to make it work.

From the babel website, (https://babeljs.io/docs/setup/#installation)

$ echo '{ "presets": ["es2015"] }' > .babelrc

and now all is good.

How To Migrate to Angular2

Just back from AngularConnect 2015 in London (October 2015), and I’m enthused about all the great new stuff in Angular 2.

Only problem is, everything has changed and I’ve only just got the hang of Angular 1.

So, while I prepare to launch my new Angular/Firebase front-end to Luzme which uses Angular1, I want to start skilling myself up with Angular 2, for the next major release.

So this is my plan: take it step-by-step, and write about each step so I can share with others on the same journey, and learn from the comments and questions along the way.

This is the plan

At each step, I will write a failing test which introduces the next step.

I will commit that test, so you can see how to write such a test.

I will blog about what the step is and why it’s necessary. And what I needed to do to make the test pass.

I’ll commit that as a tagged version in github, so you can see at each step how to get from A to B.

Here’s the repo:

https://github.com/rwillmer/ng2-firebase-howto

Stop Thinking; Start Doing

So you want to start a startup but can’t get past the first hurdle. You can’t decide on your startup idea. You have too many ideas and don’t know how to choose one. Or you have one great idea, but something always gets in the way of you executing it.¬†Sound familiar?

The answer is simple. Pick One. Work on it. Learn from it.

Your idea will be wrong, almost certainly. That shouldn’t stop you doing it. How will you get experience without making mistakes?

“Good Judgement Comes with Experience; Experience comes from Bad Judgement” 13th century, via Mark Suster, Jim Horning and others

As my¬†old music teacher used to shout at our¬†chorus, when we sang quietly because no-one¬†really knew the piece: “Sing Louder! How can I tell you you’re wrong if I can’t hear you”.

The only sure way to fail is to not start. Start singing louder so you can hear your mistakes!

Django: “Cannot add foreign key constraint”

Upgraded to Django 1.8 and now you get this error when you run your tests?

Have you created migrations for all your apps? If not, you may well be hitting the problem that the database tables are being created in the wrong order, which will give you this error.

If you have an existing Django 1.7 or earlier project, then you need to create the initial migration files, and then fake the initial migration, as described here

https://docs.djangoproject.com/en/1.8/topics/migrations/#adding-migrations-to-apps

Create the migration with

$ python manage.py make migrations your_app_label

And then fake the application

$ python manage.py migrate –fake-initial your_app_label