Git Product home page Git Product logo

chapi's Introduction

chapi Build Status Scrutinizer Code Quality Code Coverage

Chronos and marathon api client for your console.

Description

Manage your Chronos and Marathon tasks like a git repository in your console:

  • Prepare your tasks before you send them to Remote
  • Manage a separate git repository for task backups and history
  • Quickly check your tasks' status

It is possible to use either of the systems independently or both at once.

Requirements

  • php >= 5.6

Installation / Configuration

To install chapi you can download the latest release or clone this repository. If you clone the repository you need to run a composer install to install all necessary dependencies:

composer install

Before you use chapi the first time you have to setup your chronos api url and the path to your local task repository. You can use the configure command to setup your global settings:

bin/chapi configure 

Configuration file locations

Chapi attempts to read a global and a local configuration file, at least one of which must exist. Should both files exist, values found in the local configuration override those defined in the global one.

The global configuration file's location is

  • ~/.chapi/.chapiconfig if $CHAPI_HOME is not set

  • ${CHAPI_HOME}/.chapiconfig, if $CHAPI_HOME is set

The local configuration searched for in your current working directory.

  • ${PWD}/.chapiconfig,

Profiles

You can switch between different profiles by using the global --profile[=PROFILE] option.

If no profile is set chapi will use default as active profile.

Configuration file contents

Both configuration files are in the yaml format.

The configuration is located in the profiles property. There you will find the parameters for each set profile.

default will be used if you don't use a explicit profile.

profiles:
    default:
        parameters:
            chronos_url: http://your.chronos.url:chronos_api_port/
            chronos_http_username: username
            chronos_http_password: password
            repository_dir: /path/to/your/local/task/repository
        
            marathon_url: http://your.marathon.url:marathon_api_port/
            marathon_http_username: username
            marathon_http_password: password
            repository_dir_marathon: /path/to/your/local/marathon/apps/repository
        
            cache_dir: /path/to/chapi/cache/dir
            
        ignore:
          - *-dev
          - !my-active-job-dev
    develop:
       parameters:
           chronos_url: http://your.chronos.url:chronos_api_port/
           chronos_http_username: ''
           chronos_http_password: ''
           repository_dir: /path/to/your/local/task/repository
      
           marathon_url: ''
           marathon_http_username: ''
           marathon_http_password: ''
           repository_dir_marathon: ''
      
           cache_dir: /path/to/chapi/cache/dir_dev

chronos_url

The chronos api url (inclusive port). See also configure command option -u.

chronos_http_username

The chronos http username. See also configure command option -un.

Necessary if the setting --http_credentials is activated in your Chronos instance.

chronos_http_password

The chronos http password. See also configure command option -un.

Necessary if the setting --http_credentials is activated in your Chronos instance.

repository_dir

Root path to your job files. See also configure command option -r.

marathon_url

The marathon api url (inclusive port). See also configure command option -mu.

marathon_http_username

The marathon http username. See also configure command option -mun.

marathon_http_password

The marathon http password. See also configure command option -mp.

repository_dir_marathon

Root path to your tasks folder. See also configure command option -mr.

cache_dir

Path to cache directory. See also configure command option -d.

Update notes

v0.9.0

Because of the new marathon support with v0.9.0 you need to update your configurations. The parameters.yml structure changed and renamed to .chapiconfig.

You need to recreate your config settings:

bin/chapi configure

Disabling services

To disable Chronos support and only use Marathon, set all the Chronos parameters to '':

profiles:
    default:
        parameters:
            # [....]
            chronos_url: ''
            chronos_http_username: ''
            chronos_http_password: ''
            repository_dir: ''

Ignoring jobs

You can specify pattern for each profile in your .chapiconfig file(s) and add a file to your job repositories to untrack jobs you want chapi to ignore.

  • The matching pattern according to the rules used by the libc glob() function, which is similar to the rules used by common shells.
  • An optional prefix "!" which negates the pattern; any matching job excluded by a previous pattern will become included again.

Example content:

profiles:
    default:
        ignore:
          - *-dev
          - !my-active-job-dev
    dev:
        ignore:
          - "*"
          - "!*-dev"

Usage

list

Display your tasks and filter them by failed

bin/chapi list [options] 
Options:
  -f, --onlyFailed      Display only failed jobs
  -d, --onlyDisabled    Display only disabled jobs
  --profile[=PROFILE]  Use a specific profile from your config file.

info

Display your task information from remote system

bin/chapi info <jobName> 
Arguments:
  jobName               selected job
  
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

The task name in case of marathon would be the full id for the task.

status

Show the working tree status

bin/chapi status
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

diff

Show changes between tasks and working tree, etc

bin/chapi diff [<jobName>]
Arguments:
  jobName               Show changes for specific job
  
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

add

Add task contents to the index

bin/chapi add [<jobnames>]...
Arguments:
  jobnames              Jobs to add to the index
  
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

reset

Remove tasks from the index

bin/chapi reset [<jobnames>]...
Arguments:
  jobnames              Jobs to add to the index
  
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

pull

Pull tasks from remote system and add them to local repository

bin/chapi pull [options] [--] [<jobnames>]...
Arguments:
  jobnames              Jobnames to pull

Options:
  -f, --force           Force to overwrite local jobs 
  --profile[=PROFILE]  Use a specific profile from your config file.

commit

Submit changes to chronos or marathon

bin/chapi commit
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

scheduling

Display upcoming jobs in a specified timeframe

bin/chapi scheduling [options]
Options:
  -s, --starttime[=STARTTIME]  Start time to display the jobs
  -e, --endtime[=ENDTIME]      End time to display the jobs
  --profile[=PROFILE]  Use a specific profile from your config file.

Note: Not applicable to marathon

configure

Configure application and add necessary configs

bin/chapi configure
Options:
  -u, --chronos_url[=CHRONOS_URL]        The chronos url (inclusive port)
  -un, --chronos_http_username[=CHRONOS_HTTP_USERNAME]  The chronos username (HTTP credentials) [default: ""]
  -p, --chronos_http_password[=CHRONOS_HTTP_PASSWORD]   The chronos password (HTTP credentials) [default: ""]
  -d, --cache_dir[=CACHE_DIR]            Path to cache directory
  -r, --repository_dir[=REPOSITORY_DIR]  Root path to your job files
  --profile[=PROFILE]  Use a specific profile from your config file.

validate

Validate local jobs

bin/chapi validate [<jobmames>]...
Arguments:
  jobmames              Jobs to validate
  
Options:
  --profile[=PROFILE]  Use a specific profile from your config file.

Example workflows

Add a new job to chronos

A typical workflow to add a new cronjob to your Chronos server via chapi can be:

  1. A pull request for a new cronjob (json definition) comes in a git repository (created by a colleague of you)
  2. Accept the pull request and switch to your local clone via cd ~/my/clone
  3. Update your local repository via git pull
  4. Check the current status via chapi status
  5. Validate everything via chapi validate .
  6. Add the new job via chapi add jobXy
  7. Apply the changes and update the Chronos server via chapi commit

Move jobs from chronos cluster A to cluster B successively

Chapi is able to support you if you need to move your tasks from a chronos cluster to another one.

  1. Setup your normal chapi config and local job repository

  2. Create a new empty folder which stands for your second chronos cluster repository:

mkdir clusterBjobs
  1. Add a local .chapiconfig file (see configuration) to the new folder:
touch clusterBjobs/.chapiconfig
  1. Edit the file and add the chronos_url and repository_dir parameters for your second chronos cluster:
parameters:
    chronos_url: http://your.second.chronos.url:chronos_api_port/
    repository_dir: /path/to/clusterBjobs
  1. Open a second console and switch to the new folder where the .chapiconfig file is located:
cd clusterBjobs
  1. Now you are able to move job for job from your normal repository to the new repository:
mv clusterAjobs/jobXy.json clusterBjobs/jobXy.json
  1. Chapi in console 1 will delete the jobs from the "old" cluster and chapi in the second console 2 will add the moved jobs to the new one.

Supported commands for either system

chronos marathon
list
info
status
diff
add
reset
pull
commit
scheduling n.a.
configure
validate

Special cases in marathon:

  • Pulling a task from marathon will dump the json object with default values. This is the choice for now because calling marathon for app info sends the default values set as well. Logic to check this could be implemented in future.
  • Group apps cannot be pulled from marathon in the configuration with which it was posted. This is because once an app is in marathon, the group specific config is lost.
  • The marathon App id should be be prefixed by /. This is a good practice. The reason this needs to be forced is because the local configuration with myapp will be seen in marathon as /myapp and by chapi as two different apps.

If you find any further issues or edge case, please create an issue.

Supported Chronos versions

  • v2.5

Supported Marathon versions

  • v1.6.322

Docker

You can run chapi also in a docker container. You will find the laster releases under dockerhub.

Prepare a config file for docker

Create a .chapiconfig_docker file with the following content:

profiles:
    default:
        parameters:
            cache_dir: /root/.chapi/cache
            chronos_url: 'http://your.chronos.url:4400/'
            chronos_http_username: YOUR_CHRONOS_USER
            chronos_http_password: YOUR_CHRONOS_PASS
            repository_dir: /chronos-jobs
            marathon_url: 'http://your.marathon.url:8080/'
            marathon_http_username: YOUR_MARATHON_USER
            marathon_http_password: YOUR_MARATHON_PASS
            repository_dir_marathon: /marathon-jobs

Run docker

docker pull msiebeneicher/chapi-client:latest

docker run -it \
    -v ~/.chapiconfig_docker:/root/.chapi/.chapiconfig \
    -v /your/local/checkout/chronos-jobs:/chronos-jobs \
    -v /your/local/checkout/marathon-jobs:/marathon-jobs \
    msiebeneicher/chapi-client:latest <COMMAND>

Run docker for development

docker pull msiebeneicher/chapi-client:latest

docker run -it \
    -v ~/.chapiconfig_docker:/root/.chapi/.chapiconfig_docker \
    -v /your/local/checkout/chronos-jobs:/chronos-jobs \
    -v /your/local/checkout/marathon-jobs:/marathon-jobs \
    -v /your/local/checkout/chapi:/chapi \
    --entrypoint /bin/bash \
    msiebeneicher/chapi-client:latest

Todos:

Marathon

  • The validate command for marathon is not yet implemented.
  • The list command has status set as ok for marathon entities. This could show the last status of the app.

chapi's People

Contributors

andygrunwald avatar aurimasniekis avatar bidesh avatar busrakoken avatar dkleuser avatar msiebeneicher avatar peter279k avatar scrutinizer-auto-fixer avatar shyx0rmz avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

chapi's Issues

JobLoadException when Marathon job is not on deployed on Marathon already

In my marathon definitions directory, i have a dirty git state right now, because i am preparing a new marathon definition for a new app:

➜  marathon-jobs git:(master) ✗ git st
On branch master
...
Untracked files:
  (use "git add <file>..." to include in what will be committed)

	X.json

nothing added to commit but untracked files present (use "git add" to track)

When i trigger a typical status call the JobLoadException will be thrown and i don't get results at all:

➜  chapi git:(master) bin/chapi status


  [Chapi\Exception\JobLoadException]
  Unable to load json job data from "/my/path/X.json". Please check if the json is valid.


status

Expected results would be that i get a listing of Chronos and Marathon tasks and when i have a dirty state (like X.json) i expect a info or warning note.

Fatal error during `bin/chapi scheduling`

I saw this fatal error (on current master)

➜  chapi git:(master) bin/chapi scheduling
PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Chapi\Entity\Chronos\JobStatsEntity::__construct() must be of the type array, object given, called in /Users/andygrunwald/Development/chapi/src/Service/Chronos/JobStatsService.php on line 66 and defined in /Users/andygrunwald/Development/chapi/src/Entity/Chronos/JobStatsEntity.php:28
Stack trace:
#0 /Users/andygrunwald/Development/chapi/src/Service/Chronos/JobStatsService.php(66): Chapi\Entity\Chronos\JobStatsEntity->__construct(Object(stdClass))
#1 /Users/andygrunwald/Development/chapi/src/Commands/SchedulingViewCommand.php(111): Chapi\Service\Chronos\JobStatsService->getJobStats('Bluekai-FillRed...')
#2 /Users/andygrunwald/Development/chapi/src/Commands/SchedulingViewCommand.php(82): Chapi\Commands\SchedulingViewCommand->printTimeLineTable(1481793861, 1481801061)
#3 /Users/andygrunwald/Development/chapi/src/Commands/AbstractCommand.php(78): Chapi\Commands\SchedulingViewCommand->process()
#4 /Users/andygrunwald/Development/chapi/vendor/symfony/console/Command/Command. in /Users/andygrunwald/Development/chapi/src/Entity/Chronos/JobStatsEntity.php on line 28

Fatal error: Uncaught TypeError: Argument 1 passed to Chapi\Entity\Chronos\JobStatsEntity::__construct() must be of the type array, object given, called in /Users/andygrunwald/Development/chapi/src/Service/Chronos/JobStatsService.php on line 66 and defined in /Users/andygrunwald/Development/chapi/src/Entity/Chronos/JobStatsEntity.php on line 28

TypeError: Argument 1 passed to Chapi\Entity\Chronos\JobStatsEntity::__construct() must be of the type array, object given, called in /Users/andygrunwald/Development/chapi/src/Service/Chronos/JobStatsService.php on line 66 in /Users/andygrunwald/Development/chapi/src/Entity/Chronos/JobStatsEntity.php on line 28

Call Stack:
    0.0002     355120   1. {main}() /Users/andygrunwald/Development/chapi/bin/chapi:0
    0.0093    1669400   2. Symfony\Component\Console\Application->run() /Users/andygrunwald/Development/chapi/bin/chapi:12
    0.0113    1965832   3. Symfony\Component\Console\Application->doRun() /Users/andygrunwald/Development/chapi/vendor/symfony/console/Application.php:118
    0.0114    1965832   4. Symfony\Component\Console\Application->doRunCommand() /Users/andygrunwald/Development/chapi/vendor/symfony/console/Application.php:187
    0.0114    1965832   5. Symfony\Component\Console\Command\Command->run() /Users/andygrunwald/Development/chapi/vendor/symfony/console/Application.php:820
    0.0116    1968408   6. Chapi\Commands\AbstractCommand->execute() /Users/andygrunwald/Development/chapi/vendor/symfony/console/Command/Command.php:254
    0.0749    3038280   7. Chapi\Commands\SchedulingViewCommand->process() /Users/andygrunwald/Development/chapi/src/Commands/AbstractCommand.php:78
    0.1031    3999464   8. Chapi\Commands\SchedulingViewCommand->printTimeLineTable() /Users/andygrunwald/Development/chapi/src/Commands/SchedulingViewCommand.php:82
    0.3782    4846032   9. Chapi\Service\Chronos\JobStatsService->getJobStats() /Users/andygrunwald/Development/chapi/src/Commands/SchedulingViewCommand.php:111
    0.4640    4850128  10. Chapi\Entity\Chronos\JobStatsEntity->__construct() /Users/andygrunwald/Development/chapi/src/Service/Chronos/JobStatsService.php:66

Will try to write a unit test and fix it.

Misleading error message on malformed JSON

I had a job file with a missing "{" at the beginning.
The error message I got was

Argument 1 passed to "Chapi\Entity\Chronos\JobEntity::__construct" must be an array or object

It would be nice if this could be more descriptive and, if possible, point to the file/line producing the error.

Create a scheduling overview

Sometimes it's hard to manage upcoming chronos task and to select a good timeframe with less db impact and stuff like this. It would be nice to have a scheduling overview like this example:

JopABC    12.30---<===========12.45=======>-------13.00------
JobXYZ    12.30---------------12.45---<==>--------13.00---<==

Drop php 5.4 support

It's planed to drop the php 5.4 support to be able to update the external dependencies to the latest versions

Marathon: When `"servicePort": 0` is used in a Docker Container deployment, diff shows random allocated port

When you deploy a docker container as a marathon job with a "servicePort": 0 definition, a random allocated port (from Mesos) will assigned as a servicePort.
With the usage of marathon-lb this is fine, because your random service port will be mapped to a domain in marathon-lb.

When you launch a golang application (without a docker env) in the same way (with "servicePort": 0), the Expected Behavior is the case. There, everything is working.

Expected Behavior

When your job is deployed and you hit chapi status, your job is not our of sync and everything is fine

Changes to be committed
  (use 'chapi reset <job>...' to unstage)


Changes not staged for commit
  (use 'chapi add <job>...' to update what will be committed)
  (use 'chapi checkout <job>...' to discard changes in local repository)

  Updated jobs in local repository:

Current Behavior

When your job is deployed and you hit chapi status, your job always shows as "modified:

Changes to be committed
  (use 'chapi reset <job>...' to unstage)


Changes not staged for commit
  (use 'chapi add <job>...' to update what will be committed)
  (use 'chapi checkout <job>...' to discard changes in local repository)

  Updated jobs in local repository:
	modified marathon job:	/my-service/foo

When you hit chapi diff, the diff shows the random allocated service port as a difference:

$ chapi diff /my-service/foo

diff /my-service/foo
	...
	container:                   "protocol": "tcp",
+	container:                  "servicePort": 0,
-	container:                  "servicePort": 10021,
	container:                   "hostPort": 0,
	...

Possible Solution

Exclude container.docker.portMappings.*.servicePort from diff.

Steps to Reproduce (for bugs)

  1. Deploy a Docker Container with "servicePort": 0 on Marathon
  2. Hit chapi status, you should see your newly deployed job
  3. Hit chapi diff, you should see a diff in your servicePort with a random allocated port

Context

The more jobs you deploy in this way, the more "out of sync" jobs appear.
When we apply an automated check on this, this would always be red / out of sync.

Your Environment

  • Chapi version: master (rev: a171472)
  • PHP version: PHP 7.0.21 (cli) (built: Jul 29 2017 09:17:51) ( NTS )
  • Operating System and version: macOS Sierra 10.12.6 (16G29)
  • Mesos version: 1.1.0
  • Marathon version: 1.4.1
  • Chronos version: 2.4.0
{
  "id": "/my-service/foo",
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "org/container:v1.0",
      "network": "BRIDGE",
      "portMappings": [
        {
          "containerPort": 8080,
          "hostPort": 0,
          "servicePort": 0,
          "protocol": "tcp"
        }
      ]
    }
  },
  "labels": {
    "HAPROXY_GROUP": "internal",
    "HAPROXY_0_VHOST": "my-domain.mesos-stage.trivago.trv",
  },
  "cpus": 1,
  "mem": 512,
  "instances": 1
}

Ignore order of environment variables for Marathon jobs

When showing diffs for Marathon jobs, chapi will show changes in the order of the environment variables, even when nothing about the configuration itself changed. As this seems to be a problem just concerning ordering in the diff and visualization, I think it would be an improvement to have chapi ignore those changes.

check dependencies for non scheduled jobs

Add a validation for dependency jobs:

  • check if the parent job(s) exists
  • check if the parent job(s) are in the current commit index
  • check for api request order for dependency jobs

Support wildcard in diff commands

Wildcards for identifier would be great:

➜  chapi git:(master) bin/chapi diff hotelmanager-campaignmanager-*
zsh: no matches found: hotelmanager-campaignmanager-*

Fix entity handling for multidimensional settings like "uris" and "environmentVariables"

We runned into an issue with the settings for "uris" and "environmentVariables".
The current method getSimpleArrayCopy() for comparison didn't support more than one level.

{
    "name" : "foo",
    "command" : "bar",
    "schedule" : "R/2016-03-15T11:15:00Z/P1D",
    "description" : "foo bar",
    "scheduleTimeZone":"Europe/Berlin",
    "epsilon" : "PT5M",
    "owner" : "[email protected]",
    "ownerName" : "Paul",
    "async" : false,
    "executor" : "",
    "disabled" : false,
    "softError" : false,
    "cpus" : 0.2,
    "mem" : "128",
    "disk" : "24",
    "highPriority" : false,
    "retries" : 0,
    "uris" : ["http://a.url.com"],
    "environmentVariables" : [
        {
          "name" : "FOO",
          "value" : "bar"
        }
    ]
}

fix scheduling comparison for running jobs

If a job currently running on chronos the DatePeriod comparison for scheduling jobs doesn't work correctly. The jobs will detect as not equal and displayed in diff and status view.

validator don't detect wrong scheduling / parents settings

The current validator for chronos jobs don't detect issues like this:

{
  "schedule":"R/2017-03-17T08:52:00Z/P1D",
  "scheduleTimeZone":"Europe/Berlin",
  "epsilon":"PT15M",
  "name":"job-name-a",
  "command":"echo jobA",
  "description":"",
  "owner":"",
  "ownerName":"",
  "parents": [
      "job-name-b"
  ],
  "async":false,
  "executor":"",
  "disabled":false,
  "softError":false,
  "cpus":"0.1",
  "mem":"32",
  "disk":"24",
  "highPriority":false,
  "retries": 0
}

Chapi requires both marathon and chronos configs to be present

Chapi assumes that the configuration always contains both a marathon and a chronos service. This causes at least two problems in practice:

  • It's impossible to set up chapi in an environment where you only have one but not the other

  • Even in an environment where both frameworks are used, you may have situations where you'd want to only address one of them. Chapi doesn't provide any command line arguments to select just one.

Setting the config variables to null like README.md suggests worked at some point but doesn't anymore.

I would generalize the configuration mechanism a bit to overcome these problems.

Example configuration:

profiles:
  # Profile for addressing marathon only
  acme-prod-marathon:
    services:
      - framework: marathon
        url: http://marathon.acme.com:8080/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/marathon-jobs"
        
  # Profile for addressing chronos only
  acme-prod-chronos:
    services:
      - framework: chronos-2.0
        url: http://chronos.acme.com:4400/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/chronos-jobs"

  # Profile for addressing both simultaneusly
  acme-prod:
    services:
      - framework: marathon
        url: http://marathon.acme.com:8080/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/marathon-jobs"
      - framework: chronos-2.0
        url: http://chronos.acme.com:4400/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/chronos-jobs"

  # For ease of maintenance, a simple include mechanism could 
  # make the above definition shorter:
  acme-prod:
    services:
      - include: acme-prod-chronos
      - include: acme-prod-marathon

  # With the assumption gone that there are always exactly one marathon
  # and chronos service, we could support a fictional use case like:
  acme-farm:
    services:
      - framework: marathon
        url: http://marathon-ber.acme.com:8080/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/marathon-jobs"
        ignore:
          - "!*-ber"
      - framework: marathon
        url: http://marathon-lon.acme.com:8080/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/marathon-jobs"
        ignore:
          - "!*-lon"
      - framework: marathon
        url: http://marathon-nyc.acme.com:8080/
        http_username: acme
        http_password: acme123
        repository_dir: "/Users/jsmith/src/marathon-jobs"
        ignore:
          - "!*-nyc"

With this pattern, you could simply pass a profile name on the command line to select the environment(s) you want chapi to target.

Also it would be possible to add support for other mesos frameworks (or multiple flavors / versions of current the frameworks), hence "chronos-2.0" in the example. ("Framework" might not be the best wording for this though, since its's a Mesos-specific term, unless we intend chapi to manage Mesos-based services only)

Marathon: Provide command to clean empty groups

When you deploy services on Marathon and kill them later, the namespace / group will stay.
If no app will be deployed in this group later on, this group will stay empty forever.

See

screen shot 2017-11-22 at 09 37 24

Current Behavior

After time your Marathon instance will have several empty groups in the UI / API.

Possible Solution

Provide Framework (Marathon / Chronos) specific commands.
For this request it would be the /v2/groups/{group_id}/ DELETE command descibed in https://mesosphere.github.io/marathon/api-console/index.html

So the descriptive workflow would be

  • Get all groups from the server
  • Check if they are empty
  • When they are empty, delete the group

Steps to Reproduce (for bugs)

  1. Deploy a service on Marathon with ID /foo/my-service
  2. Delete the service from marathon
  3. The empty group /foo will stay

Your Environment

  • Chapi version: master (Rev: c683314)
  • PHP version: v7.1.11
  • Operating System and version: Mac OSx
  • Mesos version: v1.1.0
  • Marathon version: v 1.4.1
  • Chronos version: -

Add a unique job name validation

Currently chapi don't recognize that a job name is already used in another job file. In the end one job definition overwrite the other one. We need some kind of validation for unique job names.

Enable Marathon support in Chapi

Since most of the configuration on chronos is pretty similar to marathon, it would make sense to use the similar components for both systems. Then, the configuration, validation and push the configuration to marathon would be simple as well.

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.