Skip to content

Commit

Permalink
add port as variable and fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
csilva-cl committed Dec 20, 2023
1 parent 471ae5e commit 36c2eb6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion python/s3daemon/s3daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
),
)

PORT = 15555
PORT = int(os.environ["S3DAEMON_PORT"])
endpoint_url = os.environ["S3_ENDPOINT_URL"]
access_key = os.environ["AWS_ACCESS_KEY_ID"]
secret_key = os.environ["AWS_SECRET_ACCESS_KEY"]
Expand Down
3 changes: 2 additions & 1 deletion python/s3daemon/send.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@

import socket
import sys
import os

PORT = 15555
PORT = int(os.environ["S3DAEMON_PORT"])


def send(filename, dest):
Expand Down
3 changes: 2 additions & 1 deletion summittests/envvars-template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ export AWS_SECRET_ACCESS_KEY=""
export bucket="rubin-summit-users"
export prefix="test-lhn"
export nodes="lsstcam-dc03 lsstcam-dc04 lsstcam-dc05 lsstcam-dc06 lsstcam-dc07 lsstcam-dc08 lsstcam-dc09 lsstcam-dc10"
export datadir="~tonyj/Test/"
export datadir="/home/tonyj/Test/"
export S3DAEMON_PORT="15555"

2 changes: 1 addition & 1 deletion summittests/runOnNodes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ source envvars.sh
cmd="$@"

for n in $nodes; do
exec="cd s3daemon/summittests; ${cmd}"
exec="cd ~/s3daemon/summittests; ${cmd}"
echo $exec
ssh $n "${exec}" &
done
17 changes: 8 additions & 9 deletions summittests/sendTest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,26 @@ source venv/bin/activate



total=2
repeat=2
if [ $1 ]
then
total="$1"
repeat="$1"
fi
echo "$HOSTNAME S3_ENDPOINT_URL is $S3_ENDPOINT_URL total $total $datadir"
echo "$HOSTNAME S3_ENDPOINT_URL is $S3_ENDPOINT_URL repeat $repeat $datadir"

files=`ls ${datadir}/MC*/* `

fcount=0
l=0

while [[ fcount -le total ]]
while [[ l -le repeat ]]
do
echo Repetition number $l out of $repeat on $HOSTNAME
l=$((l + 1))
for f in $files; do
key=`echo $f | cut -d'/' -f6`
python ../python/s3daemon/send.py $f /${bucket}/${prefix}/${key} &
fcount=$((fcount + 1))
if [[ fcount -ge total ]]
then
break
fi
if [ $((fcount % 20)) == 0 ]
then
echo Sent $key total $fcount
Expand All @@ -37,4 +36,4 @@ for f in $files; do
fi
done
done
echo Sent total $fcount
echo Sent total $fcount from $HOSTNAME to $S3_ENDPOINT_URL

0 comments on commit 36c2eb6

Please sign in to comment.