Coder Social home page Coder Social logo

ring's Introduction

This repository is no longer maintained. All further development moves to queil/ring.

Ring Build Status NuGet Badge

Meta-orchestrator for developers (cross-platform)

Ring brings order into the messy world of developing and debugging a cloud-ready microservice system side by side with maintaining and migrating legacy ones where you may have many different types of services (ASP.NET Core, Topshelf, WCF, ...) hosted in many different ways (Kubernetes, Docker, IIS Express, WindowsService, Exe) and scattered across many solutions and repositories.

What is it?

Ring consists of the following parts:

How it works

Ring groups apps into workspaces. Workspaces are defined in TOML files. Workspaces are composed from apps and other workspaces. A workspace can be loaded and started. Ring periodically runs a health check for every app, tries restarting the unhealthy ones, and reports the dead ones. Ring also exposes a web socket interface. Visual Studio extensions use it mainly for visualizing workspace/apps states, turning services off/on for build/debugging if they're a part of the currently loaded project/solution.

Basic facts

  • You can run multiple instances of ring (serving different independent workspaces)
  • There can be multiple clients (VS/VS Code extensions) interacting with a Ring instance at a time although mostly you'd have just one
  • Ring is meant to keep your workspace running even if you quit Visual Studio
  • You can also run Ring in a stand-alone mode which just keeps your workspace running
  • Ring exposes a web socket interface on port 7999

Supported runnables

  • kustomize - Kubernetes apps managed by Kustomize
  • dockercompose - docker-compose files
  • aspnetcore - .NET Core apps running in console (like ASP.NET Core in Kestrel)
  • proc - arbitrary native processes

Windows-only:

  • iisxcore - ASP.NET Core apps in IIS Express
  • iisexpress - WCF and other .NET Framework services hosted in IIS Express
  • netexe - full .NET Framework console apps (like TopShelf)

Installation

Ring dotnet tool

dotnet tool install --global ATech.Ring.DotNet.Cli --version '4.0.0-alpha.*'

Visual Studio Extension

Make sure you installed the dotnet tool first.

Download here ring! for Visual Studio

Visual Studio Code Extension

Download an early preview

Troubleshooting

If ring does not work as expected you can use --debug or -d switch to enable a debug level output.

ring run -w .\path\to\your\workspace.toml -d

CLI commands

  • run - runs a specified workspace in a stand-alone mode.
  • headless - starts and awaits clients (VS Code / VS extension) connections. Once connected a client can load a workspace and interact with it.
  • clone - loads a workspace and clones configured repos for each runnable. The runnables must have the sshRepoUrl parameter configured otherwise they'll be skipped.
  • config-* commands - more info here - configuration files.

Vocabulary

  • app (aka runnable - an application/service/process ring manages.
  • workspace - a logical grouping of apps defined in TOML file(s). Workspaces can be composed of other workspaces using the import tag. Ring can only run a single workspace at a time.

Example workspace

# your workspace.toml
[[kustomize]]
path = "your/app"

[[dockercompose]]
path = "app/2"

[[import]]
path = "relative/path/to/your/workspace.toml"

Authoring workspaces

Authoring workspaces docs

Release notes

Here

Working with the docs

Serve locally:

docker run -p 8089:8089 --rm -it -v ~/.ssh:/root/.ssh -v ${PWD}:/docs squidfunk/mkdocs-material serve -a 0.0.0.0:8089

Publish

docker run --rm -it -v ~/.ssh:/root/.ssh -v ${PWD}:/docs squidfunk/mkdocs-material gh-deploy 

ring's People

Contributors

niemtec avatar queil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ring's Issues

Multiple instances of ring fail cloning the same repo

Running Ring as a local tool highlighted an issue with running multiple instances with workspaces containing the same git repo. At present both instances try to clone into the same dir resulting with fatal: shallow file has changed since we read it. A possible solution would be to have a workspace hash and use it in the clone path (i.e. provide unique clone location per workspace). There is still a possibility someone could run the same workspace twice but this is not a valid use case.

Expose Service Startup Spread as a Configurable Value

When running a larger workspace (with 30+ services), the startup process can cause MacOS to freeze and even experience application crashes whilst the CPU is maxing out at 100%.

If possible it would be a good idea to expose the startup spread configuration so that the startup impact can be throttled according to OS/user needs.

Streaming logs

Ring should stream logs of the controlled runnables via websockets so they can be filtered and displayed in the clients.

Can fail to pull from sshRepo

Sometimes Ring fails to pull from an sshRepoUrl that it previously had no problem pulling from earlier in the same day. This error occurs when running Ring with the Visual Studio 2019 extension - so I run a toml file, then stop running it, and then next time I try to run it, this error might occur.

Problem seems intermittent but I have noticed it occurring after a change in VPN connection and I can get around the issue by closing Ring and trying again ... at which point it works.

The following error appears in Rings log files (not that xx is redacted code):

System.InvalidOperationException: If sshRepoUrl is used csProj must be a relative path but it is C:\Users\xx\AppData\Local\Temp\ring\repos\core\third-party\ob\provider\./source/xx.WebApi/xx.ProviderService.WebApi.csproj
   at ATech.Ring.DotNet.Cli.Windows.Runnables.Dotnet.DotnetContext.Create[T,C](C config) in C:\Dev\dev\tools\atech-ring\source\ATech.Ring.DotNet.Cli\Windows\Runnables\Dotnet\DotnetContext.cs:line 32
   at ATech.Ring.DotNet.Cli.Windows.Runnables.Dotnet.DotnetRunnableBase`2.InitAsync(CancellationToken token) in C:\Dev\dev\tools\atech-ring\source\ATech.Ring.DotNet.Cli\Windows\Runnables\Dotnet\DotnetRunnable.cs:line 34
   at ATech.Ring.DotNet.Cli.Windows.Runnables.Dotnet.AspNetCoreRunnable.InitAsync(CancellationToken token) in C:\Dev\dev\tools\atech-ring\source\ATech.Ring.DotNet.Cli\Windows\Runnables\Dotnet\AspNetCoreRunnable.cs:line 22
   at ATech.Ring.DotNet.Cli.Abstractions.Runnable`2.InitCoreAsync(CancellationToken token) in C:\Dev\dev\tools\atech-ring\source\ATech.Ring.DotNet.Cli\Abstractions\Runnable.cs:line 187

Kustomize runnables destroy is not awaited

What is happening

When ring terminates (CTRL+C) it starts the destroy command for Kustomize runnables but the child processes get terminated before completion. It results with orphaned applications.

Expected behaviour

Ring should wait for the destroy processes to finish. No orphaned apps should be left.

Details

Ring version: 2.4.0

Ring fails to start as a local tool

Repro:

  1. Install ring as a local dotnet tool: dotnet tool install ATech.Ring.Dotnet.Cli --version 3.0.0-alpha.1
  2. Create an example workspace and save as ring.toml in the repo root:
    [[aspnetcore]]
    csproj = "src/server/App.fsproj"
  3. Run ring: dotnet ring run -w ring.toml
  4. Observe the following exception:
Unhandled exception: System.IO.FileNotFoundException: The configuration file 'appsettings.json' was not found and is not optional. The expected physical path was '/home/user/path/to/not/found/appsettings.json'.
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.HandleException(ExceptionDispatchInfo info)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load(Boolean reload)
   at Microsoft.Extensions.Configuration.FileConfigurationProvider.Load()
   at Microsoft.Extensions.Configuration.ConfigurationManager.AddSource(IConfigurationSource source)
   at Microsoft.Extensions.Configuration.ConfigurationManager.Microsoft.Extensions.Configuration.IConfigurationBuilder.Add(IConfigurationSource source)
   at Microsoft.Extensions.Configuration.ConfigurationExtensions.Add[TSource](IConfigurationBuilder builder, Action`1 configureSource)
   at Microsoft.Extensions.Configuration.JsonConfigurationExtensions.AddJsonFile(IConfigurationBuilder builder, IFileProvider provider, String path, Boolean optional, Boolean reloadOnChange)
   at Microsoft.Extensions.Configuration.JsonConfigurationExtensions.AddJsonFile(IConfigurationBuilder builder, String path, Boolean optional)
   at Program.<>c__DisplayClass0_0.<<Main>$>b__8(HostBuilderContext c, IConfigurationBuilder b) in /home/vsts/work/1/s/src/source/ATech.Ring.DotNet.Cli/Program.cs:line 131
   at Program.<Main>$(String[] args) in /home/vsts/work/1/s/src/source/ATech.Ring.DotNet.Cli/Program.cs:line 129

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.