Coder Social home page Coder Social logo

anystack-sh / porter Goto Github PK

View Code? Open in Web Editor NEW
525.0 4.0 11.0 34.47 MB

Spin up your development background processes with ease ๐Ÿช„

Home Page: https://anystack.sh/tools/porter

PHP 99.50% JavaScript 0.50%
development-tools php background-service development-workflow laravel laravel-package productivity supervisor

porter's People

Contributors

benqoder avatar dpslwk avatar faissaloux avatar olumby avatar philonl avatar robertbaelde avatar squatto 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

porter's Issues

Supervisord config not found

Hello!

I followed the instructions in the docs:

  1. Installed software
  2. Executed porter init
  3. Modified porter.yaml
  4. Executed porter add

and then I received the following error:

$ porter add
Adding <path>/porter.yml: โœ”

 Porter must be running to use this command. Do you want to start Porter? (yes/no) [yes]:
 > y

Error: could not find config file /home/<username>/.porter/supervisord.conf
For help, use /usr/bin/supervisord -h

In SupervisordRepository.php line 171:

  [App\Exceptions\SupervisordConnectionRefusedException]

However, I checked and the supervisor config did exist, I tried removing it according to #8, but I still couldn't get porter to start until I executed porter start.

Status indicator

Not a bug, but it would be nice to have some sort of "status indicator" that shows that Porter is currently running. Essentially what you have when you run php artisan schedule:work, so you have an open process and know right away when the terminal is open.

Right now, I don't know if Porter is running or not.

Porter cannot start services, thinks they are already running

I'm having an issue where the services aren't running, Porter thinks they aren't running, but then can't start them because it thinks they are running.

manavo@MacBook-Pro ~ % porter status

 Porter must be running to use this command. Do you want to start Porter? (yes/no) [yes]:
 > yes


In SupervisordRepository.php line 120:
                                 
  Services are already running.  

Not sure if there are any other debug things that would be useful? In the ~/.porter directory this is what I see:

manavo@MacBook-Pro .porter % ls -la
total 56
drwx------   9 manavo  staff   288 12 Jun 14:32 .
drwxr-xr-x+ 76 manavo  staff  2432  6 Jul 16:07 ..
-rw-r--r--   1 manavo  staff    95 26 May 10:39 apps.json
-rw-r--r--   1 manavo  staff   213 26 May 10:33 file-watcher.js
drwx------   2 manavo  staff    64 28 Jun 11:51 logs
srwx------   1 manavo  staff     0 12 Jun 14:32 supervisor.sock
-rw-r--r--   1 manavo  staff  2695  6 Jul 16:08 supervisord.conf
-rw-r--r--   1 manavo  staff  8902 18 Jun 13:41 supervisord.log
-rw-r--r--   1 manavo  staff     6 12 Jun 14:32 supervisord.pid

Not sure if maybe a pid/sock file is somehow leftover, and it's confusing things thinking they are running?

Last note, this is using Porter v0.0.11

porter can not stop or start!

when I write the command: porter stop it is still in this situation:

Stopping services: loading...

and when I write porter status I get the prompt:

 Porter must be running to use this command. Do you want to start Porter? (yes/no) [yes]:

after I write yes, I get this

In SupervisordRepository.php line 120:
                                 
  Services are already running.  
                                 

`porter add` fails if `porter start` hasn't been run.

Hey! I love the idea of this project - great work!

I'm on Fedora Linux and when following the instructions in the README, I got the following error:

image

If I run porter start then everything works fine.

While this could just be documented, I think it would be nicer if RestartCommand would try to start the server if it's not currently running.

Worked for 1 day... Can't start porter anymore

Hi there,

maybe you can point me in the right direction to make porter work again.

I navigated to my directory and tried to start porter which didn't work anymore

Screenshot 2022-12-31 at 5 06 33 AM

Then I wanted to see the porter status

Screenshot 2022-12-31 at 5 07 55 AM

So I thought okay - lets stop it then...

Screenshot 2022-12-31 at 5 08 51 AM

But this process never finishes...

I tried to kill supervisor in the terminal as well...

uninstall & installed supervisor again using homebrew

tried to restart my Mac...

I'm using Laravel Valet and DBingin and the latest version of porter

my yml file looks like this

Screenshot 2022-12-31 at 5 11 49 AM

Fresh Install error syntax error, unexpected token ")" in builds/porter/vendor/symfony/finder/Finder.php on line 636

I've just tried to install Porter and encountered a couple of problems. I tried it on both my laptop and desktop in case it was a system/configuration problem but I have the same problem on both.

I tried version 0.0.5 and 0.0.4 of Porter, just in case.

Desktop:

  • Ubuntu 20.0.4 (Running as WSL on Windows 10)
  • Composer 2.5.1
  • PHP: 8.0.5
    Laptop:
  • Ubuntu 20.0.4 (Running as WSL on Windows 11)
  • Composer version: 2.3.5
  • PHP: 8.0.26

Installation looks good:

$ composer global require anystack-sh/porter
Changed current directory to /home/sami/.config/composer
Info from https://repo.packagist.org: #StandWithUkraine
Using version ^0.0.5 for anystack-sh/porter
./composer.json has been created
Running composer update anystack-sh/porter
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking anystack-sh/porter (v0.0.5)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading anystack-sh/porter (v0.0.5)
  - Installing anystack-sh/porter (v0.0.5): Extracting archive
Generating autoload files
$ 

When I run porter I get a syntax error:

$ porter
PHP Parse error:  syntax error, unexpected token ")" in phar:///home/sami/.config/composer/vendor/anystack-sh/porter/builds/porter/vendor/symfony/finder/Finder.php on line 636

I tried adding some Vs and got a bit more info:

$ porter -vv

Box Requirements Checker
========================

> Using PHP 8.0.25
> PHP is using the following php.ini file:
  /etc/php/8.0/cli/php.ini

> Checking Box requirements:
  ..

 [OK] Your system is ready to run the application.

PHP Parse error:  syntax error, unexpected token ")" in phar:///home/sami/.config/composer/vendor/anystack-sh/porter/builds/porter/vendor/symfony/finder/Finder.php on line 636

Environment variables?

Is it possible to set env variables? My yml looks like this:

services:
 - name: Router
   command: "SANDBOX=true ./router -c router.yaml -s supergraph.graphql"

But I get the error:

โžœ porter status
+----------------+--------------------------------------+---------+-----------------------------------+
| App            | Process                              | Status  | Description                       |
+----------------+--------------------------------------+---------+-----------------------------------+
| example        | example-router                       | BACKOFF | can't find command 'SANDBOX=true' |
+----------------+--------------------------------------+---------+-----------------------------------+

Can't get it to work

I can't seem to start it successfully.
It always says Fatal or Failed and there's no useful information in the log files

image

PHP Parse error: syntax error, unexpected token ")"

I get an error whenever I try to run porter:

$ porter
PHP Parse error:  syntax error, unexpected token ")" in phar:///home/ubuntu/.config/composer/vendor/anystack-sh/porter/builds/porter/vendor/symfony/finder/Finder.php on line 636

I can't start services

When i try to start porter, it throws that Services are already running, but it's not true:

Starting services: failed
Services are already running.

If i try "porter stop" it takes infinite time but it doesnt stop with this message

Stopping services: loading...

My porter.yml its this

services:
  - name: Queue
    command: php artisan horizon
    restart:
      watch:
        - app/Jobs

  - name: Schedule
    command: php artisan schedule:work

  - name: Valet
    command: valet share --region=eu --hostname=gbp.eu.ngrok.io

Any suggestions?

Porter watch uses 100% CPU

The watch command is using a full CPU core, looks like there is a tight while loop with no sleep or blocking call inside

$porter status --all
+-----------------+--------------------------+---------+---------------------------+
| App             | Process                  | Status  | Description               |
+-----------------+--------------------------+---------+---------------------------+
| cryptodash      | cryptodash-horizon       | RUNNING | pid 37619, uptime 0:01:47 |
| cryptodash      | cryptodash-mix           | RUNNING | pid 37620, uptime 0:01:47 |
| cryptodash      | cryptodash-schedule      | RUNNING | pid 37621, uptime 0:01:47 |
| porter          | scheduler                | RUNNING | pid 37622, uptime 0:01:47 |
| porter          | watcher                  | RUNNING | pid 37623, uptime 0:01:47 |
+-----------------+--------------------------+---------+---------------------------+

form top

PID    COMMAND      %CPU TIME     #TH    #WQ  #PORTS MEM    PURG   CMPRS PGRP  PPID  STATE
37623  php          99.3 02:52.48 1/1    0    15     37M    0B     0B    37623 37607 running

Tail command adds extra blank lines

When running an npm script, I get an extra blank line after each line of output.
I don't have time to test it myself right now, but I would guess you could just replace $this->line($line) with $this->getOutput()->write($line) which doesn't add any newline characters.

WSL does not has supervisor

Hey,

this library looks great. However, my WSL2 does not have supervisor installed and I couldn't make it running. Is there any other way to run this project?

Porter watch won't work

Hello,

I installed chokidar globally per the docs, however, executing the porter watch command yields the following error:

Watcher process has terminated. Please ensure Node and chokidar are installed.

Executing npm list -g shows I have chokidar installed:

$ npm list -g
/usr/lib
โ”œโ”€โ”€ @johnnymorganz/[email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ”œโ”€โ”€ [email protected]
โ””โ”€โ”€ [email protected]

Stop individual services

Much the same way we can restart specific services, can we have a way to stop them?

Use case: I have a bunch of different services running that my API connects to. I need to debug one of them by stopping it individually (to see if the issue is with the API or the service), but I'm currently forced to stop everything, and then start the things I need to test outside of porter.

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.