-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f2ec038
commit b5d3547
Showing
31 changed files
with
1,248 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/services/cluster/src/workflows/server/install/install_scripts/components/fdb.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use chirp_workflow::prelude::*; | ||
|
||
pub fn install(initialize_immediately: bool) -> String { | ||
let mut script = include_str!("../files/fdb_install.sh").replace( | ||
"__PROMETHEUS_PROXY_SCRIPT__", | ||
include_str!("../files/fdp_prometheus_proxy.py"), | ||
); | ||
|
||
if initialize_immediately { | ||
// Run script immediately | ||
script.push_str("systemctl start --no-block fdb_prometheus_proxy.service"); | ||
} | ||
|
||
script | ||
} | ||
|
||
pub fn configure() -> String { | ||
include_str!("../files/fdb_configure.sh").to_string() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...ages/services/cluster/src/workflows/server/install/install_scripts/files/fdb_configure.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Append config | ||
# cat << 'EOF' >> /etc/foundationdb/foundationdb.conf | ||
# [fdbserver] | ||
# EOF | ||
|
||
# TODO: add -t flag for TLS (https://apple.github.io/foundationdb/tls.html#enable-tls) | ||
# Make fdb accessible on VLAN | ||
python3 /usr/lib/foundationdb/make_public.py -a ___VLAN_IP___ |
50 changes: 50 additions & 0 deletions
50
packages/services/cluster/src/workflows/server/install/install_scripts/files/fdb_install.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
sysctl --system | ||
|
||
mkdir -p /etc/foundationdb | ||
|
||
curl -Lf -o /tmp/foundationdb-clients_OFF-1_amd64.deb "https://github.com/apple/foundationdb/releases/download/7.3.43/foundationdb-clients_7.3.43-1_amd64.deb" | ||
dpkg -i /tmp/foundationdb-clients_OFF-1_amd64.deb | ||
|
||
# Verify installation | ||
fdbcli --version | ||
|
||
curl -Lf -o /tmp/foundationdb-server_OFF-1_amd64.deb "https://github.com/apple/foundationdb/releases/download/7.3.43/foundationdb-server_7.3.43-1_amd64.deb" | ||
dpkg -i /tmp/foundationdb-server_OFF-1_amd64.deb | ||
|
||
# Verify installation | ||
fdbserver --version | ||
|
||
# https://apple.github.io/foundationdb/administration.html#administration-running-foundationdb | ||
# Configure redundancy and storage engine | ||
fdbcli --exec "configure perpetual_storage_wiggle=1 storage_migration_type=gradual" | ||
fdbcli --exec "configure single ssd" | ||
service foundationdb stop | ||
|
||
|
||
pip install wheel foundationdb prometheus_client | ||
|
||
cat << 'EOF' > /usr/local/bin/fdb_prometheus_proxy.py | ||
__PROMETHEUS_PROXY_SCRIPT__ | ||
EOF | ||
|
||
# Systemd service | ||
cat << 'EOF' > /etc/systemd/system/fdb_prometheus_proxy.service | ||
[Unit] | ||
Description=FDB Prometheus Proxy | ||
After=network-online.target | ||
Requires=network-online.target | ||
[Service] | ||
ExecStart=/usr/bin/python3 /usr/local/bin/fdb_prometheus_proxy.py --fdb-cluster-file /etc/foundationdb/fdb.cluster | ||
Restart=always | ||
RestartSec=2 | ||
[Install] | ||
WantedBy=multi-user.target | ||
EOF | ||
|
||
systemctl daemon-reload | ||
systemctl enable fdb_prometheus_proxy | ||
|
||
# NOTE: we dont have a systemd service for fdbserver because it uses `service`: | ||
# https://apple.github.io/foundationdb/administration.html#administration-running-foundationdb |
Oops, something went wrong.