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: #870
  • Loading branch information
Accelerator1996 committed Oct 17, 2024
1 parent abd83af commit 1d1ce6d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#

name: 'Build serverless-adapter'
name: 'Build additional components'
description: 'Build it using built JDK'
inputs:
platform:
Expand Down 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
8 changes: 4 additions & 4 deletions .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 Expand Up @@ -143,9 +143,9 @@ jobs:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'

- name: 'Build serverless-adapter'
id: build-serverless-adapter
uses: ./.github/actions/build-serverless-adapter
- name: 'Build additional components'
id: build-additional-components
uses: ./.github/actions/build-additional-components
with:
platform: ${{ inputs.platform }}
debug-suffix: '${{ matrix.suffix }}'
Expand Down

0 comments on commit 1d1ce6d

Please sign in to comment.