Better HN
topnewbestaskshowjobs
Log inSign up

chimeracoder

21,186 karma · joined Oct 12, 2010 (16y ago) · 6,050 submissions

Inveterate builder.

Personal site: http://www.adityamukerjee.net/

My email is pretty easy to guess from my username.

Submissions

comment 11y ago · link · parent

> absolutely nothing about the content of the article other than the emotions it's supposed to provoke, which usually turns out to be a gross exaggeration of the article's actual emotive pull.

Furthermore, at least according to the BBC article, this tweet was responsible for the massive crash, in that the crash only happened after that tweet revealed the source (and investors panicked when they saw that the info came from a reputable source). That chain of causality may be up for debate, but the facts reported in the article at least support the headline.

The reason Buzzfeed & co. are so reprehensible is that the articles themselves often don't match the headlines they use[0]. I always feel cheated when I read one of those articles, because it's a bait-and-switch.

[0] It's not surprising that Buzzfeed headlines don't match the contents, since AFAIK they A/B test headlines and location (on the frontpage) obsessively. It's hard to optimize for both clicks and relevance when you generate headlines algorithmically, and it's pretty clear which one they care more about.

comment 11y ago · link · parent

> This kind of reminds me of the 'Better off Ted' episode, where the company's new motion detection system does not detect any of the African Americans in the office.

Which is itself a reference to real-life results involving motion detection/computer vision/image processing (this was a particularly bad problem in the earlier days of the field, but still persists today to some extent).

comment 11y ago · link · parent

I haven't had any interactions with the maintainer(s), but I absolutely agree with the point on performance from SSH[0]. That said, I do like that Ansible makes no assumptions about your target server's initial state except that it is accessible over SSH (the rest can be bootstrapped from Ansible).

My use case is admittedly much simpler than what Ansible allows for: I use it almost exclusively to provision a host for containers (and then to initialize/start those containers). As a result, my playbooks tend to remain small.

I don't think this use case is realistic for everyone yet, but I think that's the direction we're headed (more containerization), and that it won't be too long before this becomes the norm in devops.

[0] Seriously, the "copy" command is the best illustration of this - thank God that "synchronize" also exists!

comment 11y ago · link · parent

> Not trying to be too snarky, but why can't people just use shell scripts for automation?

This is why I love Ansible.

Unlike many of the alternatives, Ansible doesn't try to invent a radically different DSL. Instead, ansible uses YAML playbooks that degrade very nicely to shell commands[0]. You can literally take almost any shell script and turn it into an Ansible playbook with a series of Vim regexes - or heck, write a simple sed script to translate it automatically.

Of course, if you use Ansible modules instead of the `command` directive, you get a lot of performance benefits and guarantees of idempotency. But it doesn't try to reinvent the wheel; it just builds on top of it.

It makes it really easy to hack together an Ansible script that is immediately understood by anyone who's used bash/sh and it makes it possible to improve upon it incrementally by replacing shell commands with the relevant Ansible modules.

I've used other automation tools, and the thing that I really disliked about them was that it was so difficult to migrate an existing workflow to a new paradigm. In 2015, systems work is still very imperative, so while declarative syntax is philosophically attractive, I still find it way more practical to use the tools that require smaller mental leaps.

[0] e.g., this thing was hacked together from a shell script, and I never bothered to clean it up, but it's still already more readable than the equivalent shell script: https://github.com/ChimeraCoder/znc-kibana-playbooks/blob/ma...

comment 11y ago · link · parent

> this is the best resource I've come across that explains what happens internally in an easy to grok manner.

Thanks! I really appreciate that.

> I'm sorry if I jumped the gun before the blogpost was ready. :)

Nah, it's cool - if anything it creates even more social pressure not to procrastinate writing it!

comment 11y ago · link · parent

Unfortunately not, though there's been a lot of interest in this talk, so I'll likely be presenting it again. And even in the last couple of months there's been a lot of development in the containerization world, so there's a even more to include.

If anyone's interested in hosting and/or filming an updated version of this talk, drop me a line! My email is in my profile.

comment 11y ago · link · parent

> Container IDs and Image IDs are not SHA hashes.

Thanks for catching that - I've updated it.

> Since the slides also mention that you can use Docker images with a systemd-nspawn/machinectl setup it would be great if they soon supported the v2 Docker Registry and image format which actually does use content-addressable hashes for images.

I haven't used the v2 registry, so I don't know if systemd (machinectl) supports this yet, but I imagine they will soon if they don't already.

comment 11y ago · link · parent

Author here - I'm working on a blog post for this and didn't expect this to be posted on HN so soon, but I guess that's what I should expect for posting a link to it in another HN comment! :)

These slides correspond to a workshop I conducted a week ago demonstrating the internals of Docker and how Docker containers can be run without using any of the Docker tools or runtime.

Docker is a great tool, and I'm glad it's gained so much traction. But containerization is still new to many people, and even then there's still a lot of confusion about the difference between Docker and containerization in general. The goal of this presentation isn't to discourage anyone from using Docker, but to outline the lay of the land for people interested in using containers.

Personally, I run containers both with systemd and with Docker. The good news is that it's really easy to switch from one to the other, so there's very little cost to trying it out both ways.

comment 11y ago · link · parent

> I guess you lose all of the Docker metadata, links and volumes though?

You only need links at runtime, so they're not part of the frozen image per se; they exist as part of a running container. Put another way, systemd handles container networking, so you don't need the environment variables that Docker injects when making links, because the containers can talk to each other already[0].

Volumes - if you mount external volumes with -v /foo:/bar, you can do the same with systemd. I'm actually not too sure about named volumes in Docker, since I almost never use them (it's way easier to reason about volumes when I control where they are located on the host).

> You should turn this into blog post if you have time - I'd upvote it anyway!

Thanks - I'm actually working on that! Consider these slides a preview. :)

comment 11y ago · link · parent

Sure. These are the slides for my talk, which includes some of the code examples that we walked through: https://chimeracoder.github.io/docker-without-docker/#1

Consider Git. Git exists solely on the filesystem. If you want, you can read git repos by inflating the ZLIB-compressed objects yourself, and create git repos by compressing objects, hashing them, and storing them in right locations the exact same way that Git does.

It's a lot of work, and the Git toolchain exists so you don't have to type insanely long bash one-liners just to read your commit history. But it's kind of cool to know that >95% of Git is really just 'syntactic sugar' around functionality that's also provided by other command-line tools[0].

I'll wave my hands a bit, but in short: containerization uses features implemented at the kernel level, and in fact, until recently, Docker and systemd both built on top of LXC (Docker has switched created their own libcontainer).

If you take a running Docker container and dump it, you'll get a root filesystem. You could chroot(8) inside this root filesystem, but as we know, containerization is more powerful than chroot. Once you've dumped the container, systemd doesn't need to know that it was once a Docker container - it'll just look for whatever binary is located at /sbin/init and run that (or run whatever command you tell it to run instead. Just like your actual OS - which is not a coincidence!).

One advantage to using systemd instead of the Docker daemon/runtime is that systemd is capable of running itself inside a container, whereas running init systems inside Docker containers is tricky and not recommended[1]. Futhermore, systemd is smart enough to know when it's running inside a container and when it's not, so the container init system plays nicely with the host init system - things like integrated system logs and networking.

Newer versions of systemd actually allow you to pull Docker images from the Docker hub directly, so you can even use systemd to replace `docker pull` as well as `docker run`.

[0] There's a tiny, tiny portion of Git which is home-grown, but most of the features it builds on (SHA, zlib, diff) are easily replaced by other command-line tools.

[1] While it's supported, the primary use case of Docker is for running application processes: https://github.com/docker/docker/issues/2170

comment 11y ago · link · parent

> As another example, rkt intends to work better [than Docker] with systemd/kubernetes, but AIUI that’s still on the roadmap and not actually implemented.

Could you elaborate on this? Do you mean working better with systemd as a process supervisor or as a runtime?

Many people don't know this, but it's already possible to use systemd as a runtime for Docker containers[0], which is about as integrated as I can imagine[1]. Though admittedly, the Docker daemon and runtime do not play well with process supervision (of any kind, including systemd)[2].

Last I checked, CoreOS had posted to the systemd mailing list announcing their plans to integrate with nspawn, though I don't think that's been released yet.

[0] This is the best-kept secret of both Docker and systemd. I recently conducted a workshop on "Docker Without Docker" - in other words, how to run Docker containers without even having the Docker runtime installed (using pure systemd).

[1] And, depending on your use case, I'd recommend giving it a shot - there are a number of things that systemd provides that Docker still does not. On the other hand, Docker has a large ecosystem, and the tools for building initial container images are very accessible.

[2] At least as of recently, you can use 'exec mode' to specify the initial process (PID 1) inside a container running under Docker, but systemd still does not have access to the actual process on the host, which makes it cumbersome to monitor - the CoreOS documentation tells you to do something like this for Docker + systemd: https://github.com/ChimeraCoder/znc-kibana-playbooks/blob/ma...

comment 11y ago · link · parent

For the record, I did not downvote you (I actually upvoted you, since I think your comment contributes to the discussion, even though I disagree with it).

> JS is a great compiler target.

The only thing that makes Javascript an attractive compilation target is its ubiquity. The importance of ubiquity should not be discounted. Many languages have succeeded in their target markets on this basis alone, and Javascript may certainly be one of them! But let's not forget that, in almost every other way, it falls short of ideal.

Some examples:

* Very difficult to parse (while not strictly necessary for a compilation target, still very helpful)

* Esoteric type conversion system (leads to bugs)

* Lack of integral type (this can be worked around, but the fact that it needs to be worked around makes it a bad target).

* Highly dynamic type system (makes it difficult to optimize code, and a good compilation target should be easy to optimize)

* Paucity of parsers (I may be wrong, but to my knowledge, there are very few parsers that are neither (A) written in Javascript, or (B) developed as part of a browser rendering engine[0]. If I remember correctly, Facebook's Flow is one of the rare counterexamples[1].)

* Single-threaded runtime (makes it challenging to implement languages that explicitly allow parallel execution as part of their semantics)

There are ways to address each of these. For example, asm.js limits the scope of the language with the goal of increasing performance of a subset of the language. But they're still shortcomings that have to be dealt with in the first place.

Not that any compilation target is perfect in all of the above ways, but Javascript's combination of all of these makes it a very frustrating choice.

[0] For example, V8 and Spidermonkey were both originally motivated by Firefox and Chrome. The fact that so few people attempt to write their own (except in Javascript), even for fun/experimentation, should give a very rough indication of how challenging it is.

[1] Someone may be able to provide clarity on this: I know Flow is written in OCaml, and I know that at least some of the parsing happens in OCaml, but I also know that Spidermonkey is involved somehow. Is it just that the AST produced is identical to the Spidermonkey AST, or does it actually use Spidermonkey itself at some part of the parsing process?

comment 11y ago · link · parent

> My only gripe with Ubuntu is that apt-get doesn't have the latest stables packages (like Amazon Linux does). I'm guessing it would be the same with Debian.

Depends on your definition of "stable". Since distros vary widely on what they consider to be "stable", comparing various distros' stable releases is like comparing processors by raw GHz values or dSLRs by megapixels alone.

Debian Stable is the last place to go if you want very recent builds of packages, but the first place to go if you want absolute, rock-solid stability.

Debian Sid (unstable) has the latest versions of each of the packages, though Debian's guidelines are strict enough that testing and sid are oftentimes more stable than the "stable" releases of other distros.

My advice (and this is what I do): Run Debian stable (Jessie, as of today) as a base image, and use an appropriate container for applications that require more up-to-date applications. Best of both worlds.

comment 11y ago · link · parent

> Took a quick look at some of the bugs that would affect me... It's systemd, systemd and systemd.

> Oh, yeah, that's Debian's systemd release.

These are the bugs that are relevant when talking about the Jessie release: https://udd.debian.org/bugs/?release=jessie_not_sid&merged=i...

None of them are filed against systemd. I've been watching this page daily for the last month, and I only remember one systemd-related bug being filed in that time (there was one longstanding one from March affecting a rather obscure use case that sat there for a while as well, but was fixed).

comment 11y ago · link · parent

Just to drive home the point further, if it's a US citizen who gets killed, but that US citizen has an Arab name, no apology is apparently needed[0].

Abdulrahman al-Awlaki was a 16-year-old American boy, eating dinner at a restaurant in Yemen while searching for his father. Nobody denies that he was completely innocent, and even the US government simply says he was "in the wrong place at the wrong time"[1].

You'll also notice that the media oftentimes use the euphemism "US-born" to refer to people like al-Awlaki and his father, but refer to Weinstein as American.

[0] https://en.wikipedia.org/wiki/Abdulrahman_al-Awlaki

[1] We can also question why that place was "the wrong place", since (A) we're not at war with Yemen, and (B) the target of the drone strikes (his father) was also a US citizen who had never been convicted of any crime, but that's a separate matter, since it's not analogous to this incident.

comment 11y ago · link · parent

> Agreed. Go lacks many things, but the "zen" of Go is wonderful feature most people aren't aware of, or under appreciate.

It's funny that you use the word "Zen" - about two years ago, I gave a talk about Go to the New York Python Meetup about why I switched to Go[0], and the punchline was that Go fits the Zen of Python[1] better than Python does[2].

[0] Before anyone gets upset - they asked me to speak, and they were genuinely happy with the presentation. It's not like I went in there to troll with a talk on "This is why your language sucks"!

[1] https://www.python.org/dev/peps/pep-0020/

[2] If anyone's interested, these were the slides: https://s3.amazonaws.com/golangweekly/go_for_pythonistas.pdf

comment 11y ago · link · parent

> After having dug into Docker containers for a few weeks to identify what we have to be aware of as we roll out to them at work, I would rather not.

> NAT overhead, asymmetric TCP routes, devicemapper inefficiencies, 400+mb images, new toolsets for debugging, unsigned images (though at least the foundation to support them exists now)...

You don't have to use Docker images (and systemd actually handles all of the issues you point out better than Docker anyway). I only mentioned Docker because it allows people to use existing Docker images without any extra work.

comment 11y ago · link · parent

> PPAs are a thing of the past, I think. A much better way forward would be to implement a truly transactional and functional packaging system (a la nix/guix), where updates could be rolled back seamlessly.

Exactly, and this is what CoreOS does.

I see this as the role that containers fill. Systemd already supports what you describe, via systemd-nspawn, which allows native containerization, and with btrfs, which allows either persistent or ephemeral containers to be built off of a "template"[0].

Systemd is already able to run Docker images and even pull them directly from the Docker registry, so I'd rather see containers adopted as the new model of vendoring[1] rather than PPAs.

And since Debian already uses systemd now, this should be very easy to integrate.

[0] I put "template" in quotation marks because I'm using the term loosely here; nspawn uses the word template to refer to something different.

[1] Let's be frank: while PPAs can do more, 90% of the PPAs I was asked to add when I used Ubuntu were basically aimed at solving vendoring and/or versioning issues.

comment 11y ago · link · parent

It's kind of interesting to see Android, Chrome, and FirefoxOS all rushing towards the same point, though from different directions.

Chrome is trying to "nativify" the browser, and making the browser a more seamless part of navigating Android[0].

With FirefoxOS, the webapp is already native, and the goal is to browserify the native OS (in other words, to make the operating system itself inside the browser).

[0] I say Android specifically because this integration already goes much deeper on Android than on iOS, simply because it can.

comment 11y ago · link · parent

> Even with better management, it seems to me like addiction still will have great social cost.

This is a common assumption. But empirically, it turns out that the inherent social cost of heroin use (or even heroin dependence) is relatively low, no greater than the social cost of alcohol use/dependence, and arguably a lot less. The only condition is that heroin has to be easily accessible for an affordable price and with a known potency.

Diacetylmorphine maintenance programs do exactly this, and have had great success in Switzerland and the UK[0]. People on diacetylmorphine maintenance are able to hold steady jobs and lead otherwise "normal" lives, save for a daily trip to their local clinic.

Substitute "bar" or "coffeeshop" for "clinic", and suddenly we're talking about a large chunk of the upper-class workforce, including the tech industry.

[0] https://en.wikipedia.org/wiki/Heroin-assisted_treatment

comment 11y ago · link · parent

> Europe has had chip and pin for decades now (it was already well established on my first trip there in 1998) and we're just getting it now after a ton of major breaches that should have been easily prevented.

There's a lot of misinformation about chip-and-pin (which is not surprising, because a lot of well-funded companies currently have a financial interest not to clarify the misinformation). This has been explained in more detail on the threads about the breaches by others who work on payment systems, but chip-and-pin would not actually have prevented several of the breaches that have happened recently in the US.

Furthermore, the main benefit to chip-and-pin has to do with the liability, not actual security. I'm not talking about the liability shift onto merchants who don't accept chip-and-pin; I'm talking about the situation in which fraud or suspected fraud occurs using a chip-and-pin system. In this case, though, the benefit is entirely for Mastercard/Visa/etc., and not for the consumer.

comment 11y ago · link · parent

> to line the pockets of the credit card duopoly and ensure the merchant always gets screwed.

First, in the US there are four companies, not two (or three, if you don't want to count Discover). And chargebacks aren't the reason that there are so few players - they're far from the biggest barrier to entry for an upstart, aspiring credit card provider.

> In many developed countries there are consumer protection laws which entitle the buyer to Replacement, Repair, Refund (in that order usually), so a merchant not adhering to these laws could endup in serious legal trouble as is.

That's not what chargebacks are generally for, and in fact using a chargeback for any of those three things is oftentimes considered misuse of the chargeback system. Chargebacks are for handling disputes regarding the actual goods or services promised or rendered.

Furthermore, having laws in place means nothing if it's prohibitively expensive for consumers to actually get them to be enforced in all but the largest disputes. Chargebacks are a tool that consumers can (and do) use to ensure that merchants adhere to these agreements. No individual is going to go to court with a merchant over a few hundred dollars on a disputed credit card charge. The consumer delegates this authority to the credit card company, who is more than happy to aggregate this risk across multiple customers, in exchange for a cut[0]. This is not a problem; it is the system working as intended!

I'm saying this both as a consumer and as a merchant who has gotten screwed over by one of the four (not two) major credit card companies[1] - chargebacks suck, but they provide an essential protection for consumers that the judicial system cannot.

(All of this is separate from fraud, which is a different matter entirely.)

> I forgot the last time I had to use a credit card (or paypal and their "consumer protection") in the last year, and my life both personal and business is easier and better for it.

I've had to make a few chargebacks in my life. The largest was for almost $2000. Even though the vendor was clearly in the wrong (and I had the written contract to prove it), it would have been way too expensive to actually try and get our money back through the judicial system. Fortunately, my credit card company was more than happy to settle the matter for us.

[0] The consumer doesn't pay for this service directly, but they do indirectly (which isn't fundamentally different from many other products and services, in which the actual cashflow is invisible to the end consumer - this can be problematic in its own right, but that's a separate matter of discussion).

[1] I have plenty of chargeback horror stories as a merchant, but that's the topic of another post. And that doesn't mean I don't see the value in chargebacks in general.

comment 11y ago · link · parent

> And if you have PTSD, it's a good idea to let your co-workers and friends know now, otherwise, they'll continue doing things that cause problems for you. You'll find that most people are very helpful, some even understand it just like you do, but have never said anything about it.

I don't have PTSD (thankfully), but I went to a school with a large milvet population, and a number of my friends & classmates had varying levels of PTSD. Two of my close friends have PTSD from (separate) traumatic events that occurred during the time I knew them[0], and I've seen the struggles that they have to this day as a result.

Unfortunately, not only is there a huge stigma around mental illness in general, but PTSD is very often misunderstood. And many people with PTSD have been in the position where they have trusted friends or coworkers with that information, for the exact reasons you describe, and it has come around to bite them[1]. Since PTSD is oftentimes triggered by environmental factors, this only reinforces the learning cycle, and actually worsens the PTSD.

It creates a terrible cycle, where they have legitimate reasons not to want to seek support from their environment (they have real reason to distrust it), but where they can't function without the support of their environment as well.

[0] ie, after we were already friends; I wasn't present at the traumatic events themselves.

[1] e.g., a friend lets this information slip to someone that the original person didn't trust, or a coworker uses that information to trigger them intentionally as a "joke" (yes, this happens).

comment 11y ago · link · parent

Even if Twilio were simply providing a proxy for accessing the Google Alerts API, I would use Twilio's proxy over Google's.

Twilio consistently provides excellent documentation and developer support, whereas Google's results on that front are very mixed (varies widely by product).

comment 11y ago · link · parent

> Python 2 is scheduled to be EOL'd upstream officially and for good in 2020. We're in 2015 now (wow, that went quickly), and keeping our release cadence up (3 years a pop) puts Stretch up in 2018, and Buster in 2021.

Am I missing something? Did Debian decide to extend their release cycles?

Jessie is due to be released next week, which is 2 years since Wheezy (May 2013). In fact, the last several years have all been 2-year cycles, not 3. The only three-year cycle was Woody → Sarge (2002-2005), and AFAIK, that delay was one of the reasons that Ubuntu had room to enter the market. Since this put pressure on Debian to make their development more rapid, I'd be surprised if they decided to move in the opposite direction.

comment 11y ago · link · parent

> "So, if it doesn't exist, how is it making you bleed?"

> (My American friends told me that I did not handle that well. My Italian friends told me that I handled that masterfully.)

That's a great story, and thank you for sharing it. Though at the risk of getting downvoted, I think I know why your [American] friends were telling you that you didn't handle it well.

Aside from the lawsuit potential (which is real), it doesn't really advance the situation in a way that helps anybody - either you or him. Clearly he feels intimidated by you, and that's why he's mentally unwilling to acknowledge you and/or your project. But after you assaulting him[0], he's not going to suddenly change his mind and acknowledge that you beat him. Rather, he's going to double-down, and now have even more reason to believe that you're unstable/immature/unprofessional, or whatever he needs in order to convince himself that you're not worth paying attention to.

As for you, it makes you feel better, but it also doesn't really get you what you ultimately want (him admitting that he was wrong). You win the battle, but the "war" goes on, with both sides even more emotionally entrenched in their existing positions.

[0] yes, this would qualify as assault

comment 11y ago · link · parent

> Does anyone know of any true market data sources that are not delayed, free and open for commercial use?

Short answer: No

Long answer: It depends on what you mean by "true market data". This requires understanding a lot more about how the market and bidding process actually functions, but there really isn't a single canonical price at any point, and there are many ways to define what you're looking for, depending on what you're referring to - all of which are valid according to different assumptions.

Think of it as a special kind of eventually-consistent database. Depending on the consistency model, you can't ask what the value of x is right now, because there are multiple possible values that are all valid. It's only after they converge (which takes time) that a single, canonical value emerges.

This is one of the reasons that quotes are always delayed - it's possible to talk about what the price was at some point in the past, because those ways of defining the price dynamically have all essentially converged to the same value, but it's not possible to pinpoint a single price in the present.

To get all of the various sources of real-time data that can be considered the "current price" requires a lot of low-latency connections to various market players. That's not cheap, so there's nothing that's not delayed and free and available for commercial use.

comment 11y ago · link · parent

> If you mean a scenario where Docker launches systemd, we don't do that. In my view Docker is just a packaging system; each container's pid 1 is the app we're deploying.

No, systemd is actually capable of running Docker containers directly (even without Docker).

I definitely wouldn't recommend running systemd inside a container unless you're using systemd to launch the container (instead of Docker), since Docker doesn't handle init systems very well, whereas systemd has this built-in. Though you can also go with the one-app-process-per-container approach as well with systemd, which also works.

comment 11y ago · link · parent

> And there's not yet a way to bind containers to physical interfaces that DHCP themselves at runtime

Sure there is. Systemd will actually do this for you.

Docker recently eschewed LXC, and I'm still not sure I understand exactly why, but even after the move to libcontainer, systemd is capable of handling this.

1
127128129
202