Giter VIP home page Giter VIP logo

phishy / wflow Goto Github PK

View Code? Open in Web Editor NEW
238.0 3.0 7.0 4.42 MB

๐Ÿ† EXPERIMENTAL -- Runs GitHub Actions workflows locally (local) -- Don't run your YAML like a ๐Ÿช

License: MIT License

Dockerfile 1.47% Shell 0.48% JavaScript 92.18% HTML 3.89% CSS 1.91% Batchfile 0.07%
continuous-integration workflow local-development github-actions docker docker-container ci devops yaml continuous-deployment

wflow's Introduction

Join the chat at https://gitter.im/wflow-local/community

Codecov

Requirements

  • Docker
  • Node.js

Install

npm install -g wflow

Usage

wflow

Running that should give you a preview of how it works, however likely you'll want to specify a workflow file, dude.

Point wflow at a valid YAML file. You may also specify an event (a GitHub webhook payload). If you do not provide an event, it attempts to read from .git.

wflow --file build.yml --event event.json

How It Works

GitHub Actions uses Azure Pipeline to spin up real VMs that you request with runs-on. As this is running locally, we are using docker-in-docker. We'll see how this goes.

When you run the wflow, it spins up a lightweight API and UI server. It reads the workflow syntax, and runs docker containers performing the work. Sidecar syslogs are setup for each docker container in order to capture the logs and write them to your workspace. Each jobs gets its own workspace. Each step in a job operates on the same workspace. While log files are written to disk, they are simultanously broadcast over WebSocker so that the UI can consume them. The UI needs some work.

Workflow Syntax

https://help.github.com/en/articles/workflow-syntax-for-github-actions

Currently supported

  • name
  • jobs
  • jobs.<job_id>
  • jobs.<job_id>.name
  • jobs.<job_id>.needs
  • jobs.<job_id>.runs-on (ubuntu-latest only)
  • jobs.<job_id>.steps

Currently, only Docker-based actions are supported. PRs welcome for JavaScript-based actions.

Not yet supported

  • on
  • on.schedule
  • jobs.<jod_id>.timeout-minutes
  • jobs.<job_id>.strategy
  • jobs.<job_id>.container
  • jobs.<job_id>.services

Install for Development

The following installs dependencies in node_modules and links wflow to work globally.

./install.sh

wflow's People

Contributors

chelsey-g avatar gitter-badger avatar phishy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wflow's Issues

Output stdout/stderr of failed process on error

Currently a command execution failure looks like this:

โœ–  error     Failed to run command
โœ–  error     docker run -l wflow --log-driver syslog --log-opt syslog-address=udp://192.168.1.254:1030 -v /tmp/user/1000/wflow/195i4NalWj8FXStw/workspaces/hg5SC7Z9i1gn4asB/code:/code  -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/bin/docker  actions/setup-python
โœ–  error     Error: Command failed with exit code 125 (ECANCELED): docker run -l wflow --log-driver syslog --log-opt syslog-address=udp://192.168.1.254:1030 -v /tmp/user/1000/wflow/195i4NalWj8FXStw/workspaces/hg5SC7Z9i1gn4asB/code:/code -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/bin/docker actions/setup-python
    at makeError (/home/chris/repositories/wflow/node_modules/execa/lib/error.js:58:11)
    at handlePromise (/home/chris/repositories/wflow/node_modules/execa/index.js:112:26)
    at process._tickCallback (internal/process/next_tick.js:68:7)

We can always run the command manually to get the output:

docker run -l wflow --log-driver syslog --log-opt syslog-address=udp://192.168.1.254:1030 -v /tmp/user/1000/wflow/195i4NalWj8FXStw/workspaces/hg5SC7Z9i1gn4asB/code:/code -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/bin/docker actions/setup-python
Unable to find image 'actions/setup-python:latest' locally
docker: Error response from daemon: pull access denied for actions/setup-python, repository does not exist or may require 'docker login'.
See 'docker run --help'.

If this was included by default in the error output it would aid debugging.

Wflow hangs on collecting commit information

I get parsing errors on existing (working on GitHub) workflows so I tried out wflow with a hello world workflow file which results into the tool hanging forever on Collecting commit information from .git.

To reproduce:
wflow --file .github/workflows/hello.yml

uses: actions/hello-world-javascript-action@master
with:
  who-to-greet: 'Mona the Octocat'

Support for job.<job_id>.services

Hello! So I was looking at using the wflow project, but it looks like it doesn't support services like postgres (which is what I'd need from this project). I am open to adding support for this myself, but I'm unsure about the scope of this task. What would it take to support job.<job_id>.services in this project?

Thanks in advance!

Error: Failed to run command

I get the following trying to run my command:

โœ–  error     Failed to run command
โœ–  error     git clone https://github.com/actions/cache.git /tmp/wflow/nXsNN3QawUtqFxqc/workspaces/Voe8BIbD3uraqNzS/actions/actions/cache;cd /tmp/wflow/nXsNN3QawUtqFxqc/workspaces/Voe8BIbD3uraqNzS/actions/actions/cache;docker build -t actions/cache .;docker run -l wflow --log-driver syslog --log-opt syslog-address=udp://10.0.8.98:1030 -v /tmp/wflow/nXsNN3QawUtqFxqc/workspaces/Voe8BIbD3uraqNzS/code:/code  -v /var/run/docker.sock:/var/run/docker.sock -v /usr/local/bin/docker:/usr/bin/docker  actions/cache 

Parsing out the commands its trying to run I found that docker build -t actions/cache . fails with:

jpollak@razorback:/tmp/wflow/nXsNN3QawUtqFxqc/workspaces/Voe8BIbD3uraqNzS/actions/actions/cache$ docker build -t actions/cache .
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /var/lib/snapd/void/Dockerfile: no such file or directory

The contents of .../actions/actions/cache are:

jpollak@razorback:/tmp/wflow/nXsNN3QawUtqFxqc/workspaces/Voe8BIbD3uraqNzS/actions/actions/cache$ ls
action.yml  CODE_OF_CONDUCT.md  CONTRIBUTING.md  examples.md  jest.config.js  LICENSE  package.json  package-lock.json  README.md  src  __tests__  tsconfig.json

Is there a Dockerfile that is missing?

Give an example event.json

From a quick glance at a repo, there doesn't seem to be a lot of documentation of what needs to be in event.json (outside of a Github webhook payload). That makes sense, but it may be worth providing an example event.json and pointing to somewhere folks can find examples of GH webhook payloads.

Apologies if I'm just missing where this might already be at. Otherwise, happy to contribute if others think this would be useful.

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.