Skip to content

Commit

Permalink
[Misc] Add criu in built jdk
Browse files Browse the repository at this point in the history
Summary: as title

Testing: CICD

Reviewers: denghui.ddh,lingjun.cg

Issue: dragonwell-project#870
  • Loading branch information
Accelerator1996 committed Oct 17, 2024
1 parent abd83af commit fc2201a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
39 changes: 39 additions & 0 deletions .github/actions/build-serverless-adapter/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,45 @@ runs:
cp -f serverless-adapter/output/libloadclassagent.so ${{ steps.bundle_decompress.outputs.java_home }}/lib/serverless/libloadclassagent.so
shell: bash

- name: 'Get latest criu release'
id: get_criu_release
uses: actions/github-script@v6
with:
script: |
const repoOwner = 'dragonwell-project';
const repoName = 'criu';
const { data: release } = await github.rest.repos.getLatestRelease({
owner: repoOwner,
repo: repoName,
});
return release;
- name: 'Download asset and copy into jdk'
run: |
if [ "${{ inputs.platform }}" = "linux-aarch64" ];then
keyword=arm64
elif [ "${{ inputs.platform }}" = "linux-x64" ];then
keyword=x64
else
echo "unsupport platform ${{ inputs.platform }}"
exit 1
fi
url=""
echo "${{ steps.get_criu_release.outputs.assets }}" | jq -c '.[]' | while read asset; do
name="$(echo ${asset} | jq -r '.name')"
if [ -n "$(echo ${name} | grep ${keyword})" ];then
url="$(echo ${asset} | jq -r '.url')"
break
fi
done
if [ -n "${url}" ];then
curl -OLSk -C - --retry 5 ${url} -o criu.tar.gz
tar zxvf criu.tar.gz
chmod +x criu
mv criu ${{ steps.bundle_decompress.outputs.java_home }}/lib/
fi
shell: bash

- name: 'Regenerate bundle'
run: |
cd ${{ steps.bundle_decompress.outputs.bundle_home }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ jobs:
else
extra_packages=
fi
sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages
sudo apt-get install -y gcc-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} g++-${{ inputs.gcc-major-version }}${{ inputs.gcc-package-suffix }} libxrandr-dev${{ steps.arch.outputs.suffix }} libxtst-dev${{ steps.arch.outputs.suffix }} libcups2-dev${{ steps.arch.outputs.suffix }} libasound2-dev${{ steps.arch.outputs.suffix }} ${{ inputs.apt-extra-packages }} $extra_packages jq
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
if: inputs.platform != 'linux-aarch64'

Expand Down

0 comments on commit fc2201a

Please sign in to comment.