anystack-sh / porter Goto Github PK
View Code? Open in Web Editor NEWSpin up your development background processes with ease ๐ช
Home Page: https://anystack.sh/tools/porter
Spin up your development background processes with ease ๐ช
Home Page: https://anystack.sh/tools/porter
I would imagine porter add
to add a new service to the configuration. For me porter init
feels better.
Hello!
I followed the instructions in the docs:
porter init
porter.yaml
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
.
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.
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
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.
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:
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.
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
Then I wanted to see the porter status
So I thought okay - lets stop it then...
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
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:
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
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' |
+----------------+--------------------------------------+---------+-----------------------------------+
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
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?
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
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.
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?
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]
When you run porter remove
it asks which service to restart instead of to remove:
Which service would you like to restart?:
[0] all
[1] foo:bar
> 1
Restarting foo:bar: โ
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.