From a66288614b83274293edc59ca053e7e27592a8bb Mon Sep 17 00:00:00 2001 From: Dongze Li Date: Wed, 3 Jul 2024 15:39:58 +0800 Subject: [PATCH] ci: fix analytical engine CI (#3996) --- .github/workflows/release.yml | 18 ++++++++++++++++++ analytical_engine/core/io/property_parser.h | 13 +++++++++---- k8s/utils/precompile.py | 1 + 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3203d4988f0..f0cebcabcb8c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,11 +31,29 @@ jobs: - name: Build Wheel Package run: | + # change the version for nightly release + # 0.15.0 -> 0.15.0a20220808 + time=$(date "+%Y%m%d") + version=$(cat ${GITHUB_WORKSPACE}/VERSION) + if [[ "${{ GITHUB.REF }}" == "refs/heads/main" ]]; then + echo "${version}a${time}" > ${GITHUB_WORKSPACE}/VERSION; + fi + cd ${GITHUB_WORKSPACE}/python python3 setup_gsctl.py bdist_wheel # move wheels into one folder to upload to PyPI mkdir ${GITHUB_WORKSPACE}/upload_pypi mv ${GITHUB_WORKSPACE}/python/dist/*.whl ${GITHUB_WORKSPACE}/upload_pypi/ + cd ${GITHUB_WORKSPACE} + tar -zcf gsctl.tar.gz ${GITHUB_WORKSPACE}/upload_pypi/*.whl + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: gsctl-${{ github.sha }} + path: | + gsctl.tar.gz + retention-days: 5 - name: Publish distribution to PyPI uses: pypa/gh-action-pypi-publish@v1.4.2 diff --git a/analytical_engine/core/io/property_parser.h b/analytical_engine/core/io/property_parser.h index d8ae06647b1c..593d9c62fdd1 100644 --- a/analytical_engine/core/io/property_parser.h +++ b/analytical_engine/core/io/property_parser.h @@ -245,19 +245,24 @@ inline void SplitTable(const std::string& data, int num, inline void DistributeChunk(const rpc::Chunk& chunk, int num, std::vector& distributed_chunk) { distributed_chunk.resize(num); - const auto& attrs = chunk.attr(); - std::string protocol = attrs.at(rpc::PROTOCOL).s(); + // Copy to a map to avoid the undefined reference issue (inside + // protobuf's internal code: Map::at()') on MacOS + std::map params; + for (auto& pair : chunk.attr()) { + params[pair.first] = pair.second; + } + std::string protocol = params.at(rpc::PROTOCOL).s(); std::vector distributed_values; const std::string& data = chunk.buffer(); if (protocol == "pandas") { SplitTable(data, num, distributed_values); } else { - distributed_values.resize(num, attrs.at(rpc::SOURCE).s()); + distributed_values.resize(num, params.at(rpc::SOURCE).s()); } for (int i = 0; i < num; ++i) { distributed_chunk[i].set_buffer(std::move(distributed_values[i])); auto* attr = distributed_chunk[i].mutable_attr(); - for (auto& pair : attrs) { + for (auto& pair : params) { (*attr)[pair.first].CopyFrom(pair.second); } } diff --git a/k8s/utils/precompile.py b/k8s/utils/precompile.py index 21818ff33631..6f45ac8a5421 100755 --- a/k8s/utils/precompile.py +++ b/k8s/utils/precompile.py @@ -468,6 +468,7 @@ def parse_sys_args(): return parser.parse_args() WORKSPACE = Path(os.path.join("/", tempfile.gettempprefix(), "gs", "builtin")).resolve() +ENABLE_JAVA_SDK = "OFF" if __name__ == "__main__": args = parse_sys_args()