unoverse 0.1.146 → 0.1.148

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,3 +17,12 @@ become = True
17
17
  become_method = sudo
18
18
  become_user = root
19
19
  become_ask_pass = False
20
+
21
+ [ssh_connection]
22
+ # A transient TCP timeout must not kill a deploy: a single dropped SYN to a busy
23
+ # or far-away VM read as UNREACHABLE on the very first task. Retry the connect
24
+ # (ConnectionAttempts) and the connection (retries) before declaring the host gone.
25
+ # The -C/ControlMaster/ControlPersist flags are ansible's defaults, restated
26
+ # because ssh_args REPLACES them rather than appending.
27
+ ssh_args = -C -o ControlMaster=auto -o ControlPersist=60s -o ConnectionAttempts=5 -o ConnectTimeout=15 -o ServerAliveInterval=15 -o ServerAliveCountMax=4
28
+ retries = 3
@@ -77,6 +77,35 @@
77
77
  docker compose up -d 2>&1 | tail -6
78
78
  register: up_result
79
79
 
80
+ # `up -d` RECREATES ON CONFIG CHANGE, NOT ON IMAGE CHANGE — not reliably, and not on
81
+ # every compose version. On a live ground it moved every service to the new images
82
+ # except one: umap's new image was pulled and sitting on disk while the container kept
83
+ # running the old one, twice across two deploys, and the only symptom was a model bug
84
+ # that had already been fixed. So the deploy verifies its own work: any service whose
85
+ # running container is not on the image its tag now points to is recreated by name.
86
+ - name: "[3b/4] Recreate services the restart left on an old image"
87
+ shell: |
88
+ cd {{ gravity_dir }}
89
+ stale=""
90
+ for c in $(docker compose ps -q); do
91
+ running=$(docker inspect --format '{{ '{{' }}.Image{{ '}}' }}' "$c")
92
+ tag=$(docker inspect --format '{{ '{{' }}.Config.Image{{ '}}' }}' "$c")
93
+ current=$(docker image inspect --format '{{ '{{' }}.Id{{ '}}' }}' "$tag" 2>/dev/null || true)
94
+ svc=$(docker inspect --format '{{ '{{' }}index .Config.Labels "com.docker.compose.service"{{ '}}' }}' "$c")
95
+ [ -n "$current" ] && [ "$running" != "$current" ] && stale="$stale $svc"
96
+ done
97
+ if [ -n "$stale" ]; then
98
+ echo "stale:$stale"
99
+ docker compose up -d --force-recreate $stale 2>&1 | tail -6
100
+ else
101
+ echo "every service is on the image its tag points to"
102
+ fi
103
+ register: recreate_result
104
+
105
+ - name: "[3b/4] Recreate output"
106
+ debug:
107
+ msg: "{{ recreate_result.stdout_lines | default(['done']) }}"
108
+
80
109
  - name: "[4/4] Service status"
81
110
  shell: |
82
111
  cd {{ gravity_dir }}
@@ -819,8 +819,20 @@ EOF
819
819
  # never been migrated, and reported success. The stamp is written only after install,
820
820
  # database and verify have all passed, so an interrupted setup resumes as a setup.
821
821
  if [ -z "$subcommand" ]; then
822
- if ! ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 \
823
- "$deploy_user@$deploy_host" 'test -f /opt/gravity/.setup-complete' >/dev/null 2>&1; then
822
+ # "COULD NOT ASK" IS NOT "NOT SET UP". ssh exits 255 on a connection failure and
823
+ # with the remote command's status otherwise — and a transient timeout here once
824
+ # reclassified a healthy, deployed server as first-time, pointing a full install at
825
+ # it. Retry the connect, and if the host still cannot be reached, stop and say so
826
+ # rather than guessing what it is.
827
+ local stamp_probe=0
828
+ ssh -o BatchMode=yes -o StrictHostKeyChecking=accept-new -o ConnectTimeout=15 \
829
+ -o ConnectionAttempts=5 \
830
+ "$deploy_user@$deploy_host" 'test -f /opt/gravity/.setup-complete' >/dev/null 2>&1 || stamp_probe=$?
831
+ if [ "$stamp_probe" -eq 255 ]; then
832
+ rm -f "$tmp_inventory"
833
+ fail "Cannot reach $deploy_user@$deploy_host over SSH (tried 5 times). Check the network / security-group admin rule, then: unoverse deploy $cloud"
834
+ exit 1
835
+ elif [ "$stamp_probe" -ne 0 ]; then
824
836
  echo ""
825
837
  info "This server's setup has not finished. Running it ${DIM}(install, database, verify)${NC}"
826
838
  subcommand="first-time"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.146",
3
+ "version": "0.1.148",
4
4
  "description": "The Unoverse front door — create a Studio project, a universe, or a client app, and launch Studio.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "type": "module",