Git Product home page Git Product logo

Comments (18)

chrislusf avatar chrislusf commented on July 22, 2024

Thanks for the good idea! With this, we do not need "glow master" to manage the available nodes.

Any good Kubernates' go API? I can not find an easy-to-follow example.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

http://kubernetes.io/ is the general site.

https://github.com/kubernetes/kubernetes/tree/30891c7f3f1ba48d57cda24ede9ba9f65ab305f8/pkg/client/restclient
This is the go rest client.

I am trying to get approval from manager to allocate time working on this. How about we spend some time reading the docs, and then we sync up to write a design doc for this?

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

Thanks! It'll be great if you can get the approval.

The related logic is all under github.com/chrislusf/glow/driver/scheduler . I hope it is simple to read. Let me know if you have any questions.

from glow.

joeblew99 avatar joeblew99 commented on July 22, 2024

Also nomad would be a good option for this type of workload. It's also much
easier in my opinion.

Nomad is from hashicorp, and integrated with consul

On Sun, 24 Apr 2016, 05:20 Chris Lu, [email protected] wrote:

Thanks! It'll be great if you can get the approval.

The related logic is all under github.com/chrislusf/glow/driver/scheduler
. I hope it is simple to read. Let me know if you have any questions.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#42 (comment)

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

I see similar frameworks usually need to integrate with existing cluster management systems, which could be what users are actually using with other systems. So we would need to integrate with Mesos, YARN, Nomad, Kubernate, AWS, etc. We can just start with any one of them, whichever is easier to anyone working on this.

btw: Currently "glow master" not only manage node locations, but also dataset locations. The dataset location is for users to "glow receive" to peek into the dataset. This may not be that important.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

SGTM, I can start with the Kubernetes implementation as this issue suggested.

To get started, a relatively naive approach is to start master and agent nodes inside driver program, then continue the exitent workflow by contacting the master node. This would have many redundancy because Kubernetes has overlapping functionality with the master.

The benefit, though, is easier to get familiar with Kubernetes, and quicker to reach a usable prototype.

Does this sound reasonable?

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

The cluster management section is poorly documented. I would recommend you help to write some documents first, getting familiar with the existing process, organize the code into a better structure, and then extend it.

I think the driver can skip starting the master node, which does almost the same work as Kubernetes. The driver can just ask Kubernetes for nodes and start agents there.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

Thanks Chris, first let me congratulate your new position. :) I was dormant for the past weeks due to some personal affairs.

Your suggestion of starting with cluster management documentation is spot on. I also agree with your suggestion of skipping starting master node.

I will start with what you suggested. Will keep updating this thread in the process.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

From what I learned in the past a few days, I think the distributed execution of Glow works as follows:

  1. User starts the binary, which runs in 'driver' mode. Use 'driver' to refer to this running process.
  2. Driver processes a FlowContext, which is statically compiled into the driver binary; figure out the command line flags for the worker processes; and submit task requests to cluster leader.
  3. Driver continues to send request and process replies from cluster leader to starts all tasks.
  4. A worker process can figure out what are its inputs and outputs from its command line flags, with the help from driver to resolve the identities of other running worker processes.

I have a rather preliminary plan of integrating with K8s, which is to let the driver contact K8s directly, and just start all tasks directly on a K8s cluster. That seems fit correctly in the picture describe above. When tasks are started, driver will know their identity and worker processes should be able to contact driver or K8s for the identities of other running worker processes.

Chris, could you please point me to the code where 2 happens? Particularly, I am interested in the code that figures out the command line flags for a task.

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

for 2: The driver will request resources from the glow master. And then the driver will ask glow agents to start the executors.

The driver talk to the agents via a protocol buffer based message. You can search for "ControlMessage_StartRequest" in the code to see how it is used.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

Thanks.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

I spent most of time reading the code and writing tests. Now I think I have a good enough understanding of glow's internals. And I have a very rough idea on how to integrate glow with k8s:

  1. Add capability for driver to talk to k8s scheduler.

Driver asks k8s to schedule a job with N replicas. Use workers to refer to the running processes on K8s. N here is the number of task groups as decided by glow/driver/plan, each task group will be run by a worker.

Afterwards, workers start talking to the driver, and the driver will pass the execution parameters (flow_id, task_id, etc.) to them. The code of producing execution parameters and execute work according to them is already there. Right now, this code primarily interfaces directly with command line flags, and is scattered between driver and scheduler, we will need to adapt it to become a cleaner RPC interfaces for reusing it in K8s integration.
2. Users need to build the docker image of the glow binary before starting the driver. Note that when we say 'driver', it still is the same binary. Glow's architecture can be summarized as one binary with internal logic of split the workload and can execute distributedly.

The driver will accepts an argument which is the docker image ID. And use that to create the replicas of itself.

We should provide a glow builder tool to build a glow program and produce a docker image for the same binary.
3. We can provide a convenient the driver on K8s itself. So that we have everything running natively inside K8s.

Any comments on this high-level idea? If no objections, I plan to proceed to write a document with more details, primarily focus on how the driver work with K8s and Docker through their APIs.

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

Currently the glow agents download the binary and start it as executors.
Can we share a k8s image and acts just like the glow agent?

On Sat, Sep 3, 2016 at 7:26 PM Yaxiong [email protected] wrote:

I spent most of time reading the code and writing tests. Now I think I
have a good enough understanding of glow's internals. And I have a very
rough idea on how to integrate glow with k8s:

Add capability for driver to talk to k8s scheduler.

Driver asks k8s to schedule a job with N replicas. Use workers to
refer to the running processes on K8s. N here is the number of task groups
as decided by glow/driver/plan, each task group will be run by a worker.

Afterwards, workers start talking to the driver, and the driver will
pass the execution parameters (flow_id, task_id, etc.) to them. The code of
producing execution parameters and execute work according to them is
already there. Right now, this code primarily interfaces directly with
command line flags, and is scattered between driver and scheduler, we will
need to adapt it to become a cleaner RPC interfaces for reusing it in K8s
integration.
2.

Users need to build the docker image of the glow binary before
starting the driver. Note that when we say 'driver', it still is the same
binary. Glow's architecture can be summarized as one binary with internal
logic of split the workload and can execute distributedly.

The driver will accepts an argument which is the docker image ID. And
use that to create the replicas of itself.

We should provide a glow builder tool to build a glow program and
produce a docker image for the same binary.
3.

We can provide a convenient the driver on K8s itself. So that we have
everything running natively inside K8s.

Any comments on this high-level idea? If no objections, I plan to proceed
to write a document with more details, primarily focus on how the driver
work with K8s and Docker through their APIs.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#42 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABeL72lMEwk27jbbHYeVGLUjg6fx9j_-ks5qmiw4gaJpZM4IOSqV
.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

Thanks Chris!

Can we share a k8s image and acts just like the glow agent?

It probably is impossible in K8s. K8s does not provide interface for users to directly communicate with a Kubelet. A kubelet runs on machines and executes binaries. Kubelets are controlled entirely by K8s scheduler and controller.

K8s' model is opaque, where applications are isolated from the details of running tasks. Based on my limited knowledge, Mesos probably is more friendly to your suggestion. It seems provide the resource offering mechanism for glow master to request resources and deploy the agents.

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

Good to learn this. You know more than me on k8s. Please go ahead and
thanks for your effort!
On Sat, Sep 3, 2016 at 10:30 PM Yaxiong [email protected] wrote:

Thanks Chris!

Can we share a k8s image and acts just like the glow agent?

It probably is impossible in K8s. K8s does not provide interface for users
to directly communicate with a Kubelet. A kubelet runs on machines and
executes binaries. Kubelets are controlled entirely by K8s scheduler and
controller.

K8s' model is opaque, where applications are isolated from the details of
running tasks. Based on my limited knowledge, Mesos probably is more
friendly to your suggestion. It seems provide the resource offering
mechanism for glow master to request resources and deploy the agents.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#42 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABeL76cpI3bHurgARNZDcG5dtVslAyj6ks5qmleSgaJpZM4IOSqV
.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

Thanks Chris!

I guess I will need a few months to finish the complete document.

BTW, the manager support thing never happened. My manager seems not so supportive for such a 20% project, so I never bothered to discuss with him...

But going forward, I plan to set aside regular time outside work hours for this project.

from glow.

chrislusf avatar chrislusf commented on July 22, 2024

Hi, @justicezyx Yaxiong, I am working on https://github.com/chrislusf/gleam now, which I think is much more performant and flexible. I want to know whether I can get some free credit on GCE platform. I am not full time on this, so the 60 days free trial does not fit me well.

from glow.

justicezyx avatar justicezyx commented on July 22, 2024

from glow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.