All Projects → lherman-cs → gotopus

lherman-cs / gotopus

Licence: Apache-2.0 License
Gotopus is a minimalistic tool that runs arbitrary commands concurrently.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gotopus

channel
Go-like channels for JavaScript
Stars: ✭ 49 (+188.24%)
Mutual labels:  concurrency
Corium
Corium is a modern scripting language which combines simple, safe and efficient programming.
Stars: ✭ 18 (+5.88%)
Mutual labels:  concurrency
Composer
Library for composability of interdependent non-blocking I/O tasks
Stars: ✭ 19 (+11.76%)
Mutual labels:  concurrency
setup shift
📨 Automate the download of your current setup
Stars: ✭ 11 (-35.29%)
Mutual labels:  build
psched
Priority-based Task Scheduling for Modern C++
Stars: ✭ 59 (+247.06%)
Mutual labels:  concurrency
jagen
A software engineer's workspace manager and build systems wrapper
Stars: ✭ 32 (+88.24%)
Mutual labels:  build
queueable
Convert streams to async ⌛ iterables ➰
Stars: ✭ 43 (+152.94%)
Mutual labels:  concurrency
geeteventbus
An inprocess eventbus for highly concurrent Python applications
Stars: ✭ 17 (+0%)
Mutual labels:  concurrency
go-stm
Software Transactional Memory for Go
Stars: ✭ 15 (-11.76%)
Mutual labels:  concurrency
build-plugin
Track your build performances like never before.
Stars: ✭ 45 (+164.71%)
Mutual labels:  build
edd
Erlang Declarative Debugger
Stars: ✭ 20 (+17.65%)
Mutual labels:  concurrency
bzl
Bzl - Integrated CLI + UI + VSCode Extension for Bazel
Stars: ✭ 43 (+152.94%)
Mutual labels:  build
mux-stream
(De)multiplex asynchronous streams
Stars: ✭ 34 (+100%)
Mutual labels:  concurrency
makes
A DevSecOps framework powered by Nix.
Stars: ✭ 158 (+829.41%)
Mutual labels:  build
ngmodule-viz
Visualize the dependencies between the NgModules in your Angular 2+ application
Stars: ✭ 35 (+105.88%)
Mutual labels:  dependency-graph
unity-ci-test
Example Unity Project using TravisCI
Stars: ✭ 35 (+105.88%)
Mutual labels:  build
calendar-view-plugin
Jenkins Calendar View Plugin: Shows past and future builds in a calendar view
Stars: ✭ 17 (+0%)
Mutual labels:  build
asap
A cmake starter project for C++ with basic infrastructure including platform detection, compiler detection, assertions..., and a complete build lifecycle. Portable across Linux, OS X and Windows.
Stars: ✭ 39 (+129.41%)
Mutual labels:  build
ring-election
A node js library with a distributed leader/follower algorithm ready to be used
Stars: ✭ 92 (+441.18%)
Mutual labels:  concurrency
SubmiBot
Plugin do Eclipse para automatização do processo de submissão de tarefas na disciplina de LP2 - Computação@UFCG
Stars: ✭ 16 (-5.88%)
Mutual labels:  build

gotopus

codecov Go Report Card Codacy Badge License

Gotopus is a minimalistic tool that runs arbitrary commands concurrently. You define your commands with their dependencies and Gotopus will take care of the rest, running them concurrently when possible.

Contents

Features

Installation

curl -sf https://gobinaries.com/lherman-cs/gotopus | sh

Getting Started

Basic Usage

Usage: gotopus <url or filepath> ...

  -max_workers uint
    	limits the number of workers that can run concurrently (default 0 or limitless)
# examples/basic.yaml
jobs:
  job1:
    steps:
      - run: sleep 1 && echo "job1"
  job2:
    needs:
      - job1
    steps:
      - run: echo "job2"
  job3:
    steps:
      - run: echo "job3"

To use basic.yaml above, you can run the following command:

gotopus basic.yaml

Or you can simply give a URL to this file:

gotopus https://raw.githubusercontent.com/lherman-cs/gotopus/master/examples/basic.yaml

By default, if you don't set max_workers to any number greater than 0, gotopus will create a pool of workers without a limit in lazy way. From the example above, 2 workers will be allocated instead of 3. The process looks like following:

job1 gets scheduled
spawn worker #0
worker #0 executes job1
job3 gets scheduled
spawn worker #1
worker #1 executes job3
job3 finishes
job1 finishes
either worker #0 or #1 executes job2
job2 finishes

Environment Variables

Whenever a step runs, there are 3 kinds of environments that are going to be set and they'll have the priority order (in case of a conflict happens, the higher priority environment variable will be chosen) as listed below, where user environment variables will have the highest priority:

  • User: these environment variables are defined by the user in yaml in each step.

  • Builtin: environment variables that come from gotopus and they'll be prefixed with GOTOPUS_.

    • GOTOPUS_JOB_ID
    • GOTOPUS_JOB_NAME
    • GOTOPUS_STEP_NAME
    • GOTOPUS_WORKER_ID
  • System: inherits all the environments variables from the system when you run gotopus.

Following is an example how you define and use environment variables:

# examples/env.yaml
jobs:
  job:
    steps:
      - name: Install dependencies
        run: echo "$GOTOPUS_STEP_NAME"
      - run: echo "$name"
        env:
          name: Lukas Herman

Concurrency vs Parallelism

Let's imagine that there are 2 commands that we want to execute:

  1. First command: sleep 2 && echo "job 1"
  2. Second command: sleep 3 && echo "job 2"

Normally, this would take 5 seconds to finish since you need to run them sequentially. But, if you run this concurrently, this would take ~3 seconds even when you only have 1 CPU core!. This is possible because they run conccurrently NOT in parallel. For more information, there's this awesome video from Rob Pike that specfically talks about "Concurency Is Not Parallelism".

Conccurency vs Parallelism

time gotopus https://raw.githubusercontent.com/lherman-cs/gotopus/master/examples/concurrency.yaml

FAQ

Why does the config format look similar to Github Actions?

This is intentional because I think Github Actions format is pretty clean and also one of my inspirations to create Gotopus. Although Gotopus and Github Actions seem to have similar functionalities, you can definitelly use them together! For example, you can run steps of a job concurrently with Gotopus (running steps concurrently is not supported currently: https://github.community/t5/GitHub-Actions/Steps-in-parallel/td-p/32635).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].