Skip to content

Commit

Permalink
feat: add flight-sql support
Browse files Browse the repository at this point in the history
Enables flight sql for the experimental-rust network and updates envs
with info about where flight-sql can be found.
  • Loading branch information
nathanielc committed Dec 20, 2024
1 parent e069a09 commit 18427cd
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions hermetic/src/cli/process-peers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ until [ "$n" -ge 30 ];
mkdir /config/env

CERAMIC_URLS=$(jq -j '[.[].ceramic.ipfsRpcAddr | select(.)] | join(",")' < /peers/peers.json)
CERAMIC_FLIGHT_URLS=$(jq -j '[.[].ceramic.flightAddr | select(.)] | join(",")' < /peers/peers.json)
COMPOSEDB_URLS=$(jq -j '[.[].ceramic.ceramicAddr | select(.)] | join(",")' < /peers/peers.json)

# Set up the env var with admin DID seeds to be a comma separated list with the same secret
Expand All @@ -31,6 +32,7 @@ until [ "$n" -ge 30 ];
done

echo "CERAMIC_URLS=$CERAMIC_URLS" > /config/.env
echo "CERAMIC_FLIGHT_URLS=$CERAMIC_FLIGHT_URLS" >> /config/.env
echo "COMPOSEDB_URLS=$COMPOSEDB_URLS" >> /config/.env
echo "COMPOSEDB_ADMIN_DID_SEEDS=$COMPOSEDB_ADMIN_DID_SEEDS" >> /config/.env

Expand Down
3 changes: 3 additions & 0 deletions networks/experimental-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ spec:
CERAMIC_ONE_REMOTE_ANCHOR_SERVICE_URL: "http://cas:8081"
CERAMIC_ONE_ANCHOR_INTERVAL: 1
CERAMIC_ONE_ANCHOR_POLL_INTERVAL: 5
CERAMIC_ONE_FLIGHT_SQL_BIND_ADDRESS: "http://localhost:5102"
CERAMIC_ONE_AGGREGATOR: "true"
CERAMIC_ONE_OBJECT_STORE_URL: "file://./pipeline"
resourceLimits:
cpu: "4"
memory: "1Gi"
Expand Down
8 changes: 7 additions & 1 deletion port-forward.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,44 @@ fi

composedb=7007
ceramic=5101
flight=5102
offset=1
step=1

admin_private_key=$(kubectl $namespace_flag get secret ceramic-admin -o jsonpath="{.data['private-key']}" | base64 -d )

COMPOSEDB_URLS=''
CERAMIC_URLS=''
CERAMIC_FLIGHT_URLS=''
COMPOSEDB_ADMIN_DID_SEEDS=''

for pod in $(kubectl $namespace_flag get pods -l app=ceramic -o json | jq -r '.items[].metadata.name')
do
composedb_local=$((composedb + offset))
ceramic_local=$((ceramic + offset))
flight_local=$((flight + offset))

if [ $offset != 1 ]
then
COMPOSEDB_URLS="$COMPOSEDB_URLS,"
CERAMIC_URLS="$CERAMIC_URLS,"
CERAMIC_FLIGHT_URLS="$CERAMIC_FLIGHT_URLS,"
COMPOSEDB_ADMIN_DID_SEEDS="$COMPOSEDB_ADMIN_DID_SEEDS,"
fi


COMPOSEDB_URLS="${COMPOSEDB_URLS}http://localhost:$composedb_local"
CERAMIC_URLS="${CERAMIC_URLS}http://localhost:$ceramic_local"
CERAMIC_FLIGHT_URLS="${CERAMIC_FLIGHT_URLS}http://localhost:$flight_local"
COMPOSEDB_ADMIN_DID_SEEDS="${COMPOSEDB_ADMIN_DID_SEEDS}${admin_private_key}"

kubectl port-forward $namespace_flag "$pod" $composedb_local:$composedb $ceramic_local:$ceramic >/dev/null &
kubectl port-forward $namespace_flag "$pod" $composedb_local:$composedb $ceramic_local:$ceramic $flight_local:$flight >/dev/null &

offset=$((offset + step))
done


export COMPOSEDB_URLS
export CERAMIC_URLS
export CERAMIC_FLIGHT_URLS
export COMPOSEDB_ADMIN_DID_SEEDS
1 change: 1 addition & 0 deletions suite/env/.env.dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ANCHOR_INTERVAL_MIN=780
COMPOSEDB_URLS=http://keramik-ceramic-v4-dev-tailscale-0-0:7007,http://keramik-ceramic-v4-dev-tailscale-0-1:7007
CERAMIC_URLS=http://keramik-ceramic-v4-dev-tailscale-0-0:5101,http://keramik-ceramic-v4-dev-tailscale-0-1:5101
CERAMIC_FLIGHT_URLS=http://keramik-ceramic-v4-dev-tailscale-0-0:5102,http://keramik-ceramic-v4-dev-tailscale-0-1:5102
NETWORK=dev-unstable
STAGE=dev
1 change: 1 addition & 0 deletions suite/env/.env.prod
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ANCHOR_INTERVAL_MIN=1440
COMPOSEDB_URLS=http://keramik-ceramic-v4-prod-tailscale-0-0:7007,http://keramik-ceramic-v4-prod-tailscale-0-1:7007
CERAMIC_URLS=http://keramik-ceramic-v4-prod-tailscale-0-0:5101,http://keramik-ceramic-v4-prod-tailscale-0-1:5101
CERAMIC_FLIGHT_URLS=http://keramik-ceramic-v4-prod-tailscale-0-0:5102,http://keramik-ceramic-v4-prod-tailscale-0-1:5102
NETWORK=mainnet
STAGE=prod
1 change: 1 addition & 0 deletions suite/env/.env.qa
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ANCHOR_INTERVAL_MIN=780
COMPOSEDB_URLS=http://keramik-ceramic-v4-qa-tailscale-0-0:7007,http://keramik-ceramic-v4-qa-tailscale-0-1:7007
CERAMIC_URLS=http://keramik-ceramic-v4-qa-tailscale-0-0:5101,http://keramik-ceramic-v4-qa-tailscale-0-1:5101
CERAMIC_FLIGHT_URLS=http://keramik-ceramic-v4-qa-tailscale-0-0:5102,http://keramik-ceramic-v4-qa-tailscale-0-1:5102
NETWORK=dev-unstable
STAGE=qa
1 change: 1 addition & 0 deletions suite/env/.env.tnet
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ANCHOR_INTERVAL_MIN=1440
COMPOSEDB_URLS=http://keramik-ceramic-v4-tnet-tailscale-0-0:7007,http://keramik-ceramic-v4-tnet-tailscale-0-1:7007
CERAMIC_URLS=http://keramik-ceramic-v4-tnet-tailscale-0-0:5101,http://keramik-ceramic-v4-tnet-tailscale-0-1:5101
CERAMIC_FLIGHT_URLS=http://keramik-ceramic-v4-tnet-tailscale-0-0:5102,http://keramik-ceramic-v4-tnet-tailscale-0-1:5102
NETWORK=testnet-clay
STAGE=tnet

0 comments on commit 18427cd

Please sign in to comment.