154 lines (136 loc) · 5.74 KB
/
build-deploy-linux-cuda-10.2-arm64.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
on:
workflow_dispatch:
inputs:
buildThreads:
description: 'Build threads for libnd4j. Used to control memory usage of builds.'
required: true
default: 4
deployToReleaseStaging:
description: 'Whether to deploy to release staging or not.'
required: false
default: 0
releaseVersion:
description: 'Release version target'
required: false
default: 1.0.0-M3
serverId:
description: 'Server id to publish to'
required: false
default: ossrh
snapshotVersion:
description: 'Snapshot version target'
required: false
default: 1.0.0-SNAPSHOT
releaseRepoId:
description: 'Release repository id'
required: false
default:
mvnFlags:
description: "Extra maven flags (must escape input yourself if used)"
required: false
default:
libnd4jUrl:
description: 'Sets a libnd4j download url for this build. LIBND4J_HOME will automatically be set. Should be used when only needing to build other modules.'
required: false
default:
runsOn:
description: 'System to run on'
required: false
default: ubuntu-20.04
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
linux-arm64:
runs-on: ${{ github.event.inputs.runsOn }}
steps:
- uses: AutoModality/action-clean@v1
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
- uses: ./.github/actions/set-linux-distro-version
- uses: ./.github/actions/update-deps-linux
- uses: konduitai/cuda-install/.github/actions/install-cuda-ubuntu@master
env:
cuda: 10.2
GCC: 7
- name: Cache cmake install
uses: actions/cache@v2
id: cache-cmake
with:
path: /opt/cmake
key: ${{ runner.os }}-cmake
restore-keys: ${{ runner.os }}-cmake
- name: Cache protobuf install
uses: actions/cache@v2
id: cache-protobuf
with:
path: /opt/protobuf
key: ${{ runner.os }}-protobuf
restore-keys: ${{ runner.os }}-protobuf
- uses: ./.github/actions/install-protobuf-linux
if: steps.cache-protobuf.outputs.cache-hit != 'true'
- uses: ./.github/actions/install-cmake-linux
if: steps.cache-cmake.outputs.cache-hit != 'true'
- name: Set up Java for publishing to OSSRH
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
server-id: ${{ github.event.inputs.serverId }}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.SONATYPE_GPG_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
cache: 'maven'
- name: Build on linux-arm64
shell: bash
env:
MAVEN_GPG_KEY: ${{ secrets.SONATYPE_GPG_KEY }}
DEBIAN_FRONTEND: noninteractive
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEPLOY: 1
BUILD_USING_MAVEN: 1
TARGET_OS: linux
CURRENT_TARGET: jetson-arm64
LIBND4J_CLASSIFIER: linux-arm64
CUDA_VER: 10.2
PUBLISH_TO: ossrh
DEPLOY_TO: ossrh
MAVEN_USERNAME: ${{ secrets.SONATYPE_USER_1 }}
MAVEN_PASSWORD: ${{ secrets.SONATYPE_USER1_PASS }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.PACKAGES_GPG_PASS }}
LIBND4J_BUILD_THREADS: ${{ github.event.inputs.buildThreads }}
PROTO_EXEC: /opt/protobuf/bin/protoc
PERFORM_RELEASE: ${{ github.event.inputs.deployToReleaseStaging }}
RELEASE_VERSION: ${{ github.event.inputs.releaseVersion }}
SNAPSHOT_VERSION: ${{ github.event.inputs.snapshotVersion }}
RELEASE_REPO_ID: ${{ github.event.inputs.releaseRepoId }}
MODULES: ${{ github.event.inputs.mvnFlags }}
LIBND4J_FILE_NAME: ${{ matrix.libnd4j_file_download }}
run: |
echo "libnd4j build threads ${{ github.event.inputs.buildThreads }}"
echo "deploy to release staging repo or not ${{ github.event.inputs.deployToReleaseStaging }}"
echo "release version ${{ github.event.inputs.releaseVersion }}"
echo "snapshot version ${{ github.event.inputs.snapshotVersion }}"
echo "debug enabled ${{ github.event.inputs.debug_enabled }}"
echo "maven flags ${{ github.event.inputs.mvnFlags }}"
echo "snapshot version ${{ github.event.inputs.snapshotVersion }}"
echo "server id ${{ github.event.inputs.serverId }}"
echo "release repo id ${{ github.event.inputs.releaseRepoId }}"
sudo sysctl vm.overcommit_memory=2
export PATH=/opt/protobuf/bin:/opt/cmake/bin:$PATH
mvn --version
cmake --version
protoc --version
if ! [[ -z "$LIBND4J_FILE_NAME" ]]; then
export MODULES="$MODULES -pl :nd4j-cuda-10.2-preset,:nd4j-cuda-10.2,:nd4j-cuda-10.2-platform,:nd4j-native-api"
else
export MODULES="$MODULES -pl :nd4j-cuda-10.2-preset,:nd4j-cuda-10.2,libnd4j,:nd4j-cuda-10.2-platform,:nd4j-native-api"
fi
# download libnd4j from a url and set it up if LIBND4J_FILE_NAME is defined
bash ./bootstrap-libnd4j-from-url.sh linux cuda 10.2 arm64
${GITHUB_WORKSPACE}/libnd4j/pi_build.sh