Skip to content

Commit

Permalink
chore(grid-logger): update Makefile and job.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Darkness4 committed Feb 22, 2024
1 parent 26fab55 commit d590ffa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
1 change: 1 addition & 0 deletions grid-logger/.server.env
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ TLS_ENABLE=false
#TLS_KEY=tls.key
#TLS_CERT=tls.crt

SECRET_PATH=secret.key
STORAGE_PATH=./db

DEBUG=true
12 changes: 12 additions & 0 deletions grid-logger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ endif

bins := grid-logger-reader-linux-amd64 grid-logger-writer-linux-amd64 grid-logger-writer-linux-arm64 grid-logger-writer-linux-mips64 grid-logger-writer-linux-mips64le grid-logger-writer-linux-ppc64 grid-logger-writer-linux-ppc64le grid-logger-writer-linux-riscv64 grid-logger-writer-linux-s390x grid-logger-server-linux-amd64 grid-logger-server-linux-arm64 grid-logger-server-linux-mips64 grid-logger-server-linux-mips64le grid-logger-server-linux-ppc64 grid-logger-server-linux-ppc64le grid-logger-server-linux-riscv64 grid-logger-server-linux-s390x

.PHONY: all
bin: bin/grid-logger-reader bin/grid-logger-writer bin/grid-logger-server

bin/grid-logger-reader:
CGO_ENABLED=0 go build -ldflags "-s -w" -tags reader -o "$@" ./reader/main.go

bin/grid-logger-writer:
CGO_ENABLED=0 go build -ldflags "-s -w" -tags writer -o "$@" ./writer/main.go

bin/grid-logger-server:
CGO_ENABLED=0 go build -ldflags "-s -w" -tags server -o "$@" ./server/main.go

.PHONY: all
all: $(addprefix bin/,$(bins))

Expand Down
21 changes: 11 additions & 10 deletions grid-logger/job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export JOB_NAME=name

./bin/grid-logger-writer-linux-amd64 \
./bin/grid-logger-writer \
--server.tls=false \
--server.endpoint=localhost:3001 \
--pipe.path=$JOB_NAME \
Expand All @@ -18,14 +18,15 @@ sleep 1
exec &>>"$JOB_NAME"

zombie() {
counter=0; while true; do
echo "$(counter): SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM"
counter="$((counter + 1))"

if [ $counter -eq 1000 ]; then
break
fi
done
counter=0
while true; do
echo "$(counter): SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM"
counter="$((counter + 1))"

if [ $counter -eq 1000 ]; then
break
fi
done
}
zombie
echo "zombie created at $!"
Expand All @@ -38,7 +39,7 @@ echo "$(date): srun --container-image=test"
echo >&2 "$(date): fake error"

rm -f touchdown
echo "$counter" > touchdown
echo "$counter" >touchdown

kill $LOGGER_PID

Expand Down
1 change: 1 addition & 0 deletions grid-logger/secret.key
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
��?��Kņ�9�H��Vgb�(�Sz�?�LUc�

0 comments on commit d590ffa

Please sign in to comment.