google/caliban

A way to provide my own docker image?

hamelsmu opened this issue · 3 comments

Is there a way to provide a Dockerfile or reference to a public docker image instead of relying on requirements.txt etc ?

Context: I'm working on a repo2docker Action that integrates with GitHub and want to explore automatically launching notebooks from a repo.

Google Cloud seems like a promising place to start! P.S. I found this tool through @rand

@hamelsmu , there is! I have a task on my list to add docs to caliban.readthedocs.io, but the CHANGELOG should provide enough of an example to get you started. Here's the relevant entry:

  • Custom base image support (#39), thanks
    to #20 from @sagravat.
    .calibanconfig.json now supports a "base_image" key. For the value, can
    supply:

    • a Docker base image of your own
    • a dict of the form {"cpu": "base_image", "gpu": "base_image"} with both
      entries optional, of course.

    Two more cool features.

    First, if you use a format string, like "my_image-{}:latest", the format
    block {} will be filled in with either cpu or gpu, depending on the mode
    Caliban is using.

How to use

To be more clear than the above:

  • Create a file called .calibanconfig.json in your project, with contents that look like
{"base_image": "ubuntu:18.04"}

or

{
    "base_image": {
        "cpu": "cpu_base_image",
        "gpu": "gpu_base_image"
    }
}

In the first case, GPU and CPU mode will use the same base image. In the latter case you can configure separate custom base images for each mode. THe CHANGELOG references a format string trick too, if you want to use that.

Hope this helps, @hamelsmu !

@hamelsmu also please let me know if you run into any trouble, or have any more questions. Awesome that you're giving Caliban a try.

Thanks so much for your guidance @sritchie ❤️

One more question. What I am trying to do is:

  1. Assume I have a docker image with Jupityer installed with jupyter server running as the entrypoint
  2. I want to spin up a VM on GCP with this docker container started, with the correct ports open to allow me to access the running Jupyter server
  3. I would love to optionally get a URL back so that I can access this directly that is https:// (so I don't get the ugly chrome warning when trying to access).

I see that this tool allows me to run workloads in the cloud what about Jupyter Notebook in the cloud with the Docker Image, is this Caliban the right tool doing this on GCP, you think?

My use case is that I want to create a GitHub Action that is automatically triggered when a repo is forked and optionally spins up a Jupyter Notebook automatically for users on GCP, when someone inputs their credentials. I was trying to use a really high-level abstraction like this one to start with, but it could be that perhaps I'm thinking about it the wrong way. BTW: my apologies if this is more of a GCP question and not a caliban question as my intention is not to abuse this as a forum for GCP questions, so will be happy to redirect my question if this is not appropriate to ask in this issue.

Thanks again for your help. Either way I am going to definitely try to use this as it is super cool