Skip to content

Commit

Permalink
Fix timezone of build container
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhichang committed Dec 23, 2023
1 parent 52a3bf9 commit bf5e387
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
run: git branch --show-current && git rev-parse HEAD

- name: Start builder container
run: sudo docker rm -f infinity_build && sudo docker run -d --name infinity_build --network=host -v $PWD:/infinity infiniflow/infinity_build:0.1
run: |
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}')
sudo docker rm -f infinity_build && sudo docker run -d --name infinity_build --network=host -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_build:0.1
- name: Build release version
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 -S /infinity -B /infinity/cmake-build-release && cmake --build /infinity/cmake-build-release"
Expand Down
28 changes: 21 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ jobs:
uses: actions/checkout@v3

- name: Start builder container
run: sudo docker rm -f infinity_build && sudo docker run -d --name infinity_build --network=host -v $PWD:/infinity infiniflow/infinity_build:0.1
run: |
TZ=$(readlink -f /etc/localtime | awk -F '/zoneinfo/' '{print $2}')
sudo docker rm -f infinity_build && sudo docker run -d --name infinity_build --network=host -e TZ=$TZ -v $PWD:/infinity infiniflow/infinity_build:0.1
- name: Build debug version
run: sudo docker exec infinity_build bash -c "cd /infinity && rm -fr cmake-build-debug && mkdir -p cmake-build-debug && cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -S /infinity -B /infinity/cmake-build-debug && cmake --build /infinity/cmake-build-debug"
Expand All @@ -31,13 +33,19 @@ jobs:
# Run a command in the background
sudo docker exec infinity_build bash -c "cd /infinity/ && rm -fr /tmp/infinity && cmake-build-debug/src/infinity > debug.log 2>&1" &
# Save its process ID to a file for later use
echo $! > background_process_pid.txt
echo $! > debug_pid.txt
- name: pysdk & sqllogictest debug version
run: sudo docker exec infinity_build bash -c "cd /infinity/ && python3 tools/sqllogictest.py"

- name: Collect infinity debug output and stop it
run: cat debug.log && sudo kill $(cat background_process_pid.txt) && rm -f background_process_pid.txt
- name: Collect infinity debug output
run: cat debug.log
if: always() # always run this step even if previous steps failed

- name: Stop infinity debug
run: |
sudo kill $(cat debug_pid.txt)
rm -f debug_pid.txt
if: always() # always run this step even if previous steps failed

- name: Build release version
Expand All @@ -46,11 +54,17 @@ jobs:
- name: Start infinity release version
run: |
sudo docker exec infinity_build bash -c "cd /infinity/ &&rm -fr /tmp/infinity && cmake-build-release/src/infinity > release.log 2>&1" &
echo $! > background_process_pid.txt
echo $! > release_pid.txt
- name: pysdk & sqllogictest release version
run: sudo docker exec infinity_build bash -c "cd /infinity/ && python3 tools/sqllogictest.py"

- name: Collect infinity release output and stop it
run: cat release.log && sudo kill $(cat background_process_pid.txt) && rm -f background_process_pid.txt
- name: Collect infinity release output
run: cat release.log
if: always() # always run this step even if previous steps failed

- name: Stop infinity release
run: |
sudo kill $(cat release_pid.txt)
rm -f release_pid.txt
if: always() # always run this step even if previous steps failed

0 comments on commit bf5e387

Please sign in to comment.