Skip to content

Commit

Permalink
Checkout code using https instead of ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Jan 17, 2024
1 parent c1e1695 commit 9a673ee
Showing 1 changed file with 78 additions and 82 deletions.
160 changes: 78 additions & 82 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
- name: Check out code
if: ${{ !cancelled() && !failure() }}
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.MY_DEPLOY_KEY }}

- name: Start builder container
if: ${{ !cancelled() && !failure() }}
Expand Down Expand Up @@ -85,83 +83,81 @@ jobs:
if: ${{ github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'ci') }}
runs-on: [ "self-hosted", "benchmark" ]
steps:
# https://github.com/hmarr/debug-action
#- uses: hmarr/debug-action@v2

- name: Show PR labels
if: ${{ !cancelled() && !failure() }}
run: |
echo "Workflow triggered by ${{ github.event_name }}"
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "PR labels: ${{ join(github.event.pull_request.labels.*.name, ', ') }}"
fi
- name: Ensure workspace ownership
if: ${{ !cancelled() && !failure() }}
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE

- name: Check out code
if: ${{ !cancelled() && !failure() }}
uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.MY_DEPLOY_KEY }}

- name: Start builder container
if: ${{ !cancelled() && !failure() }}
run: |
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}')
sudo docker rm -f infinity_build && sudo docker run -d --privileged --name infinity_build -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_builder:ubuntu2310
- name: Build release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity && rm -fr cmake-build-release && mkdir -p cmake-build-release && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_JOB_POOL_LINK:STRING=link_pool -DCMAKE_JOB_POOLS:STRING=link_pool=1 -S /infinity -B /infinity/cmake-build-release && cmake --build /infinity/cmake-build-release"

- name: Unit test release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity/ && cmake-build-release/src/test_main"

- name: Start infinity release version
if: ${{ !cancelled() && !failure() }}
run: |
sudo docker exec infinity_build bash -c "cd /infinity/ && rm -fr /tmp/infinity && cmake-build-release/src/infinity > release.log 2>&1" &
- name: pysdk & sqllogictest release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity/ && python3 tools/sqllogictest.py"

- name: Stop infinity release
if: ${{ !cancelled() }} # always run this step even if previous steps failed
run: sudo kill $(pidof cmake-build-release/src/infinity)

- name: Collect infinity release output
# GitHub Actions interprets output lines starting with "Error" as error messages, and it automatically sets the step status to failed when such lines are detected.
if: ${{ !cancelled() }} # always run this step even if previous steps failed
run: cat release.log 2>/dev/null || true

- name: Prepare sift dataset
if: ${{ !cancelled() && !failure() }}
run: sudo chmod +x ./tools/ci_tools/check_benchmark_result.py && sudo mkdir -p test/data/benchmark && sudo ln -s $HOME/benchmark/sift1M test/data/benchmark/sift_1m

- name: Generate config file
if: ${{ !cancelled() && !failure() }}
run: mkdir -p $PWD/db_tmp && cat conf/infinity_conf.toml | sed -e "s|/var/infinity|$PWD/db_tmp|g" > $PWD/db_tmp/infinity_conf.toml

- name: Import sift dataset
if: ${{ !cancelled() && !failure() }}
run: ./cmake-build-release/benchmark/local_infinity/knn_import_benchmark sift $PWD/test/data $PWD/db_tmp

- name: Benchmark sift search 1 thread repeat 50 times
if: ${{ !cancelled() && !failure() }}
run: echo $(date --rfc-3339=s) "Benchmark sift search 1 thread average time:" $(echo "1 50" | ./cmake-build-release/benchmark/local_infinity/knn_query_benchmark sift 200 $PWD/test/data $PWD/db_tmp | awk '/Total cost/ {total+=$4; count+=1} END {printf ("%f s", total/count)}') | tee -a $HOME/benchmark/benchmark_sift_1_thread.log

- name: Benchmark sift search 8 threads repeat 50 times
if: ${{ !cancelled() && !failure() }}
run: echo $(date --rfc-3339=s) "Benchmark sift search 8 threads average time:" $(echo "8 50" | ./cmake-build-release/benchmark/local_infinity/knn_query_benchmark sift 200 $PWD/test/data $PWD/db_tmp | awk '/Total cost/ {total+=$4; count+=1} END {printf ("%f s", total/count)}') | tee -a $HOME/benchmark/benchmark_sift_8_threads.log

- name: Benchmark sift check 1 thread result
if: ${{ !cancelled() && !failure() }}
run: ./tools/ci_tools/check_benchmark_result.py sift_1 $HOME/benchmark/benchmark_sift_1_thread.log

- name: Benchmark sift check 8 threads result
if: ${{ !cancelled() && !failure() }}
run: ./tools/ci_tools/check_benchmark_result.py sift_8 $HOME/benchmark/benchmark_sift_8_threads.log
# https://github.com/hmarr/debug-action
#- uses: hmarr/debug-action@v2

- name: Show PR labels
if: ${{ !cancelled() && !failure() }}
run: |
echo "Workflow triggered by ${{ github.event_name }}"
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
echo "PR labels: ${{ join(github.event.pull_request.labels.*.name, ', ') }}"
fi
- name: Ensure workspace ownership
if: ${{ !cancelled() && !failure() }}
run: echo "chown -R $USER $GITHUB_WORKSPACE" && sudo chown -R $USER $GITHUB_WORKSPACE

- name: Check out code
if: ${{ !cancelled() && !failure() }}
uses: actions/checkout@v3

- name: Start builder container
if: ${{ !cancelled() && !failure() }}
run: |
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}')
sudo docker rm -f infinity_build && sudo docker run -d --privileged --name infinity_build -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_builder:ubuntu2310
- name: Build release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity && rm -fr cmake-build-release && mkdir -p cmake-build-release && cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_JOB_POOL_LINK:STRING=link_pool -DCMAKE_JOB_POOLS:STRING=link_pool=1 -S /infinity -B /infinity/cmake-build-release && cmake --build /infinity/cmake-build-release"

- name: Unit test release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity/ && cmake-build-release/src/test_main"

- name: Start infinity release version
if: ${{ !cancelled() && !failure() }}
run: |
sudo docker exec infinity_build bash -c "cd /infinity/ && rm -fr /tmp/infinity && cmake-build-release/src/infinity > release.log 2>&1" &
- name: pysdk & sqllogictest release version
if: ${{ !cancelled() && !failure() }}
run: sudo docker exec infinity_build bash -c "cd /infinity/ && python3 tools/sqllogictest.py"

- name: Stop infinity release
if: ${{ !cancelled() }} # always run this step even if previous steps failed
run: sudo kill $(pidof cmake-build-release/src/infinity)

- name: Collect infinity release output
# GitHub Actions interprets output lines starting with "Error" as error messages, and it automatically sets the step status to failed when such lines are detected.
if: ${{ !cancelled() }} # always run this step even if previous steps failed
run: cat release.log 2>/dev/null || true

- name: Prepare sift dataset
if: ${{ !cancelled() && !failure() }}
run: sudo chmod +x ./tools/ci_tools/check_benchmark_result.py && sudo mkdir -p test/data/benchmark && sudo ln -s $HOME/benchmark/sift1M test/data/benchmark/sift_1m

- name: Generate config file
if: ${{ !cancelled() && !failure() }}
run: mkdir -p $PWD/db_tmp && cat conf/infinity_conf.toml | sed -e "s|/var/infinity|$PWD/db_tmp|g" > $PWD/db_tmp/infinity_conf.toml

- name: Import sift dataset
if: ${{ !cancelled() && !failure() }}
run: ./cmake-build-release/benchmark/local_infinity/knn_import_benchmark sift $PWD/test/data $PWD/db_tmp

- name: Benchmark sift search 1 thread repeat 50 times
if: ${{ !cancelled() && !failure() }}
run: echo $(date --rfc-3339=s) "Benchmark sift search 1 thread average time:" $(echo "1 50" | ./cmake-build-release/benchmark/local_infinity/knn_query_benchmark sift 200 $PWD/test/data $PWD/db_tmp | awk '/Total cost/ {total+=$4; count+=1} END {printf ("%f s", total/count)}') | tee -a $HOME/benchmark/benchmark_sift_1_thread.log

- name: Benchmark sift search 8 threads repeat 50 times
if: ${{ !cancelled() && !failure() }}
run: echo $(date --rfc-3339=s) "Benchmark sift search 8 threads average time:" $(echo "8 50" | ./cmake-build-release/benchmark/local_infinity/knn_query_benchmark sift 200 $PWD/test/data $PWD/db_tmp | awk '/Total cost/ {total+=$4; count+=1} END {printf ("%f s", total/count)}') | tee -a $HOME/benchmark/benchmark_sift_8_threads.log

- name: Benchmark sift check 1 thread result
if: ${{ !cancelled() && !failure() }}
run: ./tools/ci_tools/check_benchmark_result.py sift_1 $HOME/benchmark/benchmark_sift_1_thread.log

- name: Benchmark sift check 8 threads result
if: ${{ !cancelled() && !failure() }}
run: ./tools/ci_tools/check_benchmark_result.py sift_8 $HOME/benchmark/benchmark_sift_8_threads.log

0 comments on commit 9a673ee

Please sign in to comment.