Skip to content

Commit

Permalink
hornbill: modify startup commands (#31)
Browse files Browse the repository at this point in the history
* hornbill: modify startup commands

* ci: upgrade upload-artifact to v4
  • Loading branch information
Commelina authored Nov 5, 2024
1 parent 41a07b6 commit 6a30359
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
./scripts/clean_legacy.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: legacy-result
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
./scripts/clean_kafka.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: kafka-result
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
./scripts/clean_hornbill.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: hornbill-result
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci_repo_dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
./scripts/clean_legacy.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: legacy-result
Expand Down Expand Up @@ -101,7 +101,7 @@ jobs:
./scripts/clean_kafka.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: kafka-result
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_repo_dispatch_hornbill.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
./scripts/clean_hornbill.sh
- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ success() }} || ${{ failure() }}
with:
name: hornbill-result
Expand Down
15 changes: 8 additions & 7 deletions docker/meta-hornbill/start-meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ while ! fdbcli -C /etc/fdb.cluster --exec "tenant get hstream" --timeout 1 ; do
sleep 1;
done

/usr/local/bin/hstream-meta-server --host 0.0.0.0 \
--port 8964 \
--log-level trace \
--log-with-color \
--log-flush-immediately \
--backend /etc/fdb.cluster \
>> /tmp/$HOSTNAME.log 2>&1
/usr/local/bin/hornbill meta \
--host 0.0.0.0 \
--port 8964 \
--log-level trace \
--log-with-color \
--log-flush-immediately \
--backend /etc/fdb.cluster \
>> /tmp/$HOSTNAME.log 2>&1
2 changes: 1 addition & 1 deletion docker/node-hornbill/start-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ done

SERVER_ID=$(echo $(hostname) | cut -c 2-) # n_i -> i
MY_IP=$(hostname -I | head -n1 | awk '{print $1;}')
/usr/local/bin/hstream-server \
/usr/local/bin/hornbill server \
--bind-address 0.0.0.0 \
--port 9092 \
--metrics-port 6600 \
Expand Down
29 changes: 19 additions & 10 deletions src/jepsen/hstream/kafka/db/hornbill.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
[jepsen.control :as c]
[jepsen.control.util :as cu]
[jepsen.hstream.kafka.db :as redpanda.db]
[jepsen.hstream.common.utils :refer [parse-int]]
[jepsen.hstream.legacy.nemesis :as legacy-nemesis]))
[jepsen.hstream.common.utils :refer [parse-int]]))

(def hornbill
"Program that launches hornbill server.
WARNING: This module refers to jepsen.hstream.legacy.nemesis,
which hardcodes the server name as 'hstream-server'."
"/usr/local/bin/hstream-server")
"Program that launches hornbill server."
"/usr/local/bin/hornbill")

(def node-ips
{:n1 "172.20.0.11"
Expand All @@ -34,7 +31,8 @@
(defn f-hornbill-args
"Generate the arguments for hornbill server."
[node]
[:--bind-address "0.0.0.0"
[:server
:--bind-address "0.0.0.0"
:--port 9092
:--metrics-port 6600
:--advertised-address (node-ips (keyword node))
Expand All @@ -45,6 +43,18 @@
:--log-with-color
])

;; FIXME: move to a standalone module to support hornbill nemesis
(defn is-hornbill-server-on-node-dead?
[node]
(try+
(let [shell-out (c/on node
(c/exec* "pgrep" "-f" "hornbill server" "||" "true"))]
(empty? shell-out))
(catch Object _
(info "Failed to check death on" node ":" (:message &throw-context)
"I think it is already dead.")
true)))

(defn db
"Hornbill for a particular version. No action is executed after the DB is ready."
[version tcpdump]
Expand All @@ -65,11 +75,10 @@
;; WARNING: Starting hstream server is not idempotent now.
;; However, the test usually call [:start :all].
;; So we have to check if the server is already running.
;; FIXME: The checking function 'is-hserver-on-node-dead?' is not
;; FIXME: The checking function 'is-hornbill-server-on-node-dead?' is not
;; well implemented...
;; FIXME: Remove dependency on legacy-nemesis
(start! [this test node]
(if (legacy-nemesis/is-hserver-on-node-dead? node)
(if (is-hornbill-server-on-node-dead? node)
(c/su
(apply (partial cu/start-daemon!
{:logfile (f-hornbill-log-file node)
Expand Down

0 comments on commit 6a30359

Please sign in to comment.