question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add MINIMAL example of how to deploy on Google Cloud

See original GitHub issue

I personally am having a bit of trouble deploying my dask workload on GKE. I doubt I’m the only one, as the current “quickstart” guide makes a lot of assumptions and has a lot of extra stuff (helm, jupyterhub) that confuses the core ideas for those not familiar with gce deployments or kubernetes.

I suggest adding a minimal deployment tutorial that includes:

  • Setting up a gke cluster (already covered by zero-to-jupyterhub)

  • What about local ssds? Does each pod require a local ssd if the underlying datasets exceed worker memory. Or, does the dask-worker-space reside on the “master” node? Do the pods have access the master nodes disk?

  • Creating/linking a docker image for the worker

  • Can I build the image on the “master” node and the workers will be able to find it?

  • Writing a yaml file for the gke cluster and docker image (not covered in any detail, from what I can find).

Here is the toy script I’m working with to try to get running on GKE:

from dask.distributed import Client,get_worker
from dask_kubernetes import KubeCluster

def write_file(idx):
    fName = "file_{:04d}.txt".format(idx);
    content = fName + " " + str(get_worker().id) + "\n";
    with open(fName,'w+') as f:
        f.write(content);
    return (fName,content);

if __name__=="__main__":
    cluster = KubeCluster();
    client = Client(cluster);
    futs = []
    for ii in range(0,10):
        futs.append( client.submit(write_file,ii) );

    print(futs,'\n\n')
    out = client.gather(futs);
    print(out)

Dockerfile:

FROM python:3.6
RUN mkdir /app
WORKDIR /app
ADD . /app/
RUN pip install -r requirements.txt

Any help would be appreciated!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:14 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jacobtomlinsoncommented, Oct 14, 2019

You need to create a service account for that pod with the correct RBAC perms. We have this config over in the Pangeo project which adds dask-kubernetes support to Zero to JupyterHub.

1reaction
bgoodman44commented, Oct 18, 2019

Thank you Jacob! It works and it is GLORIOUS! I still have a few things to hash out, but than I’ll share my “how-to”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Deploying from source code | Cloud Run Documentation
Behind the scenes, this command uses Google Cloud's buildpacks and Cloud Build to automatically build container images from your source code without having...
Read more >
How to deploy your Node.js app with Google - Level Up Coding
In this post, I will walk you through the steps of setting up a project on Google Cloud and deploying a Node.js app...
Read more >
Deploy a Node.js Application With App Engine in 10 Minutes!
A walkthrough of deploying a simple node.js application on Google Cloud Platform's App Engine.
Read more >
Get started: write, test, and deploy your first functions - Firebase
Click Create project (or Add Firebase, if you're using an existing Google Cloud project). Firebase automatically provisions resources for your Firebase project.
Read more >
Deploying simple code on Google Cloud
Google Compute Engine (GCE) · Create a VM on GCE and set Region & Zone needed · In the container section, check Deploy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found