Code Monkey home page Code Monkey logo

edward's Introduction

Edward

Edward is no longer being actively maintained. We recommend using Tilt for this and similar use cases.

Tests Go Report Card Gitter chat

A command line tool for managing local instances of microservices.

asciicast

Full documentation available at http://engblog.yext.com/edward/.

Table of Contents

Features

Start multiple services with one command

No need to start each service in its own terminal tab, just run edward start to build and launch multiple services in the background!

See it in action

See status for running services

Run edward status to see which of your services are up and running, how long for, and on which ports they are listening.

See it in action

Follow service logs

Follow stdout and stderr for one or more services with edward tail.

See it in action

Restart as needed

Made some changes? Run edward restart to re-build and re-launch a service.

See it in action

Auto-restart on edits

Edward will even automatically restart services when source files are changed.

See it in action

Generate configuration automatically

New services? Run edward generate to create a config file automatically.

See it in action

Edward can generate configuration for projects using:

  • Go
  • Docker
  • ICBM
  • Procfiles
  • Other Edward config files

Don't see your project described above? No problem! Edward can be manually configured for any service that can be built and started from the command line.

Installation

Edward requires Mac OS or Linux and Go 1.7 or higher.

go get github.com/yext/edward

Updating

To update an existing install to the latest version of Edward, run:

go get -u github.com/yext/edward

edward's People

Contributors

atavakoliyext avatar bhainesva avatar bubg-dev avatar bwangyext avatar chemidy avatar chilliams avatar jsharps-yext avatar lcstesting avatar mkilpatrick avatar norganna avatar saurabhaditya avatar silentsokolov avatar theothertomelliott 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

edward's Issues

Add "skip build" flag

In order to allow for rapid testing of profiles and Edward features, it may be useful to have the option to skip the build step when launching.

Add flag(s) to configure timeouts

A flag should be added to allow the default timeouts for starting and stopping services to be overriden.

One some slower machines running larger services, 30s isn't sufficient.

Allow service names to be specified for generation

When running the generate command, if a list of service names are passed, only services with those names should be generated. This will allow for adding a service that is ready for wider testing, without adding half-complete and false-positive services.

If no services by that name are found, Edward should error out.

Detect cycles in groups

It is possible for a group to reference itself, or another group that references itself.

Edward should detect such cycles and error out appropriately.

Make `generate` interactive

The generate command can do a lot of work in a short space of time, so it makes sense to make it interactive for most usage.

The user will first be prompted to confirm the config file that will be updated.

An initial pass will be made, and a list of services (with some additional information, such as generator type) will be output for confirmation before they are written to the config file.

It should be possible to disable these prompts with a flag.

In order to maintain expectations, this should be done before anyone gets any ideas about putting edward into a CI workflow.

Show a service's ports in the status table

Add a column to the status table that shows the ports on which a service is listening, which will be useful for debugging bind issues and reminding oneself of which ports are used by a service.

This list could be limited to 5 ports to avoid bloating the table. If a single service is displayed, a longer list can be shown.

Allow a service or group to be marked as platform-specific

Add "platform" property to service/group configuration that allow them to be ignored on non-supported platforms (this way we can have separate configurations for rabbitmq on OSX and Linux).

If omitted, all platforms are supported.

Ideally it would be possible to both blacklist and whitelist platforms.

If a service is disabled for the current platform, and no second service with the same name is provided, it will not result in a config error if that service is named in a group.

If a service is disabled for the current platform, but a second service with the same name is enabled, then the enabled service takes precedence and there is no error.

Platform detection can be achieved using GOOS.

Allow forcing overwrite on generate

If a service already exists, but you want to regenerate it, the generate command should have an option to permit forcing the generation and overwriting of the existing service.

Allow group-wide environment variables

It can sometimes be desirable to apply environment variables to a group of services, but not necessarily to those services when they're run in isolation.

The service group object should allow for an env property.

Add mechanism to ignore paths during generate

Some go packages (such as sites-cfg and leroy) don't make sense as services, but generate will add them to the config file due to their being a main package.

It should be possible to ignore these directories, either through configuration or an .edwardignore file similar to Git ignores.

Display message if a newer version of Edward is available

On every operation, Edward should check if a newer version is available (based on Git tags), and display a message suggesting upgrading if there is a newer version.

This check should be cached for an hour to prevent unnecessary calls to Git and possible exceeding of the limits.

Check for updates in a goroutine

The update check is performed at the end of executing the command, which can delay a clean exit.

The check should be triggered at the beginning of main, in a goroutine, which the app will wait on at the end of main before outputting any results.

Add a "Warmup" step

We use edward to start up play services. The launch step simply starts up the play process, after that it takes a while to actually startup a play service. This is usually due to all the initialization code that play has to run before it can serve it's first request.

The idea is to add a "warmup" step in edward which could be as simple as just hitting a pre-configured url to get that play service to startup and be ready to serve requests without a long pause.

One idea would be to start by adding a warmup-url param in the config file, which edward would hit after an edward is done with the launch phase of an application.

Handle a service failing after being detected as started

Once a service has been detected as started (via its start log message), the goroutine that waits for it to exit will stay around, which can cause a confusing error (negative wait group counts) should it subsequently fail.

The routine that waits for the service to exit should not error out or report done if this service has already been reported as started, although another error should be reported if possible.

Edward does not stop haproxy instances effectively

Reproduction steps

Can check for haproxy processes with:
$ ps aux |grep -i haproxy
Before a run, verify there are none running.

$ edward start haproxy
$ ps aux |grep -i haproxy
$ edward stop haproxy
$ ps aux |grep -i haproxy

Can see that 3 processes are still running after the stop.

Documentation: Config files

The Edward config file has no documentation at present, a .md file in a docs/ directory would likely be a big help.

Some things to call out:

  • Shared environment variables with the env array
  • Imports and how they are processed (every config file imported can see the services and groups in the parent and all other imported files)
  • The requiresSudo flag (when supported)
  • Custom stop commands

Allow parallel build and launch

In order to speed up the startup process, it would often be nice to be able to parallelize the build and launch process.

This has to be carefully managed to avoid unintended clashes (particularly with alpha), and ensuring availability of dependencies when starting services in order.

One option may be to include a flag in groups to say whether their services can be parallelized or not.

Search entire $GOPATH/src folder for go projects

The go generator is currently hard-coded to only look in the yext folder. Ideally, the whole $GOPATH/src folder should be searched, with appropriate ignore configuration to prevent 3rd party projects being picked up.

Add option to restart all running services

Either through a flag or reserved option for the restart command.

This would require knowledge of the groups that were used to start each service to ensure they were restarted in the right order.

Rotate logs daily

~/.edward/edward_logs/edward.log can get very large and difficult to follow.

This should ideally be rotated into daily files, perhaps even separated into folders by year and month.

Distinguish between trying to stop a non-running service and a failure to stop a running service

When running restart, any failure in trying to stop a service is ignored and treated as that service not running. In the event that a service cannot be stopped (permission issues, for example), this may result in the subsequent start failing with confusing symptoms.

Failure to stop should only be ignored iff the service in question had neither a pidfile, nor an associated process when restart was called.

Use requiresSudo flag to limit password requests

Only a few services need sudo in order to be managed, and some users have their password cache duration set pretty low, so are being prompted unnecessarily.

Services currently allow for a requiresSudo property, but this isn't acted upon. Calls to start/stop/restart should check if any services they're acting upon have this set to true before calling ensureSudoAble()

Change build/launch order when starting groups

When starting a group everything is first built before launching anything. This is super unfortunate when something at the end of the group fails, causing the next try to rebuild everything again. It would be great if each item performed build then launch, instead of build, build, build, etc then launch, launch, launch, etc.

This would allow only rebuilding/launching the smaller subset of service(s) that failed, while the successful ones stay running.

Add generator for Revel projects

Low priority, but Revel projects are not picked up by the generators, so have to be added to config manually.

It's unlikely we'll add any more such projects, but it may be a timesaver for existing projects and shouldn't be a huge change.

Option to use local RabbitMQ

I know the use of local vs. office RabbitMQ has gone back and forth recently. It would be nice if there was a way to specify which to use (override default of office) on service starts.

Perhaps if rabbitmq is started within a group then all services in that group should use the locally start one.

Stop all running services

It would cool to be able to stop all running services.

For example if development doesn't require anything to be running, bunch of local services could make memory-hogging IDEs like eclipse even more painful.

Maybe there's a way to do this already? Other than something like edward status | awk '{print $2}' | grep -v -e '^$' | grep -v NAME | xargs edward stop

Search for edward config in parent directories rather than Git root

Edward searches for config in the following locations:

  • Working directory
  • Git root from working directory
  • ~/.edward

Because not all environments have monorepos, it makes sense to search through the parent directories from the working directory rather than the Git root.

`edward start` with no parameters should start any services below the cwd

As a brute force way of using your directory structure to group services, if you have a parent edward config, and you're in a subdirectory, running edward start with no parameters should start all known services below the current working directory.

Should add a prompt if this is a large number of services.

Add logs for debugging

In order to help debug issues on different environments, Edward should create a detailed log file under ~/.edward.

This should cover:

  • Time of each call
  • Command executed
  • Trace of operations
  • All errors
  • Events such as clearing PIDfiles on a reboot and the uptime information used to trigger this

Remove explicit references to $ALPHA

In some places (such as the service path for generated services), the $ALPHA env variable is used explicitly.

These references should be removed.

Add Travis Build

At minimum, a build and test should be run for each commit with Travis.

Run the launch step for each service in the background

Once a service has been built it should be possible to launch it in the background while the next service builds.

However, the launches should still run in series, so only one worker should be available for this task.

Consolidate error handling

There is currently a mix of errgo and no specific error handling.
Error handling should be standardized across the project.

pkg/errors is a possible avenue to explore.

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.