Skip to content

Commit

Permalink
Merge pull request #685 from eesast/dev
Browse files Browse the repository at this point in the history
update run.sh
  • Loading branch information
DragonAura authored May 7, 2024
2 parents d67e7e7 + 7d7d33e commit f9ecfb3
Show file tree
Hide file tree
Showing 54 changed files with 2,795 additions and 1,472 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
upload_docker_images:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Log in to DockerHub
run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
clang-format-checking:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: DoozyX/clang-format-lint-action@v0.15
with:
source: '.'
Expand All @@ -16,7 +16,7 @@ jobs:
dotnet-format-checking:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/upload_COS.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ jobs:
client_build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup dotnet Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.402

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9.2'
architecture: 'x64'
Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:
cp -r ./CAPI/shell/* ./THUAI6/linux/
cp -r ./CAPI/shell/* ./THUAI6/osx/
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: my-artifact
path: ./THUAI6
Expand All @@ -97,22 +97,22 @@ jobs:
needs: client_build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup dotnet Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.9'

- name: Pip Install paramiko
run: pip install paramiko

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: my-artifact
path: ./THUAI6
Expand Down
2 changes: 1 addition & 1 deletion CAPI/python/requirements.txt
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
2 changes: 1 addition & 1 deletion dependency/Dockerfile/Dockerfile_run
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/dotnet/sdk:6.0.408-jammy-amd64 AS build
FROM mcr.microsoft.com/dotnet/sdk:8.0.204-jammy-amd64 AS build
MAINTAINER eesast
WORKDIR /usr/local
COPY . .
Expand Down
6 changes: 3 additions & 3 deletions dependency/proto/Protos.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
</ItemGroup>-->

<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.23.3" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.23.3" />
<PackageReference Include="Google.Protobuf" Version="3.26.1" />
<PackageReference Include="Google.Protobuf.Tools" Version="3.26.1" />
<PackageReference Include="Grpc" Version="2.46.6" />
<PackageReference Include="Grpc.Core" Version="2.46.6" />
<PackageReference Include="Grpc.Tools" Version="2.54.0">
<PackageReference Include="Grpc.Tools" Version="2.62.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
52 changes: 24 additions & 28 deletions dependency/shell/compile.sh
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
Loading

0 comments on commit f9ecfb3

Please sign in to comment.