-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #685 from eesast/dev
update run.sh
- Loading branch information
Showing
54 changed files
with
2,795 additions
and
1,472 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
grpcio==1.54.2 | ||
grpcio-tools==1.54.2 | ||
grpcio-tools==1.62.1 | ||
numpy |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
#! /bin/bash | ||
# WORKDIR /usr/local/PlayerCode/CAPI/cpp | ||
i=1 | ||
workdir=/usr/local/PlayerCode/CAPI/cpp | ||
bind=/usr/local/code | ||
output=/usr/local/output | ||
|
||
flag=1 | ||
bind=/usr/local/mnt | ||
while (( $i <= 5 )) | ||
do | ||
if [ -f "${bind}/player${i}.cpp" ]; then | ||
cp -f $bind/player$i.cpp ./API/src/AI.cpp | ||
cmake ./CMakeLists.txt && make -j$(nproc) >compile_log$i.txt 2>&1 | ||
mv ./capi $bind/capi$i # executable file | ||
if [ $? -ne 0 ]; then | ||
flag=0 | ||
fi | ||
mv ./compile_log$i.txt $bind/compile_log$i.txt | ||
elif [ -f "${bind}/player${i}.py" ]; then | ||
pushd ../python | ||
cp -f $bind/player$i.py ./PyAPI/AI.py | ||
python3 -m compileall ./PyAPI >compile_log$i.txt 2>&1 | ||
if [ ! -f ./PyAPI/__pycache__/AI.cpython-39.pyc ]; then | ||
flag=0 | ||
else | ||
rm -rf ./PyAPI/__pycache__/AI.cpython-39.pyc | ||
fi | ||
mv ./compile_log$i.txt $bind/compile_log$i.txt | ||
popd | ||
|
||
cd $bind | ||
file_count=$(ls -l *.cpp | wc -l); | ||
if [ $file_count -eq 1 ] | ||
then | ||
filename=$(ls *.cpp) | ||
base_name=$(basename "$filename" .cpp) | ||
cd $workdir | ||
cp -f $bind/$filename $workdir/API/src/AI.cpp | ||
cmake ./CMakeLists.txt && make -j$(nproc) >$base_name.log 2>&1 | ||
mv ./capi $output/$base_name | ||
if [ $? -ne 0 ]; then | ||
flag=0 | ||
fi | ||
let "i++" | ||
done | ||
# HTML request to update status. | ||
mv ./$base_name.log $output/$base_name.log | ||
else | ||
flag=0 | ||
fi | ||
|
||
if [ $flag -eq 1 ]; then | ||
curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"compiled"}' > $bind/curl_log.txt | ||
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Completed"}' > $output/$base_name.curl.log | ||
else | ||
curl $URL -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"failed"}' > $bind/curl_log.txt | ||
curl $URL -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" -d '{"compile_status":"Failed"}' > $output/$base_name.curl.log | ||
fi |
Oops, something went wrong.