GithubHelp home page GithubHelp logo

diffgram-cli's Introduction

diffgram-cli

Diffgram CLI is command line interface for developers who want to contribute to Diffgram

Installation

npm install -g diffgram-cli

Install dev version

npm i -g .

Run without installation:

node bin/index.js [command name]

Usage

Change your directory to the diffgram first. To see what's available on CLI, run:

diffgram --help

Commands:

  • action ActionName: creates and registers a new action template (both frontend and backend)
  • compose: creates a docker-compose-dev.yaml file, so you don't need to comment out anything in docker-compose
  • up: runs command docker-compose -f docker-compose-dev.yaml up
  • secrets: creates a secrets.py file

Development

Clone this repo and install dependencies. After, create .env file in the root folder and set next environmental variable:

DEV=true

diffgram-cli's People

Contributors

pjestrada avatar

Stargazers

 avatar

Watchers

 avatar  avatar

diffgram-cli's Issues

Exit docker-compose process requires 2 times press of Ctrl-c

So far, you can start docker-compose dev will all the output on the console. However, to stop it you have to press ctrl-c 2 times. This is has something to do with node.js signals (most likely it send 2 signals when running this command through actual CLI)

Update Action template

Since actions were updated, need to update template and add precondition property to the action class

from eventhandlers.action_runners.base.ActionRunner import ActionRunner
from eventhandlers.action_runners.base.ActionTrigger import ActionTrigger
from eventhandlers.action_runners.base.ActionCondition import ActionCondition
from eventhandlers.action_runners.base.ActionCompleteCondition import ActionCompleteCondition


class VertexTrainDatasetAction(ActionRunner):
    public_name = 'Vertex Ai Train Dataset'
    description = 'Train model with Vertex AI'
    icon = 'https://www.svgrepo.com/show/375510/vertexai.svg'
    precondition = ActionCondition(default_event = None, event_list = [])
    kind = 'VertexTrainDatasetAction'  # The kind has to be unique to all actions
    category = 'training'  # Optional

    # What events can this action listen to?
    trigger_data = ActionTrigger(default_event = 'some_diffgram_event',
                            event_list = ['some_diffgram_event'])

    # What pre-conditions can this action have?
    condition_data = ActionCondition(default_event = 'some_diffgram_event',
                                     event_list = ['some_diffgram_event'])

    # How to declare the actions as completed?
    completion_condition_data = ActionCompleteCondition(default_event = 'some_diffgram_event',
                                                        event_list = ['some_diffgram_event'])

    def execute_pre_conditions(self, session) -> bool:
        # Return true if no pre-conditions are needed.
        return True

    def execute_action(self, session):
        # Your core Action logic will go here.
        pass

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.