Skip to content

Commit b46c9d4

Browse files
author
Delphix User
committed
Merge remote-tracking branch 'origin/6.0/stage' into 6.0/release
2 parents feeea12 + 89d357e commit b46c9d4

File tree

9 files changed

+179
-34
lines changed

9 files changed

+179
-34
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
tmp/
22
/artifacts/
3+
.idea

buildpkg.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function usage() {
3939
echo " -c also run package's checkstyle hook."
4040
echo " -r override default revision for package."
4141
echo " -h display this message and exit."
42+
echo " -l use locally-built dependencies instead of s3 versions."
4243
echo ""
4344
exit 2
4445
}
@@ -48,13 +49,15 @@ unset PARAM_PACKAGE_GIT_BRANCH
4849
unset PARAM_PACKAGE_REVISION
4950

5051
do_checkstyle=false
51-
while getopts ':b:cg:hr:' c; do
52+
source="s3"
53+
while getopts ':b:cg:hlr:' c; do
5254
case "$c" in
5355
g) export PARAM_PACKAGE_GIT_URL="$OPTARG" ;;
5456
b) export PARAM_PACKAGE_GIT_BRANCH="$OPTARG" ;;
5557
r) export PARAM_PACKAGE_REVISION="$OPTARG" ;;
5658
c) do_checkstyle=true ;;
5759
h) usage >&2 ;;
60+
l) source="local" ;;
5861
*) usage "illegal option -- $OPTARG" >&2 ;;
5962
esac
6063
done
@@ -86,7 +89,7 @@ logmust cd "$WORKDIR"
8689
stage fetch
8790

8891
logmust cd "$WORKDIR"
89-
stage fetch_dependencies
92+
stage fetch_dependencies $source
9093

9194
logmust cd "$WORKDIR"
9295
stage prepare

default-package-config.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ function kernel_build() {
155155
local build_deps_tool="apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends --yes"
156156
logmust sudo mk-build-deps --install debian/control --tool "${build_deps_tool}"
157157

158+
#
159+
# Here we update the configs used to control the kernel's build
160+
# system. This is useful as it allows us to override various
161+
# kernel config options via an OVERRIDES file, which we use to
162+
# disable varous kernel modules that we don't need or want.
163+
#
164+
logmust fakeroot debian/rules updateconfigs "${debian_rules_args[@]}"
165+
158166
logmust fakeroot debian/rules "binary" "${debian_rules_args[@]}"
159167

160168
logmust cd "$WORKDIR"

lib/common.sh

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,15 @@ function check_git_ref() {
214214
#
215215
function stage() {
216216
typeset hook=$1
217+
shift 1
217218

218219
check_env PACKAGE
219220
local stage_start=$SECONDS
220221

221222
echo ""
222223
if type -t "$hook" >/dev/null; then
223224
echo_bold "PACKAGE $PACKAGE: STAGE $hook STARTED"
224-
logmust "$hook"
225+
logmust "$hook" "$@"
225226
echo_bold "PACKAGE $PACKAGE: STAGE $hook COMPLETED in" \
226227
"$((SECONDS - stage_start)) seconds"
227228
else
@@ -574,8 +575,16 @@ function list_linux_kernel_packages() {
574575

575576
function install_shfmt() {
576577
if [[ ! -f /usr/local/bin/shfmt ]]; then
578+
local arch
579+
arch=$(dpkg-architecture -q DEB_HOST_ARCH)
580+
581+
# The release names for shfmt don't use the actual
582+
# architecture strings, unfortunately.
583+
if [[ "$arch" == "arm64" ]]; then
584+
arch="arm"
585+
fi
577586
logmust sudo wget -nv -O /usr/local/bin/shfmt \
578-
https://github.com/mvdan/sh/releases/download/v2.4.0/shfmt_v2.4.0_linux_amd64
587+
https://github.com/mvdan/sh/releases/download/v2.4.0/shfmt_v2.4.0_linux_$arch
579588
logmust sudo chmod +x /usr/local/bin/shfmt
580589
fi
581590
echo "shfmt version $(shfmt -version) is installed."
@@ -699,6 +708,7 @@ function get_package_dependency_s3_url() {
699708
# is defined in the package's config.
700709
#
701710
function fetch_dependencies() {
711+
local source="$1"
702712
export DEPDIR="$WORKDIR/dependencies"
703713
logmust mkdir "$DEPDIR"
704714
logmust cd "$DEPDIR"
@@ -712,22 +722,31 @@ function fetch_dependencies() {
712722
for dep in $PACKAGE_DEPENDENCIES; do
713723
echo "Fetching artifacts for dependency '$dep' ..."
714724
get_package_prefix "$dep"
715-
s3urlvar="${_RET}_S3_URL"
716-
if [[ -n "${!s3urlvar}" ]]; then
717-
s3url="${!s3urlvar}"
718-
echo "S3 URL of package dependency '$dep' provided" \
719-
"externally"
720-
echo "$s3urlvar=$s3url"
721-
else
722-
logmust get_package_dependency_s3_url "$dep"
723-
s3url="$_RET"
724-
fi
725-
[[ "$s3url" != */ ]] && s3url="$s3url/"
726-
logmust mkdir "$dep"
727-
logmust aws s3 ls "$s3url"
728-
logmust aws s3 cp --only-show-errors --recursive "$s3url" "$dep/"
729-
echo_bold "Fetched artifacts for '$dep' from $s3url"
730-
PACKAGE_DEPENDENCIES_METADATA="${PACKAGE_DEPENDENCIES_METADATA}$dep: $s3url\\n"
725+
case "$source" in
726+
"local")
727+
logmust cp -r "$WORKDIR/../../$dep/tmp/artifacts/ $dep/"
728+
;;
729+
"s3")
730+
s3urlvar="${_RET}_S3_URL"
731+
if [[ -n "${!s3urlvar}" ]]; then
732+
s3url="${!s3urlvar}"
733+
echo "S3 URL of package dependency '$dep' provided externally"
734+
echo "$s3urlvar=$s3url"
735+
else
736+
logmust get_package_dependency_s3_url "$dep"
737+
s3url="$_RET"
738+
fi
739+
[[ "$s3url" != */ ]] && s3url="$s3url/"
740+
logmust mkdir "$dep"
741+
logmust aws s3 ls "$s3url"
742+
logmust aws s3 cp --only-show-errors --recursive "$s3url" "$dep/"
743+
echo_bold "Fetched artifacts for '$dep' from $s3url"
744+
PACKAGE_DEPENDENCIES_METADATA="${PACKAGE_DEPENDENCIES_METADATA}$dep: $s3url\\n"
745+
;;
746+
*)
747+
die "invalid source parameter specified: '$source'"
748+
;;
749+
esac
731750
done
732751
}
733752

packages/adoptopenjdk/config.sh

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,36 @@
1919
DEFAULT_PACKAGE_GIT_URL=none
2020
PACKAGE_DEPENDENCIES="make-jpkg"
2121

22-
if [[ "$UPSTREAM_PRODUCT_BRANCH" == "master" ]]; then
23-
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u342b07.tar.gz"
24-
_tarfile_sha256="8252c0e11d542ea0f9ce6b8f147d1a2bea4a17e9fc299da270288f5a4f35b1f3"
22+
case $(dpkg-architecture -q DEB_HOST_ARCH 2>/dev/null || echo "none") in
23+
amd64)
24+
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u345b01.tar.gz"
25+
_tarfile_sha256="ed6c9db3719895584fb1fd69fc79c29240977675f26631911c5a1dbce07b7d58"
2526
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
26-
else
27-
_tarfile="OpenJDK8U-jdk_x64_linux_hotspot_8u332b09.tar.gz"
28-
_tarfile_sha256="adc13a0a0540d77f0a3481b48f10d61eb203e5ad4914507d489c2de3bd3d83da"
29-
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-amd64"
30-
fi
27+
;;
28+
arm64)
29+
_tarfile="OpenJDK8U-jdk_aarch64_linux_hotspot_8u345b01.tar.gz"
30+
_tarfile_sha256="c1965fb24dded7d7944e2da36cd902adf3b7b1d327aaa21ea507cff00a5a0090"
31+
_jdk_path="/usr/lib/jvm/adoptopenjdk-java8-jdk-arm64"
32+
;;
33+
*) ;;
34+
35+
esac
3136

3237
function prepare() {
3338
logmust install_pkgs "$DEPDIR"/make-jpkg/*.deb
3439
}
3540

3641
function fetch() {
42+
# We exit here rather than above in the architecture detection logic
43+
# to deal with the fact that this file can, during test runs, be
44+
# sourced on platforms where builds are not happening. list-packages
45+
# sources the file to gather information about the package, and this
46+
# is performed on jenkins and macos during test runs. Having the exit
47+
# occur above causes those runs to fail.
48+
if [[ -z "$_tarfile" ]]; then
49+
echo "Invalid architecture detected" >&2
50+
exit 1
51+
fi
3752
logmust cd "$WORKDIR/"
3853

3954
local url="http://artifactory.delphix.com/artifactory/java-binaries/linux/jdk/8/$_tarfile"
@@ -42,6 +57,10 @@ function fetch() {
4257
}
4358

4459
function build() {
60+
if [[ -z "$_tarfile" ]]; then
61+
echo "Invalid architecture detected" >&2
62+
exit 1
63+
fi
4564
logmust cd "$WORKDIR/"
4665

4766
logmust env DEB_BUILD_OPTIONS=nostrip fakeroot make-jpkg "$_tarfile" <<<y

packages/challenge-response/config.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ function prepare() {
2828
function build() {
2929
logmust cd "$WORKDIR/repo/challenge_response"
3030
logmust make package
31-
logmust mv ./x86_64/*deb "$WORKDIR/artifacts/"
31+
logmust mv "./$(dpkg-architecture -q DEB_HOST_GNU_CPU)"/*deb "$WORKDIR/artifacts/"
3232
}

packages/containerized-masking/config.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,32 @@ function build() {
4040

4141
logmust cd "$WORKDIR/repo"
4242

43+
if [[ "$SECRET_DB_AWS_ENDPOINT" ]]; then
44+
export SECRET_DB_AWS_ENDPOINT="$SECRET_DB_AWS_ENDPOINT"
45+
fi
46+
47+
# Using secrets proxy
48+
if [[ "$SECRET_DB_USE_JUMPBOX" ]]; then
49+
export SECRET_DB_USE_JUMPBOX="$SECRET_DB_USE_JUMPBOX"
50+
fi
51+
if [[ "$SECRET_DB_JUMP_BOX_HOST" ]]; then
52+
export SECRET_DB_JUMP_BOX_HOST="$SECRET_DB_JUMP_BOX_HOST"
53+
fi
54+
if [[ "$SECRET_DB_JUMP_BOX_USER" ]]; then
55+
export SECRET_DB_JUMP_BOX_USER="$SECRET_DB_JUMP_BOX_USER"
56+
fi
57+
if [[ "$SECRET_DB_JUMP_BOX_PRIVATE_KEY" ]]; then
58+
export SECRET_DB_JUMP_BOX_PRIVATE_KEY="$SECRET_DB_JUMP_BOX_PRIVATE_KEY"
59+
fi
60+
61+
# Using master/eng-secret-user
62+
if [[ "$SECRET_DB_AWS_PROFILE" ]]; then
63+
export SECRET_DB_AWS_PROFILE="$SECRET_DB_AWS_PROFILE"
64+
fi
65+
if [[ "$SECRET_DB_AWS_REGION" ]]; then
66+
export SECRET_DB_AWS_REGION="$SECRET_DB_AWS_REGION"
67+
fi
68+
4369
logmust ./gradlew --no-daemon --stacktrace \
4470
-Porg.gradle.configureondemand=false \
4571
-PenvironmentName=linuxappliance \

packages/masking/config.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ function build() {
4343
'{ "dms-core-gate" : { "git-hash" : $h, "date": $d }}' \
4444
>"$WORKDIR/artifacts/metadata.json"
4545

46+
if [[ "$SECRET_DB_AWS_ENDPOINT" ]]; then
47+
export SECRET_DB_AWS_ENDPOINT="$SECRET_DB_AWS_ENDPOINT"
48+
fi
49+
50+
# Using secrets proxy
51+
if [[ "$SECRET_DB_USE_JUMPBOX" ]]; then
52+
export SECRET_DB_USE_JUMPBOX="$SECRET_DB_USE_JUMPBOX"
53+
fi
54+
if [[ "$SECRET_DB_JUMP_BOX_HOST" ]]; then
55+
export SECRET_DB_JUMP_BOX_HOST="$SECRET_DB_JUMP_BOX_HOST"
56+
fi
57+
if [[ "$SECRET_DB_JUMP_BOX_USER" ]]; then
58+
export SECRET_DB_JUMP_BOX_USER="$SECRET_DB_JUMP_BOX_USER"
59+
fi
60+
if [[ "$SECRET_DB_JUMP_BOX_PRIVATE_KEY" ]]; then
61+
export SECRET_DB_JUMP_BOX_PRIVATE_KEY="$SECRET_DB_JUMP_BOX_PRIVATE_KEY"
62+
fi
63+
64+
# Using master/eng-secret-user
65+
if [[ "$SECRET_DB_AWS_PROFILE" ]]; then
66+
export SECRET_DB_AWS_PROFILE="$SECRET_DB_AWS_PROFILE"
67+
fi
68+
if [[ "$SECRET_DB_AWS_REGION" ]]; then
69+
export SECRET_DB_AWS_REGION="$SECRET_DB_AWS_REGION"
70+
fi
71+
4672
logmust ./gradlew --no-daemon --stacktrace \
4773
-Porg.gradle.configureondemand=false \
4874
-PenvironmentName=linuxappliance \

packages/virtualization/config.sh

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,57 @@ function build() {
5656
# Build the virtualization package
5757
#
5858
logmust cd "$WORKDIR/repo/appliance"
59+
60+
local args=()
61+
62+
# Here we check for whether the environment variables are set and pass them along. We check for
63+
# existence instead of emptiness to avoid adding a layer of interpretation.
64+
65+
# We use parameter expansion in the form of ${variable+nothing} which evaluates to the variable
66+
# 'nothing' if 'variable' is not set. Because 'nothing' is not defined it evaluates to "" when 'variable'
67+
# is not set. So [[ "" ]] is what is actually evaluated when 'variable' is not set.
68+
69+
if [[ ${SECRET_DB_USE_JUMPBOX+nothing} ]]; then
70+
args+=("-DSECRET_DB_USE_JUMPBOX=$SECRET_DB_USE_JUMPBOX")
71+
fi
72+
73+
if [[ ${SECRET_DB_JUMP_BOX_HOST+nothing} ]]; then
74+
args+=("-DSECRET_DB_JUMP_BOX_HOST=$SECRET_DB_JUMP_BOX_HOST")
75+
fi
76+
77+
if [[ ${SECRET_DB_JUMP_BOX_USER+nothing} ]]; then
78+
args+=("-DSECRET_DB_JUMP_BOX_USER=$SECRET_DB_JUMP_BOX_USER")
79+
fi
80+
81+
if [[ ${SECRET_DB_JUMP_BOX_PRIVATE_KEY+nothing} ]]; then
82+
if [[ ! -f "$SECRET_DB_JUMP_BOX_PRIVATE_KEY" ]]; then
83+
die "Jumpbox private key not found."
84+
fi
85+
args+=("-DSECRET_DB_JUMP_BOX_PRIVATE_KEY=$SECRET_DB_JUMP_BOX_PRIVATE_KEY")
86+
fi
87+
88+
if [[ ${SECRET_DB_AWS_ENDPOINT+nothing} ]]; then
89+
args+=("-DSECRET_DB_AWS_ENDPOINT=$SECRET_DB_AWS_ENDPOINT")
90+
fi
91+
92+
if [[ ${SECRET_DB_AWS_PROFILE+nothing} ]]; then
93+
args+=("-DSECRET_DB_AWS_PROFILE=$SECRET_DB_AWS_PROFILE")
94+
fi
95+
96+
if [[ ${SECRET_DB_AWS_REGION+nothing} ]]; then
97+
args+=("-DSECRET_DB_AWS_REGION=$SECRET_DB_AWS_REGION")
98+
fi
99+
100+
args+=("-Ddockerize=true")
101+
args+=("-DbuildJni=true")
102+
59103
if [[ -n "$DELPHIX_RELEASE_VERSION" ]]; then
60-
logmust ant -Ddockerize=true -DbuildJni=true \
61-
-DhotfixGenDlpxVersion="$DELPHIX_RELEASE_VERSION" \
62-
-Dbuild.legacy.resources.war=true all package
63-
else
64-
logmust ant -Ddockerize=true -DbuildJni=true all package
104+
args+=("-DhotfixGenDlpxVersion=$DELPHIX_RELEASE_VERSION")
105+
args+=("-Dbuild.legacy.resources.war=true")
65106
fi
66107

108+
logmust ant "${args[@]}" all-secrets package
109+
67110
#
68111
# Publish the virtualization package artifacts
69112
#

0 commit comments

Comments
 (0)