The top cause of outages is changing code.

The last week of my oncall shift has been pretty quite. The holiday season has elevated traffic around 50% higher than normal, but I haven’t really noticed. There haven’t been any service outages and it almost feels like I’m not really oncall. Why has it been so quite? We haven’t deployed any code for two weeks. Not deploying code means we aren’t deploying any bugs to production. 

After a deployment you will probably notice any defects over the next couple days. Once you have fixed those it is smooth sailing for that version. 

Continuous Deployment makes it easy to deploy bugs 10x a day. Agile gives you a justification to deploy 10x a day. Ask yourself, what are you deploying each day? A CSS change to a button? A new option in a drop-down. A re-write of the graphing functionality because no one can understand the current implementation? A new feature like Google Docs integration?

If you could only deploy 1 feature each week what would make the cut?

Sorry, we didn’t mean to break that for you! But we aren’t going to fix it.

Using Business to Consumer SAAS means getting your UX broken all the time.

Sorry, but we are moving the product in another direction. We have changed the interface to a whole new design. Yes, we don’t have feature parity with the old experience, but we will get there soon. Soon in this case means in six months, after we finish the international rollout we will start to fill in the missing features. 

Do you remember the drama around Windows 10’s new UX? It was and is obviously worse for power users, but Microsoft didn’t care. How about when Microsoft Office added the new Ribbon UI and no one could find anything anymore? B2C software doesn’t care about power users. If you buy one copy of Office and use it 100x as much as the average dude, a business analyst is thinking about how to get you to buy 100 copies. 

Then there was the years where new versions of Mac OS were so bad that they had to stop charging for OS updates because no one would buy them anymore. Customers don’t like UI updates in general. Every UI update means learning a new set of commands. People don’t want to take a tutorial the first time they open an app. Getting people to redo the tutorial every time you release a new update is basically impossible. 

A UX update on a product I worked on broke the application for a bunch of our power users. Developing the MVP version of the new UX took several teams months. We had been maintaining a blacklist of users while we worked on the new User Experience. Once the new experience was released and stable we decided that we were ready to launch the new experience to everyone and eliminate blacklists. This led to a flurry of customer service calls by customers who no longer could use the application for its basic purpose. 

Customers probably don’t want a UX break unless it’s at least a 10x improvement on whatever you had before. If find yourself releasing a new experience that is LESS functional than the current experience. STOP.

git format-patch and git am

# format-patch creates a patch file
# the -1 $COMMIT arguments take the last commit and put it into the file
git format-patch -1 14ab6d…..

#Applies the commits in the patch file onto the current branch
git am ../folder/2019-10-17/0001-SLEDGE-32

#This git log command pulls the history of a file into one patch
git log --pretty=email --patch-with-stat --reverse -- path/file_or_dir 
git am <  path/to/file_or_dir 

PlantUML a text based diagramming language

One of the senior engineers at my job is a big fan of PlantUML, so I recommended it to one of the junior guys who needed a diagramming tool. I’ve been taking a look myself since I have never had a goto diagramming tool. 

PlantUML is text based language. You can define structs and their relationships with other items. There are a lot of keywords, which can be a bit confusing, but it generates pretty good diagrams.

Here is the text for a system diagram and the image it generates below.

@startuml
actor actor [
  a user
]
database postgres
queue celery 
stack redis

node django [
  Django webservice
]

node worker [
  Turtle Detector
]

boundary boundary [
nginx
]

cloud cloud [
cloud
]

actor --> cloud

cloud --> boundary

boundary --> django

django --> postgres
django --> celery

celery -> worker
worker -> redis
redis --> django
@enduml

Here is the code for a smaller class relationship diagram.

@startuml
class User {
  +customerId : String
  ~submissions : Submission[]
  
}

class Submission {
   -size : int[][] 
   #image : int[][]

}

User <|-- Submission


class TurtleModel {
   ~model : Pytorch.GAN
}
@enduml

Turtle Generator Project Idea

New programmers sometimes ask me “what project should I work on next?”. This project is one I drafted up for myself because I wanted to build a more complex application with Django and pytorch.

The Turtle Generator Project is an attempt to create a website on which people can submit pictures of turtles and vote on whether machine generated turtles are “turtle” or “not turtle”. The user submissions and votes form a GAN or generative adversarial network, both classifying and producing pictures of turtles, although we may use user submissions as part of our dataset of turtles.

Pages / Components

Draw or Submit turtle component

Drawing component where a visitor can use their mouse or touchpad to to draw a turtle and submit it to the turtles dataset.

Vote component

A component consisting of a picture of a turtle generated by our backend algorithms and a button which says “turtle” or “not turtle”.

Architecture

Django frontend + PostgresDB
serves web pages and handles user interaction
votes and turtle drawing submissions are submitted to the MachineLearner system via Celery
submits “turtle image” request to celery queue — gets turtle back

Possibly Reactjs or just django templates

Machine Learner
online machine learning system based on pytorch
takes celery tasks and either
generates a picture of a turtle
adds a vote submission to the training data ( classification )
adds a turtle picture submission to the training data

Celery + Redis
Message queue used to handle queuing training tasks