Skip to content

Commit 5b150a8

Browse files
committed
merge main
2 parents 40b042e + 85ebad4 commit 5b150a8

File tree

13 files changed

+188
-145
lines changed

13 files changed

+188
-145
lines changed

.github/actions/confWriter/action.yml

+7-14
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,16 @@ runs:
7979
id: find_python_cmd
8080
shell: bash -el {0}
8181
run: |
82-
if [[ "${{ inputs.use-free-thread-python }}" == "true" ]]; then
83-
if [ "$RUNNER_OS" == "Windows" ]; then
84-
pythonPath=$(echo "$FT_PYTHON_PATH" | sed 's/\\/\//g')
85-
pythonCMD="${pythonPath}/python3.13t.exe"
86-
echo "TORCH_SUPPORTED=false" >> $GITHUB_ENV
87-
else
88-
pythonCMD='python3.13t'
89-
echo "TORCH_SUPPORTED=false" >> $GITHUB_ENV
90-
fi
82+
if [ "${{ inputs.use-free-thread-python }}" == "true" ]; then
83+
echo "TORCH_SUPPORTED=false" >> $GITHUB_ENV
84+
fi
85+
if [ "$RUNNER_OS" == "Windows" ]; then
86+
pythonCMD=python
9187
else
92-
if [ "$RUNNER_OS" == "Windows" ]; then
93-
pythonCMD=python
94-
else
95-
pythonCMD=python3
96-
fi
88+
pythonCMD=python3
9789
fi
9890
# have to set env to make it work in ut tests
91+
${pythonCMD} -VV
9992
echo "pythonCMD=${pythonCMD}" >> $GITHUB_ENV
10093
echo "pythonCMD=${pythonCMD}" >> $GITHUB_OUTPUT
10194
echo ${pythonCMD}

.github/actions/dependence/action.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,9 @@ runs:
116116
117117
- if: inputs.free-thread-python-required=='true'
118118
name: Install free-thread python
119-
uses: ./.github/actions/service/freeThreadPython
119+
uses: ./.github/actions/service/freeThreadConda
120+
with:
121+
iginx-conda-env: ${{ inputs.iginx-conda-env }}
120122

121123
- name: Set up JDK ${{ inputs.java }}
122124
uses: actions/setup-java@v4

.github/actions/iginxRunner/action.yml

+20-7
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ inputs:
99
description: "to test UDF path detection"
1010
required: false
1111
default: "false"
12+
iginx-conda-flag:
13+
# this step is only needed when using python3.13 by conda because latest conda supports py3.12,
14+
# and we use conda-forge to support 3.13. Thus, the required env would not be activated automatically
15+
# even when we use login mode of bash
16+
description: "whether to manually activate conda env before start IGinX"
17+
required: false
18+
default: "false"
19+
iginx-conda-env:
20+
description: "required conda env name"
21+
required: false
22+
default: "false"
1223

1324
runs:
1425
using: "composite" # Mandatory parameter
@@ -36,16 +47,18 @@ runs:
3647
name: Start IGinX
3748
shell: bash -el {0}
3849
run: |
39-
which python
50+
if [ "${{ inputs.iginx-conda-flag }}" == "true" ]; then
51+
conda activate ${{ inputs.iginx-conda-env }}
52+
fi
4053
if [ "$RUNNER_OS" == "Linux" ]; then
41-
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx.sh"
42-
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx.sh" 6888 7888
54+
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx.sh"
55+
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx.sh" 6888 7888
4356
elif [ "$RUNNER_OS" == "Windows" ]; then
44-
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_windows.sh"
45-
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_windows.sh" 6888 7888
57+
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_windows.sh"
58+
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_windows.sh" 6888 7888
4659
elif [ "$RUNNER_OS" == "macOS" ]; then
47-
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_macos.sh"
48-
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_macos.sh" 6888 7888
60+
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_macos.sh"
61+
"${GITHUB_WORKSPACE}/.github/scripts/iginx/iginx_macos.sh" 6888 7888
4962
fi
5063
5164
- if: inputs.if-test-udf=='false' && inputs.if-stop=='true'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: "Install_Free-thread_Python in Conda"
2+
description: "Install Free-thread Python in Conda"
3+
inputs:
4+
iginx-conda-env:
5+
description: "conda env name"
6+
required: false
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
# this step creates env test(default python version) which will not be used
12+
- uses: conda-incubator/setup-miniconda@v3
13+
with:
14+
channels: conda-forge
15+
channel-priority: flexible
16+
conda-remove-defaults: "true"
17+
run-post: "false"
18+
19+
# currently we can only install free-thread python 3.13 by conda-forge. latest miniconda only supports 3.12
20+
# thus in action steps ahead, remember to 'conda activate $ENV_NAME' at start if conda should be used
21+
- name: Check channels & install python3.13
22+
shell: bash -el {0}
23+
run: |
24+
conda config --show channels
25+
conda create -n ${{ inputs.iginx-conda-env }} python=3.13 python-freethreading -c conda-forge -q
26+
conda activate ${{ inputs.iginx-conda-env }}
27+
python -VV
28+
python -c "import sys;print(sys._is_gil_enabled())"
29+
curl -L -O https://github.com/IGinX-THU/IGinX-resources/raw/refs/heads/main/resources/python/pandas-3.0.0.dev0+1654.g32a97a969a-cp313-cp313t-win_amd64.whl
30+
curl -L -O https://pypi.fury.io/arrow-nightlies/-/ver_1AsSYu/pyarrow-19.0.0.dev286-cp313-cp313t-win_amd64.whl#md5=3c940f7b4ffd0debaa8b23d06bc9b2ea
31+
ls -l
32+
if [ "$RUNNER_OS" == "Windows" ]; then
33+
python -m pip install numpy thrift pemjax
34+
python -m pip install pandas*.whl
35+
python3.13t -m pip install pyarrow*.whl
36+
else
37+
python -m pip install pandas==2.2.3 numpy thrift pemjax
38+
fi

.github/actions/service/freeThreadPython/action.yml

-117
This file was deleted.

.github/scripts/iginx/iginx.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ sed -i "s/restPort=[0-9]\+/restPort=$2/g" core/target/iginx-core-*/conf/config.p
2828

2929
sh -c "chmod +x core/target/iginx-core-*/sbin/start_iginx.sh"
3030

31-
sh -c "nohup core/target/iginx-core-*/sbin/start_iginx.sh > iginx-$1.log 2>&1 &"
31+
python3 -VV
32+
bash -c "nohup core/target/iginx-core-*/sbin/start_iginx.sh > iginx-$1.log 2>&1 &"
3233

3334
sh -c "sleep 3"
3435

.github/scripts/iginx/iginx_macos.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ echo "JAVA_HOME is set to $JAVA_HOME"
3232

3333
sh -c "chmod +x core/target/iginx-core-*/sbin/start_iginx.sh"
3434

35-
sh -c "nohup core/target/iginx-core-*/sbin/start_iginx.sh > iginx-$1.log 2>&1 &"
35+
python3 -VV
36+
bash -c "nohup core/target/iginx-core-*/sbin/start_iginx.sh > iginx-$1.log 2>&1 &"
3637

3738
sh -c "sleep 3"
3839

.github/scripts/test/test_union.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
1818
#
1919

20-
20+
python -VV
2121
pwd
2222

2323
cd ..

.github/workflows/free-thread-test.yml

+11-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
metadata: ${{ fromJSON(inputs.metadata-matrix) }}
3636
DB-name: ${{ fromJSON(inputs.db-matrix) }}
3737
runs-on: ${{ matrix.os }}
38+
env:
39+
# only used in this workflow file
40+
IGINX_CONDA_FLAG: "true"
41+
IGINX_CONDA_ENV: "iginxEnv"
3842
steps:
3943
- uses: actions/checkout@v4
4044
# use free-threading python instead of stable version
@@ -44,6 +48,8 @@ jobs:
4448
java: ${{ matrix.java }}
4549
free-thread-python-required: "true"
4650
scope: "only-java"
51+
iginx-conda-flag: ${{ env.IGINX_CONDA_FLAG }}
52+
iginx-conda-env: ${{ env.IGINX_CONDA_ENV }}
4753

4854
- name: Run Metadata
4955
uses: ./.github/actions/metadataRunner
@@ -70,13 +76,17 @@ jobs:
7076

7177
- name: Start IGinX
7278
uses: ./.github/actions/iginxRunner
79+
with:
80+
iginx-conda-flag: ${{ env.IGINX_CONDA_FLAG }}
81+
iginx-conda-env: ${{ env.IGINX_CONDA_ENV }}
7382

7483
- name: TestController IT
7584
if: always()
76-
shell: bash
85+
shell: bash -el {0}
7786
env:
7887
METADATA_STORAGE: ${{ matrix.metadata }}
7988
run: |
89+
conda activate ${{ env.IGINX_CONDA_ENV }}
8090
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/test/test_union.sh"
8191
mvn test -q -Dtest=Controller -DfailIfNoTests=false -P-format
8292

core/src/main/java/cn/edu/tsinghua/iginx/metadata/storage/etcd/ETCDMetaStorage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2364,7 +2364,7 @@ public void updateJobTrigger(TriggerDescriptor descriptor) throws MetaStorageExc
23642364
throw new MetaStorageException(e);
23652365
} finally {
23662366
if (jobTriggerLease != -1) {
2367-
releaseTransform();
2367+
releaseJobTrigger();
23682368
}
23692369
}
23702370
if (jobTriggerChangeHook != null) {

test/src/test/java/cn/edu/tsinghua/iginx/integration/func/udf/TransformIT.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,20 @@ private void verifyJobState(long jobId, JobState expectedState) throws SessionEx
250250
private void verifyJobFinishedBlocked(long jobId) throws SessionException, InterruptedException {
251251
LOGGER.info("job is {}", jobId);
252252
JobState jobState = JobState.JOB_CREATED;
253+
int timeout = 60000; // 60s
253254
while (!jobState.equals(JobState.JOB_CLOSED)
254255
&& !jobState.equals(JobState.JOB_FAILED)
255-
&& !jobState.equals(JobState.JOB_FINISHED)) {
256+
&& !jobState.equals(JobState.JOB_FINISHED)
257+
&& timeout > 0) {
256258
Thread.sleep(500);
259+
timeout -= 500;
257260
jobState = session.queryTransformJobStatus(jobId);
258261
}
259262
LOGGER.info("job {} state is {}", jobId, jobState.toString());
263+
if (timeout <= 0) {
264+
LOGGER.error("job is stuck, check IGinX server log...");
265+
fail();
266+
}
260267

261268
if (!needCompareResult) {
262269
return;

0 commit comments

Comments
 (0)