请选择 进入手机版 | 继续访问电脑版

技术控

    今日:9| 主题:54161
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] Docker + Dataflow = happier workflows

[复制链接]
年华离路 发表于 2016-12-1 14:49:46
255 3

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
When I first saw the Google Cloud Dataflow monitoring UI -- with its visual flow execution graph that updates as your job runs, and convenient links to the log messages -- the idea came to me. What if I could take that UI, and use it for something it was never built for? Could it be connected with open source projects aimed at promoting reproducible scientific analysis, like Common Workflow Language (CWL) or Workflow Definition Language (WDL)?
               

Docker + Dataflow = happier workflows

Docker + Dataflow = happier workflows
              Screenshot of a Dockerflow workflow for DNA sequence analysis.            In scientific computing, it’s really common to submit jobs to a local high-performance computing (HPC) cluster. There are tools to do that in the cloud, like  Elasticluster and  Starcluster . They replicate the local way of doing things, which means they require a bunch of infrastructure setup and management that the university IT department would otherwise do. Even after you’re set up, you still have to ssh into the cluster to do anything. And then there are a million different choices for workflow managers, each unsatisfactory in its own special way.
   By day, I’m a product manager. I hadn’t done any serious coding in a few years. But I figured it shouldn’t be that hard to create a proof-of-concept, just to show that the  Apache Beam API that Dataflow implements can be used for running scientific workflows. Now, Dataflow was created for a different purpose, namely, to support scalable data-parallel processing, like transforming giant data sets, or computing summary statistics, or indexing web pages. To use Dataflow for scientific workflows would require wrapping up shell steps that launch VMs, run some code, and shuttle data back and forth from an object store. It should be easy, right?
  It wasn’t so bad. Over the weekend, I downloaded the Dataflow SDK, ran the wordcount examples, and started modifying. I had a “Hello, world” proof-of-concept in a day.
  To really run scientific workflows would require more, of course. Varying VM shapes, a way to pass parameters from one step to the next, graph definition, scattering and gathering, retries. So I shifted into prototyping mode.
   I created a new GitHub project called Dockerflow . With Dockerflow, workflows can be defined in YAML files. They can also be written in pretty compact Java code. You can run a batch of workflows at once by providing a CSV file with one row per workflow to define the parameters.
  Dataflow and Docker complement each other nicely:
  
       
  • Dataflow provides a fully managed service with a nice monitoring interface, retries,  graph optimization and other niceties.   
  • Docker provides portability of the tools themselves, and there's a large library of packaged tools already available as Docker images.  
  While Dockerflow supports a simple YAML workflow definition, a similar approach could be taken to implement a runner for one of the open standards like CWL or WDL.
  To get a sense of working with Dockerflow, here’s “Hello, World” written in YAML:
  1. defn:
  2.   name: HelloWorkflow
  3. steps:
  4. - defn:
  5.     name: Hello
  6.     inputParameters:
  7.       name: message
  8.       defaultValue: Hello, World!
  9.     docker:
  10.       imageName: ubuntu
  11.       cmd: echo $message
复制代码
And here’s the same example written in Java:
  1. public class HelloWorkflow implements WorkflowDefn {
  2.   @Override
  3.   public Workflow createWorkflow(String[] args) throws IOException {
  4.     Task hello =
  5.         TaskBuilder.named("Hello").input("message", “Hello, World!”).docker(“ubuntu”).script("echo $message").build();
  6.     return TaskBuilder.named("HelloWorkflow").steps(hello).args(args).build();
  7.   }
  8. }
复制代码
Dockerflow is just a prototype at this stage, though it can run real workflows and includes many nice features, like dry runs, resuming failed runs from mid-workflow, and, of course, the nice UI. It uses Cloud Dataflow in a way that was never intended -- to run scientific batch workflows rather than large-scale data-parallel workloads. I wish I’d written it in Python rather than Java. The Dataflow Python SDK wasn’t quite as mature when I started.
  Which is all to say, it’s been a great 20% project, and the future really depends on whether it solves a problem people have, and if others are interested in improving on it. We welcome your contributions and comments! How do you run and monitor scientific workflows today?
   By Jonathan Bingham, Google Genomics and Verily Life Sciences



上一篇:Check if there is a root to leaf path with given sequence
下一篇:A Deep Dive into TiKV
\苍井空。 发表于 2016-12-1 23:58:03
顶起!
回复 支持 反对

使用道具 举报

蓝冰恋歌tma 发表于 2016-12-2 09:23:15
我就是路过,拿积分走人!!
回复 支持 反对

使用道具 举报

haohaoyo 发表于 2016-12-6 08:14:38
来,来,干了这杯翔!
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读


回页顶回复上一篇下一篇回列表
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )

© 2001-2017 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表