Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/stacks/lepp-stack/devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"rm -rf .devbox/virtenv/postgresql/data",
"initdb",
"devbox services up -b",
"echo 'sleep 2 second for the postgres server to initialize.' && sleep 2",
"echo 'sleep 2 seconds for the postgres server to initialize.' && sleep 2",
"dropdb --if-exists devbox_lepp",
"createdb devbox_lepp",
"psql devbox_lepp < setup_postgres_db.sql",
Expand Down
5 changes: 2 additions & 3 deletions internal/devbox/devbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@ import (
const (

// shellHistoryFile keeps the history of commands invoked inside devbox shell
shellHistoryFile = ".devbox/shell_history"
processComposeTargetVersion = "v1.5.0"
arbitraryCmdFilename = ".cmd"
shellHistoryFile = ".devbox/shell_history"
arbitraryCmdFilename = ".cmd"
)

type Devbox struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/devbox/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"go.jetify.com/devbox/internal/xdg"
)

const processComposeVersion = "1.64.1"
const processComposeVersion = "1.87.0"

var utilProjectConfigPath string

Expand Down
8 changes: 4 additions & 4 deletions plugins/postgresql/process-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ version: "0.5"

processes:
postgresql:
command: "pg_ctl start -o \"-k '$PGHOST' ${PGPORT:+-p '$PGPORT'}\""
is_daemon: true
shutdown:
command: "sh -c 'exec postgres -k \"$PGHOST\" -p \"${PGPORT:-5432}\"'"
is_daemon: false
shutdown:
Comment on lines -5 to +7
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change cc @mohsenari

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like process-compose fixed a bug with how it manages daemons. As a result our postgresql plugin now restarts continuously (because it's not actually forking and exiting like a daemon) and it never exposes a port.

So we just stop treating it like a daemon and run it in foreground mode. it gets it's own shell anyways, so it doesn't interfere with the user's devbox shell + it's easier to manage

command: "pg_ctl stop -m fast"
availability:
restart: "always"
readiness_probe:
exec:
command: "pg_isready ${PGPORT:+-p '$PGPORT'}"
command: "pg_isready -p \"${PGPORT:-5432}\""
6 changes: 3 additions & 3 deletions testscripts/add/add_platforms_flakeref.test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ exec devbox install

# aside: choose armv7l-linux to verify that the add actually works on the
# current host that is unlikely to be armv7l-linux
exec devbox add github:F1bonacc1/process-compose/v0.40.2 --exclude-platform armv7l-linux
exec devbox add github:F1bonacc1/process-compose/v1.87.0 --exclude-platform armv7l-linux
json.superset devbox.json expected_devbox1.json

# verify that the package is installed on this platform
exec devbox run -- process-compose version
stdout '0.40.2'
stdout '1.87.0'

-- devbox.json --
{
Expand All @@ -24,7 +24,7 @@ stdout '0.40.2'
"packages": {
"hello": "",
"cowsay": "latest",
"github:F1bonacc1/process-compose/v0.40.2": {
"github:F1bonacc1/process-compose/v1.87.0": {
"excluded_platforms": ["armv7l-linux"]
}
}
Expand Down
Loading