Skip to content

Commit 262dd13

Browse files
committed
Merge remote-tracking branch 'origin/6.0/stage' into 6.0/release
2 parents 9c8192c + 8584c98 commit 262dd13

8 files changed

Lines changed: 240 additions & 21 deletions

File tree

default-package-config.sh

Lines changed: 43 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ function kernel_build() {
6161
# debian/rules command, the rightmost declaration
6262
# is the one that is actually used.
6363
#
64-
local debian_rules_extra_args="$2"
64+
shift
65+
local debian_rules_extra_args=("$@")
6566

6667
logmust cd "$WORKDIR/repo"
6768

@@ -91,7 +92,7 @@ function kernel_build() {
9192
#
9293
local canonical_abinum delphix_abinum kernel_release kernel_version
9394
canonical_abinum=$(fakeroot debian/rules printenv | grep -E '^abinum ' | cut -d= -f2 | tr -d '[:space:]')
94-
delphix_abinum="dlpx-$(date -u +"%Y%m%dt%H%M%S")-$(git rev-parse --short HEAD)-${canonical_abinum}"
95+
delphix_abinum="${canonical_abinum}-$(date -u +"dx%Y%m%d%H")-$(git rev-parse --short HEAD)"
9596
kernel_release=$(fakeroot debian/rules printenv | grep -E '^release ' | cut -d= -f2 | tr -d '[:space:]')
9697

9798
#
@@ -113,20 +114,35 @@ function kernel_build() {
113114
# disable_d_i=true
114115
# This prevents udeb packages from being built as they are
115116
# not consumed by the Delphix Appliance.
116-
#
117-
local debian_rules_args="skipdbg=false uefi_signed=false disable_d_i=true flavours=$platform abinum=${delphix_abinum} ${debian_rules_extra_args}"
117+
# do_dkms_*=false
118+
# This disables the build of various out-of-tree kernel modules
119+
# that we do not use in our product or that we provide separately.
120+
#
121+
local debian_rules_args=(
122+
"skipdbg=false"
123+
"uefi_signed=false"
124+
"disable_d_i=true"
125+
"do_zfs=false"
126+
"do_dkms_nvidia=false"
127+
"do_dkms_nvidia_server=false"
128+
"do_dkms_vbox=false"
129+
"do_dkms_wireguard=false"
130+
"flavours=$platform"
131+
"abinum=${delphix_abinum}"
132+
)
133+
debian_rules_args+=("${debian_rules_extra_args[@]}")
118134

119135
#
120136
# Clean up everything generated so far and recreate the
121137
# final control file with the arguments that we want.
122138
#
123-
logmust fakeroot debian/rules clean ${debian_rules_args}
139+
logmust fakeroot debian/rules clean "${debian_rules_args[@]}"
124140

125141
#
126142
# Print the environment configuration solely for
127143
# debugging purposes.
128144
#
129-
logmust fakeroot debian/rules printenv ${debian_rules_args}
145+
logmust fakeroot debian/rules printenv "${debian_rules_args[@]}"
130146

131147
#
132148
# The default value of the tool argument for mk-build-deps
@@ -139,7 +155,7 @@ function kernel_build() {
139155
local build_deps_tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes"
140156
logmust sudo mk-build-deps --install debian/control --tool "${build_deps_tool}"
141157

142-
logmust fakeroot debian/rules "binary" ${debian_rules_args}
158+
logmust fakeroot debian/rules "binary" "${debian_rules_args[@]}"
143159

144160
logmust cd "$WORKDIR"
145161
logmust mv ./*deb "artifacts/"
@@ -220,24 +236,24 @@ function kernel_update_upstream() {
220236
# Note that "generic" (used mainly ESX) is a special
221237
# case as we are currently using the HWE kernel image.
222238
#
223-
local tag_prefix
239+
local tag_prefix_flavour
224240
if [[ "${platform}" == generic ]] &&
225241
[[ "$UBUNTU_DISTRIBUTION" == bionic ]]; then
226-
tag_prefix="Ubuntu-hwe-${kernel_version}-${abinum}"
242+
tag_prefix_flavour="Ubuntu-hwe"
227243
elif [[ "${platform}" == aws ]] ||
228244
[[ "${platform}" == azure ]] ||
229245
[[ "${platform}" == gcp ]] ||
230246
[[ "${platform}" == oracle ]]; then
231-
232-
local kvers_major kvers_minor short_kvers
233-
kvers_major=$(echo "${kernel_version}" | cut -d '.' -f 1)
234-
kvers_minor=$(echo "${kernel_version}" | cut -d '.' -f 2)
235-
short_kvers="${kvers_major}.${kvers_minor}"
236-
237-
tag_prefix="Ubuntu-${platform}-${short_kvers}-${kernel_version}-${abinum}"
247+
tag_prefix_flavour="Ubuntu-${platform}"
238248
else
239249
die "assertion: unexpected platform: ${platform}"
240250
fi
251+
252+
local tag_prefix kvers_major kvers_minor short_kvers
253+
kvers_major=$(echo "${kernel_version}" | cut -d '.' -f 1)
254+
kvers_minor=$(echo "${kernel_version}" | cut -d '.' -f 2)
255+
short_kvers="${kvers_major}.${kvers_minor}"
256+
tag_prefix="${tag_prefix_flavour}-${short_kvers}-${kernel_version}-${abinum}"
241257
echo "note: upstream tag prefix used: ${tag_prefix}"
242258

243259
#
@@ -274,8 +290,18 @@ function kernel_update_upstream() {
274290

275291
logmust git fetch upstream "+refs/tags/${upstream_tag}:refs/tags/${upstream_tag}"
276292

293+
#
294+
# Note that we add '^{}' at the end to dereference the tag recursively
295+
# until it arrives to an actual commit. This is needed in case the
296+
# tag points to an anotated tag object which contains extra information
297+
# such as a PGP signature. That annoted tag will in turn reference the
298+
# actual commit, which will be returned when appending ^{}.
299+
# upstream-HEAD will be pointing to the commit directly rather than the
300+
# annoted tag object, so if we want to compare the two we need to query
301+
# for the dereferenced commit. See 'git help gitrevisions' for more info.
302+
#
277303
local upstream_tag_commit
278-
upstream_tag_commit="$(git rev-parse "refs/tags/${upstream_tag}")" ||
304+
upstream_tag_commit="$(git rev-parse "refs/tags/${upstream_tag}^{}")" ||
279305
die "couldn't get commit of tag ${upstream_tag}"
280306
echo "note: upstream tag: ${upstream_tag}, commit ${upstream_tag_commit}"
281307

lib/common.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export UBUNTU_DISTRIBUTION="bionic"
3535
# 2. "archive": dowloading from apt
3636
# 3. "prebuilt": pre-built kernel stored in artifactory
3737
#
38-
export DEFAULT_LINUX_KERNEL_PACKAGE_SOURCE="prebuilt"
38+
export DEFAULT_LINUX_KERNEL_PACKAGE_SOURCE="delphix"
3939

4040
# shellcheck disable=SC2086
4141
function enable_colors() {
@@ -89,7 +89,7 @@ function die() {
8989
}
9090

9191
function logmust() {
92-
echo Running: "$@"
92+
[[ "$LOGGING" == "false" ]] || echo Running: "$@" >&2
9393
"$@" || die "failed command '$*'"
9494
}
9595

@@ -470,7 +470,7 @@ function install_pkgs() {
470470
echo "Running: sudo env DEBIAN_FRONTEND=noninteractive " \
471471
"apt-get install -y $*"
472472
sudo env DEBIAN_FRONTEND=noninteractive apt-get install \
473-
-y "$@" && return
473+
-y --allow-downgrades "$@" && return
474474
echo "apt-get install failed, retrying."
475475
sleep 10
476476
done

package-lists/build/main.pkgs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ grub2
1818
libkdumpfile
1919
make-jpkg
2020
makedumpfile
21+
masking
2122
misc-debs
2223
nfs-utils
2324
performance-diagnostics
@@ -27,3 +28,4 @@ recovery-environment
2728
savedump
2829
sdb
2930
targetcli-fb
31+
virtualization

package-lists/update/main.pkgs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ crash
1717
drgn
1818
grub2
1919
libkdumpfile
20+
linux-kernel-aws
21+
linux-kernel-azure
22+
linux-kernel-gcp
23+
linux-kernel-generic
24+
linux-kernel-oracle
2025
makedumpfile
2126
nfs-utils
2227
python-rtslib-fb

packages/masking/config.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2021 Delphix
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# shellcheck disable=SC2034
18+
19+
DEFAULT_PACKAGE_GIT_URL="https://gitlab.delphix.com/masking/dms-core-gate.git"
20+
PACKAGE_DEPENDENCIES="adoptopenjdk"
21+
22+
function prepare() {
23+
logmust install_pkgs "$DEPDIR"/adoptopenjdk/*.deb
24+
}
25+
26+
function build() {
27+
export JAVA_HOME
28+
JAVA_HOME=$(cat "$DEPDIR/adoptopenjdk/JDK_PATH") ||
29+
die "Failed to read $DEPDIR/adoptopenjdk/JDK_PATH"
30+
31+
logmust cd "$WORKDIR/repo"
32+
33+
#
34+
# The "appliance-build-stage0" Jenkins job consumes this file,
35+
# along with various other files (e.g. licensing metadata).
36+
# Thus, if we don't generate it here, the Jenkins job that
37+
# builds the appliance will fail.
38+
#
39+
# shellcheck disable=SC2016
40+
logmust jq -n \
41+
--arg h "$(git rev-parse HEAD)" \
42+
--arg d "$(date --utc --iso-8601=seconds)" \
43+
'{ "dms-core-gate" : { "git-hash" : $h, "date": $d }}' \
44+
>"$WORKDIR/artifacts/metadata.json"
45+
46+
logmust ./gradlew --no-daemon --stacktrace \
47+
-Porg.gradle.configureondemand=false \
48+
-PenvironmentName=linuxappliance \
49+
clean \
50+
generateLicenseReport \
51+
:dist:distDeb \
52+
:dist:distLicenseReport
53+
54+
logmust rsync -av dist/build/distributions/ "$WORKDIR/artifacts/"
55+
logmust cp -v \
56+
dist/build/reports/dependency-license/* "$WORKDIR/artifacts/"
57+
}

packages/virtualization/config.sh

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
#!/bin/bash
2+
#
3+
# Copyright 2021 Delphix
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# shellcheck disable=SC2034
18+
19+
DEFAULT_PACKAGE_GIT_URL="https://gitlab.delphix.com/app/dlpx-app-gate.git"
20+
PACKAGE_DEPENDENCIES="adoptopenjdk crypt-blowfish misc-debs"
21+
22+
function prepare() {
23+
logmust install_pkgs \
24+
ant \
25+
gcc \
26+
libcairo2 \
27+
libcurl4-openssl-dev \
28+
libjbig0 \
29+
libnss3-dev \
30+
libnss3-dbg \
31+
libnss3-tools \
32+
libpam0g-dev \
33+
libpixman-1-0 \
34+
libssl-dev \
35+
libtiff5 \
36+
libxcb-render0 \
37+
libxcb-shm0 \
38+
python-jira \
39+
python-requests \
40+
rsync
41+
42+
logmust install_pkgs \
43+
"$DEPDIR"/adoptopenjdk/*.deb \
44+
"$DEPDIR"/crypt-blowfish/*.deb \
45+
"$DEPDIR"/misc-debs/unzip_6.0-21ubuntu1_amd64.deb
46+
}
47+
48+
function build() {
49+
export JAVA_HOME
50+
JAVA_HOME=$(cat "$DEPDIR/adoptopenjdk/JDK_PATH") ||
51+
die "Failed to read $DEPDIR/adoptopenjdk/JDK_PATH"
52+
53+
export LANG
54+
LANG=en_US.UTF-8
55+
56+
logmust cd "$WORKDIR/repo"
57+
58+
#
59+
# The "appliance-build-stage0" Jenkins job consumes this file,
60+
# along with various other files (e.g. licensing metadata).
61+
# Thus, if we don't generate it here, the Jenkins job that
62+
# builds the appliance will fail.
63+
#
64+
# shellcheck disable=SC2016
65+
logmust jq -n \
66+
--arg h "$(git rev-parse HEAD)" \
67+
--arg d "$(date --utc --iso-8601=seconds)" \
68+
'{ "dlpx-app-gate" : { "git-hash" : $h, "date": $d }}' \
69+
>"$WORKDIR/artifacts/metadata.json"
70+
71+
#
72+
# Build the virtualization package
73+
#
74+
logmust cd "$WORKDIR/repo/appliance"
75+
if [[ -n "$DELPHIX_RELEASE_VERSION" ]]; then
76+
logmust ant -Ddockerize=true -DbuildJni=true \
77+
-DhotfixGenDlpxVersion="$DELPHIX_RELEASE_VERSION" \
78+
all package
79+
else
80+
logmust ant -Ddockerize=true -DbuildJni=true all package
81+
fi
82+
83+
#
84+
# Publish the virtualization package artifacts
85+
#
86+
logmust cd "$WORKDIR/repo/appliance"
87+
logmust rsync -av packaging/build/distributions/ "$WORKDIR/artifacts/"
88+
logmust cp -vr \
89+
bin/out/common/com.delphix.common/uem/tars \
90+
"$WORKDIR/artifacts/hostchecker2"
91+
logmust cp -v \
92+
server/api/build/api/json-schemas/delphix.json \
93+
"$WORKDIR/artifacts"
94+
logmust cp -v \
95+
dist/server/opt/delphix/client/etc/api.ini \
96+
"$WORKDIR/artifacts"
97+
logmust cp -v \
98+
packaging/build/reports/dependency-license/* \
99+
"$WORKDIR/artifacts/"
100+
101+
#
102+
# Build the "toolkit-devkit" artifacts
103+
#
104+
logmust cd "$WORKDIR/repo/appliance/toolkit"
105+
if [[ -n "$DELPHIX_RELEASE_VERSION" ]]; then
106+
logmust ant \
107+
-Dversion.number="$DELPHIX_RELEASE_VERSION" \
108+
toolkit-devkit
109+
else
110+
logmust ant \
111+
"-Dversion.number=$(date --utc +%Y-%m-%d-%H-%m)" \
112+
toolkit-devkit
113+
fi
114+
115+
#
116+
# Publish the "toolkit-devkit" artifacts
117+
#
118+
logmust cd "$WORKDIR/repo/appliance"
119+
logmust mkdir -p "$WORKDIR/artifacts/hostchecker2"
120+
logmust cp -v toolkit/toolkit-devkit.tar "$WORKDIR/artifacts"
121+
}

query-packages.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
1919
TOP="$PWD"
2020
source "$TOP/lib/common.sh"
2121

22+
#
23+
# Disable "logmust" output as that is unnecessary here, and actually
24+
# trips up some of our testing (e.g. verify-query-packages.sh).
25+
#
26+
export LOGGING=false
27+
2228
ALL_OUTPUT_FIELDS=(name git-url dependencies can-update)
2329

2430
function usage() {

setup.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,14 @@ logmust sudo apt-get update
9393
# build dependencies from a control file.
9494
# - install_shfmt and shellcheck are needed for - make check - to be able to
9595
# make sure style checks are fine.
96+
# - jq is used to generate a JSON formatted metadata file by some packages.
9697
#
9798
logmust install_pkgs \
9899
debhelper \
99100
devscripts \
100101
equivs \
101-
shellcheck
102+
shellcheck \
103+
jq
102104

103105
logmust install_shfmt
104106

0 commit comments

Comments
 (0)