Skip to content

Commit 68e1f8f

Browse files
committed
pushing BOINC and GIMPS yaml files for now...instructions later.
1 parent 9815793 commit 68e1f8f

File tree

3 files changed

+176
-0
lines changed

3 files changed

+176
-0
lines changed

rackspace/README.MD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Scripts to set up Rackspace's Kubernetes spot instances for computing Distributed Computing projects such as The Greate Mersenne Prime Search (GIMPS) and Berkeley Open Infrastructure for Network Computing (BOINC).

rackspace/boinc-with-storage.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: boinc
5+
spec:
6+
accessModes:
7+
- ReadWriteOnce
8+
resources:
9+
requests:
10+
storage: 20Gi
11+
storageClassName: sata
12+
---
13+
apiVersion: apps/v1
14+
kind: Deployment
15+
metadata:
16+
name: boinc
17+
spec:
18+
replicas: 1
19+
selector:
20+
matchLabels:
21+
app: boinc
22+
template:
23+
metadata:
24+
labels:
25+
app: boinc
26+
spec:
27+
containers:
28+
- name: boinc
29+
image: ubuntu:latest
30+
command: ["/bin/bash", "-c"]
31+
env:
32+
- name: WCG_ACCOUNT_KEY
33+
value: "YOUR_WCG_ACCOUNT_KEY" # Replace with your actual World Community Grid account key
34+
- name: RS_ACCOUNT_KEY
35+
value: "YOUR_RS_ACCOUNT_KEY" # Replace with your actual Rosetta@home account key
36+
args:
37+
- |
38+
set -e # Exit on error
39+
40+
BOINC_DIR="/boinc"
41+
42+
# Ensure script runs as root
43+
if [[ $EUID -ne 0 ]]; then
44+
echo "This script must be run as root (use sudo)."
45+
exit 1
46+
fi
47+
48+
# Install dependencies if not present
49+
echo "Installing dependencies..."
50+
apt-get update && apt-get install -y git build-essential libssl-dev libcurl4-openssl-dev \
51+
libboost-all-dev libsqlite3-dev libwxgtk3.2-dev libwxgtk-webview3.2-dev \
52+
autoconf automake libtool pkg-config libgtk-3-dev libnotify-dev \
53+
vim sudo wget curl
54+
55+
# Check if BOINC is already installed
56+
if [ ! -f "$BOINC_DIR/bin/boinc" ]; then
57+
echo "BOINC not found. Compiling and installing in $BOINC_DIR..."
58+
cd /usr/local/src
59+
git clone https://github.com/BOINC/boinc.git || (cd boinc && git pull)
60+
cd boinc
61+
./_autosetup
62+
./configure --prefix="$BOINC_DIR" --disable-server
63+
make -j$(nproc)
64+
make install
65+
else
66+
echo "BOINC already installed in $BOINC_DIR."
67+
fi
68+
69+
# Create the 'boinc' user if it doesn't exist
70+
if ! id "boinc" &>/dev/null; then
71+
echo "Creating 'boinc' system user..."
72+
useradd -r -m -d "$BOINC_DIR" -s /bin/bash boinc
73+
fi
74+
75+
# Ensure correct ownership
76+
echo "Ensuring 'boinc' user owns $BOINC_DIR..."
77+
chown -R boinc:boinc "$BOINC_DIR"
78+
79+
# Create the GUI RPC authentication file
80+
echo "Ensuring GUI RPC authentication file exists..."
81+
# set your own password if you'd like... this is blank
82+
echo "" > "$BOINC_DIR/gui_rpc_auth.cfg"
83+
chown boinc:boinc "$BOINC_DIR/gui_rpc_auth.cfg"
84+
85+
# Start BOINC, in the background, if not already running
86+
# This needs to occur to attach projects
87+
if ! pgrep -u boinc boinc > /dev/null; then
88+
echo "Starting BOINC client..."
89+
su - boinc -c "$BOINC_DIR/bin/boinc --dir $BOINC_DIR" &
90+
sleep 5
91+
else
92+
echo "BOINC client is already running."
93+
fi
94+
95+
# Attach to World Community Grid, if not already attached
96+
if [ ! -f "$BOINC_DIR/account_www.worldcommunitygrid.org.xml" ]; then
97+
echo "Attaching to World Community Grid using account key..."
98+
su - boinc -c "$BOINC_DIR/bin/boinccmd --passwd \"\" --project_attach https://www.worldcommunitygrid.org $WCG_ACCOUNT_KEY"
99+
else
100+
echo "Already attached to World Community Grid."
101+
fi
102+
103+
# Attach to Rosetta@home, if not already attached
104+
if [ ! -f "$BOINC_DIR/account_boinc.bakerlab.org_rosetta.xml" ]; then
105+
echo "Attaching to Rosetta@home using account key..."
106+
su - boinc -c "$BOINC_DIR/bin/boinccmd --passwd \"\" --project_attach https://boinc.bakerlab.org/rosetta $RS_ACCOUNT_KEY"
107+
else
108+
echo "Already attached to Rosetta@home."
109+
fi
110+
volumeMounts:
111+
- mountPath: /boinc
112+
name: boinc-storage
113+
volumes:
114+
- name: boinc-storage
115+
persistentVolumeClaim:
116+
claimName: boinc

rackspace/mprime-with-storage.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Provisions the persistant storage as a SATA drive with minimum required 75GB
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: mprime-pvc
6+
spec:
7+
accessModes:
8+
- ReadWriteOnce
9+
resources:
10+
requests:
11+
storage: 75Gi # For Sata storage type, 75GB - 1TB is range
12+
storageClassName: sata-large
13+
---
14+
15+
# Provisions a Deployment for the mprime application, managing its container and volume
16+
apiVersion: apps/v1
17+
kind: Deployment
18+
metadata:
19+
name: mprime-deployment
20+
spec:
21+
replicas: 1
22+
selector:
23+
matchLabels:
24+
app: mprime
25+
template:
26+
metadata:
27+
labels:
28+
app: mprime
29+
spec:
30+
containers:
31+
- name: mprime
32+
image: primesearch/mprime:latest
33+
#command: ["sh", "-c", "while true; do sleep 3600; done"]
34+
ports:
35+
- containerPort: 80
36+
volumeMounts:
37+
- mountPath: /kubmprime
38+
name: mprime-storage
39+
env:
40+
- name: PRIME_ID
41+
value: "danc2"
42+
- name: COMPUTER_NAME
43+
value: "baremetal"
44+
- name: TYPE_OF_WORK
45+
value: "150"
46+
- name: PRP_PROOF_POWER
47+
value: "5"
48+
- name: DIR
49+
value: "/kubmprime"
50+
- name: PRP_PROOF_POWER_MULT
51+
value: "Default"
52+
- name: PROOF_CERTIFICATION_WORK
53+
value: "1"
54+
- name: DEBUG
55+
value: "0"
56+
volumes:
57+
- name: mprime-storage
58+
persistentVolumeClaim:
59+
claimName: mprime-pvc

0 commit comments

Comments
 (0)