Skip to content

Commit

Permalink
AZP/RELEASE: Add ARM release - Part openucx#3
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey-Rivkin committed Apr 9, 2023
1 parent 58bdaac commit 8ea471e
Show file tree
Hide file tree
Showing 7 changed files with 108 additions and 17 deletions.
2 changes: 1 addition & 1 deletion bindings/java/pom.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
<resource>
<directory>resources</directory>
<includes>
<include>libjucx.so</include>
<include>libjucx_*.so</include>
</includes>
</resource>
</resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class NativeLibs {
loadLibrary(UCS); // UCS library
loadLibrary(UCT); // UCT library
loadLibrary(UCP); // UCP library
loadLibrary(JUCX); // JUCX native library
loadLibrary(JUCX + "_" + System.getProperty("os.arch")); // JUCX native library
}

public static void load() {
Expand Down
13 changes: 13 additions & 0 deletions buildlib/az-helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -179,3 +179,16 @@ check_release_build() {

echo "##vso[task.setvariable variable=Launch;isOutput=true]${launch}"
}


#
# Return arch in the same format as Java System.getProperty("os.arch")
#
get_arch() {
arch=$(uname -m)
if [ "$arch" == "x86_64" ]; then
echo "amd64"
else
echo "$arch"
fi
}
24 changes: 19 additions & 5 deletions buildlib/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,23 @@ stages:
condition: eq(dependencies.Prepare.outputs['CheckRelease.Result.Launch'], 'True')
jobs:
- template: az-distro-release.yml
- template: jucx/jucx-publish.yml
parameters:
${{ if eq(variables['Build.Reason'], 'IndividualCI') }}:
target: publish-release
${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
target: package
name: x86_64
demands: ucx_docker

- template: az-distro-release.yml
parameters:
name: aarch64
demands: ucx-arm64

- template: jucx/jucx-build.yml
parameters:
name: amd64 # x86_64
container: centos7_cuda11_x86_64
demands: ucx_docker

- template: jucx/jucx-build.yml
parameters:
name: aarch64 # ARM
container: centos8_cuda11_aarch64
demands: ucx-arm64
41 changes: 41 additions & 0 deletions buildlib/jucx/jucx-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
parameters:
name:
container:
demands: []

jobs:
- job: jucx_build_${{ parameters.name }}
displayName: JUCX build ${{ parameters.name }}

# we need to use lowest version for compatibility
container: ${{ parameters.container }}
pool:
name: MLNX
demands: ${{ parameters.demands }}

steps:
- checkout: self
clean: true
fetchDepth: 100
path: "we/need/to/go/deeper"
# ^workaround agent issue with container in root path

- bash: |
set -eEx
gcc --version
./autogen.sh
./contrib/configure-release --with-java
displayName: Configure
- bash: |
set -eEx
make -s -j`nproc`
mv $(Build.Repository.LocalPath)/bindings/java/resources/libjucx.so \
$(Build.Repository.LocalPath)/bindings/java/resources/libjucx_${{ parameters.name }}.so
displayName: Build ucx
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.Repository.LocalPath)/bindings/java/resources'
artifactName: libjucx_${{ parameters.name }}.so
displayName: Midterm artifact push
33 changes: 23 additions & 10 deletions buildlib/jucx/jucx-publish.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
parameters:
temp_cfg: $(System.DefaultWorkingDirectory)/bindings/java/src/main/native/build-java/tmp-settings.xml
temp_cfg: $(System.DefaultWorkingDirectory)/bindings/java/src/main/native/tmp-settings.xml
gpg_dir: $(System.DefaultWorkingDirectory)/bindings/java/src/main/native/build-java/gpg
target: package

jobs:
- job: jucx_release
- job: jucx_publish
displayName: JUCX publish
dependsOn:
- jucx_build_amd64
- jucx_build_aarch64
condition: succeeded()

pool:
name: MLNX
demands:
- harbor_registry -equals yes
demands: ucx_docker

# we need to use lowest version for compatible
container: centos7_cuda11
container: centos7_cuda11_x86_64

steps:
- checkout: self
Expand All @@ -21,16 +25,24 @@ jobs:
path: "we/need/to/go/deeper"
# ^workaround agent issue with container in root path

- task: DownloadBuildArtifacts@0
displayName: Midterm artifacts get
inputs:
downloadType: 'specific'
itemPattern: 'libjucx_*.so/libjucx_*.so'
downloadPath: '$(System.DefaultWorkingDirectory)/bindings/java/resources'

- bash: |
set -eEx
gcc --version
./autogen.sh
./contrib/configure-release --with-java
displayName: Configure
- bash: |
set -eEx
make -s -j`nproc`
# Keep only libjucx_<platform>.so
rm -f $(Build.Repository.LocalPath)/bindings/java/resources/libjucx.so
rm $(System.DefaultWorkingDirectory)/bindings/java/src/main/native/.libs/libjucx.so*
cp $(System.DefaultWorkingDirectory)/bindings/java/resources/libjucx_*.so/libjucx_*.so \
$(System.DefaultWorkingDirectory)/bindings/java/src/main/native/.libs/
displayName: Build ucx
- bash: |
Expand All @@ -56,13 +68,14 @@ jobs:
name: publicKey

- bash: |
echo "Build target: ${{ parameters.target }}"
source buildlib/az-helpers.sh
az_init_modules
az_module_load dev/mvn
# use the lowest supported Java version for compatibility:
az_module_load dev/jdk-1.8
mvn --version
mkdir ${{ parameters.gpg_dir }}
mkdir -p ${{ parameters.gpg_dir }}
export GPG_TTY=`tty`
chmod 700 ${{ parameters.gpg_dir }}
cp $(publicKey.secureFilePath) ${{ parameters.gpg_dir }}/pubring.gpg
Expand Down
10 changes: 10 additions & 0 deletions buildlib/jucx/jucx-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ jobs:
./contrib/configure-devel --prefix=$(Build.Repository.LocalPath)/install \
--with-java --enable-gtest=no --with-cuda=$have_cuda
make -j`nproc`
# Rename libjucx.so per platform and relink
arch=$(get_arch)
mv $(Build.Repository.LocalPath)/bindings/java/resources/libjucx.so \
$(Build.Repository.LocalPath)/bindings/java/resources/libjucx_"${arch}".so
mv $(Build.Repository.LocalPath)/bindings/java/src/main/native/build-java/test-classes/libjucx.so \
$(Build.Repository.LocalPath)/bindings/java/src/main/native/build-java/test-classes/libjucx_"${arch}".so
pushd $(Build.Repository.LocalPath)/bindings/java/src/main/native/.libs/
ln -s libjucx.so.0.0.0 libjucx_"${arch}".so
popd
make install
displayName: Build UCX
- bash: |
set -xeE
source buildlib/az-helpers.sh
Expand Down

0 comments on commit 8ea471e

Please sign in to comment.