Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add flight-sql support #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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: 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
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@smrz2001 Do we need to change some tailscale config to expose this port?

NETWORK=testnet-clay
STAGE=tnet
Loading