Coder Social home page Coder Social logo

rundev's Introduction

rundev
======
Sub-second inner-loop iterations for containers running on Google Cloud Run.

Installation
------------

For now you need "go" version >1.12 to download the rundev client:

     go get github.com/ahmetb/rundev/cmd/client
     mv ~/go/bin/{client,rundev}

Make sure ~/go/bin is in your PATH. You can verify installation by running:

     rundev -h

Start developing
---------------

Switch into your application's source directory.

For an application that picks up new source code by restarting, just run:

    rundev

For an application that needs a build step after syncing the new code, you can
specify a build command like:

    rundev -build-cmd 'go build -o /out/server .'

Or simply you can annotate your RUN directive with a "# rundev" comment like:

    RUN go build -o /out/server . # rundev

This command will:

  1. in-memory overwrite your Dockerfile to install and run the "rundevd"
     daemon which is an harness around your original ENTRYPOINT/CMD.
  2. build and push a container image to your project
  2. deploy your app to Cloud Run
  3. start a local HTTP server on localhost:8080 for development.

Visit http://localhost:8080 to access your application with live code sync.
Change your code, and visit your address to see the updated application.
When you're done developing, hit Ctrl+C once for cleanup and exit.

Every time you make a request to this address:
  - local file system will be synced (if necessary) to containers on Cloud Run
  - your app will be rebuilt and restarted (if necessary)
  - your query will be proxied to Cloud Run container instances.

In the command above:
  -local-dir contains path to source code on your machine.
  -run-cmd specifies entrypoint to your application
  -build-cmd (optional) is the command to rebuild your application
  -remote-dir specifies the directory inside the container to sync files to
  -addr specifies an alternative address to listen on


Debug endpoints
---------------

/rundev/debugz : debug data for rundev client
/rundev/fsz    : local fs tree (+ ?full)
/rundevd/fsz   : remote fs tree (+ ?full)
/rundevd/debugz  : debug data for rundevd daemon
/rundevd/procz   : logs of current process
/rundevd/pstree  : process tree
/rundevd/restart : restart the user process
/rundevd/kill   : kill the user process (or specify ?pid=)

rundev's People

Contributors

ahmetb avatar

Watchers

 avatar  avatar

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.