Skip to content

Commit

Permalink
added CACTI setup to profile
Browse files Browse the repository at this point in the history
  • Loading branch information
tome215 committed Sep 25, 2024
1 parent 181a884 commit f10fcd7
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
1 change: 1 addition & 0 deletions profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@
node.installRootKeys(False, False)
nodes[nodename] = node
if i == 0:
node.addService(RSpec.Execute(shell="bash",command="/local/repository/setup-cacti.sh"))
k = 0
for x in params.sharedVlans:
iface = node.addInterface("ifSharedVlan%d" % (k,))
Expand Down
64 changes: 64 additions & 0 deletions setup-cacti.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#!/bin/bash

set -x

DIRNAME=`dirname $0`

# Gotta know the rules!
if [ $EUID -ne 0 ] ; then
echo "This script must be run as root" 1>&2
exit 1
fi

# Grab our libs
. "$DIRNAME/setup-lib.sh"

# Don't run setup-pythia.sh twice
if [ -f $OURDIR/setup-pythia-done ]; then
echo "setup-pythia already ran; not running again"
exit 0
fi

sudo apt-get pkg-config -y

# shellcheck disable=SC2045
for user in $(ls /users)
do
su $user -c "bash /local/repository/setup-rust.sh"
done

# shellcheck disable=SC2164
cd /local
git clone https://github.com/docc-lab/cacti-dev.git pythia
chmod -R 777 /local/pythia
chown geniuser -R /local/pythia

mkdir dotfiles

echo "phase 0" >> cargo_phases.txt
su geniuser -c "cargo update --manifest-path /local/pythia/Cargo.toml -p lexical-core" > /local/lc0_out.txt 2> /local/lc0_err.txt
echo "phase 1" >> cargo_phases.txt
su geniuser -c "cargo update --manifest-path /local/pythia/pythia_server/Cargo.toml -p lexical-core" > /local/lc1_out.txt 2> /local/lc1_err.txt
echo "phase 2" >> cargo_phases.txt
su geniuser -c "cargo install --locked --path /local/pythia" > /local/pythia_out.txt 2> /local/pythia_err.txt
echo "phase 3" >> cargo_phases.txt
su geniuser -c "cargo install --locked --path /local/pythia/pythia_server" > /local/pythia_server_out.txt 2> /local/pythia_server_err.txt
echo "phase 4" >> cargo_phases.txt
sudo ln -s /users/geniuser/.cargo/bin/pythia_server /usr/local/bin/
sudo ln -s /users/geniuser/.cargo/bin/pythia /usr/bin/pythia
sudo ln -s /local/pythia /users/geniuser/
sudo ln -s /local/dotfiles /users/geniuser/

sudo ln -s /local/pythia/etc/systemd/system/pythia.service /etc/systemd/system/
sudo ln -s /local/pythia/etc/pythia /etc/
chmod -R g+rwX /etc/pythia
chmod -R o+rwX /etc/pythia

chmod -R 777 /local/pythia/workloads

sudo systemctl start pythia.service

touch $OURDIR/setup-pythia-done
logtend "pythia"

chown geniuser -R /local
11 changes: 11 additions & 0 deletions setup-rust.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

cd ~

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y

. "$HOME/.cargo/env"
rustup update

source .bashrc

0 comments on commit f10fcd7

Please sign in to comment.