Skip to content

Commit 0670a96

Browse files
committed
feat: Bump vcpkg to 2025.02.13 with arm support
Move antlr3c into vcpkg DC: Fix for arm64 register naming Rework dockerfiles/vcpkg/build.sh to support arm Signed-off-by Gordon Smith <[email protected]>
1 parent 6c69419 commit 0670a96

27 files changed

+433
-192
lines changed

.github/workflows/build-docker.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,19 @@ on:
5858
description: 'Asset Name (if upload-package is true)'
5959
required: false
6060
default: 'build-docker-package'
61+
tag_postfix:
62+
type: string
63+
description: 'Either -arm or empty string'
64+
required: false
65+
default: ''
6166
secrets:
6267
LNB_TOKEN:
6368
required: false
6469

6570
jobs:
6671

6772
build-docker:
68-
runs-on: ubuntu-22.04
73+
runs-on: ubuntu-22.04${{ inputs.tag_postfix }}
6974
steps:
7075
- name: Free additional disk space (remove Android SDK + Tools)
7176
continue-on-error: true
@@ -112,7 +117,7 @@ jobs:
112117
vcpkg_sha_short=$(git rev-parse --short=8 HEAD)
113118
echo "vcpkg_sha_short=$vcpkg_sha_short" >> $GITHUB_OUTPUT
114119
docker_build_label=hpccsystems/platform-build-base-${{ inputs.os }}
115-
echo "docker_tag=$docker_build_label:$vcpkg_sha_short" >> $GITHUB_OUTPUT
120+
echo "docker_tag=$docker_build_label:$vcpkg_sha_short${{ inputs.tag_postfix }}" >> $GITHUB_OUTPUT
116121
117122
- name: Print vars
118123
shell: "bash"
@@ -128,12 +133,12 @@ jobs:
128133
- uses: hendrikmuhs/[email protected]
129134
with:
130135
save: ${{ inputs.update-cache == true }}
131-
key: docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }}
136+
key: docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }}
132137
restore-keys: |
133-
docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-
134-
docker-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-
135-
docker-${{ inputs.os }}-${{ inputs.build-type }}-
136-
docker-${{ inputs.os }}-
138+
docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-${{ inputs.containerized == true && 'k8s' || 'bare-metal' }}-
139+
docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-${{ steps.vars.outputs.branch_label }}-
140+
docker${{ inputs.tag_postfix }}-${{ inputs.os }}-${{ inputs.build-type }}-
141+
docker${{ inputs.tag_postfix }}-${{ inputs.os }}-
137142
138143
- name: CMake Configure and Build
139144
shell: "bash"
@@ -152,7 +157,7 @@ jobs:
152157
--mount source="${{ github.workspace }}/build",target=/hpcc-dev/build,type=bind,consistency=delegated \
153158
--mount source="${{ github.workspace }}/.ccache",target=/root/.ccache,type=bind,consistency=delegated \
154159
${{ steps.vars.outputs.docker_tag }} "\
155-
cmake -G Ninja -S /hpcc-dev/${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} -B /hpcc-dev/build -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DVCPKG_FILES_DIR=/hpcc-dev -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DCONTAINERIZED=${{ inputs.containerized == true && 'ON' || 'OFF' }} -DCPACK_STRIP_FILES=${{ inputs.strip-files == true && 'ON' || 'OFF' }} ${{ inputs.single-package == true && '-DINCLUDE_PLUGINS=ON' || '-D$plugin=ON' }} ${{ inputs.cmake-configuration }} ${{ inputs.cmake-configuration-ex }} && \
160+
cmake -G Ninja -S /hpcc-dev/${{ inputs.ln == true && 'LN' || 'HPCC-Platform' }} -B /hpcc-dev/build -DHPCC_SOURCE_DIR=/hpcc-dev/HPCC-Platform -DCMAKE_BUILD_TYPE=${{ inputs.build-type }} -DCONTAINERIZED=${{ inputs.containerized == true && 'ON' || 'OFF' }} -DCPACK_STRIP_FILES=${{ inputs.strip-files == true && 'ON' || 'OFF' }} ${{ inputs.single-package == true && '-DINCLUDE_PLUGINS=ON' || '-D$plugin=ON' }} ${{ inputs.cmake-configuration }} ${{ inputs.cmake-configuration-ex }} && \
156161
cmake --build /hpcc-dev/build --parallel ${{ inputs.upload-package == true && '--target package' || ''}}"
157162
done
158163

.github/workflows/build-vcpkg.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,29 @@ jobs:
6464
asset-name: 'docker-package'
6565
secrets: inherit
6666

67+
build-docker-ubuntu-24_04-arm:
68+
if: ${{ contains('pull_request,push', github.event_name) }}
69+
uses: ./.github/workflows/build-docker.yml
70+
with:
71+
os: ubuntu-24.04
72+
tag_postfix: "-arm"
73+
secrets: inherit
74+
6775
build-docker-ubuntu-24_04:
6876
if: ${{ contains('pull_request,push', github.event_name) }}
6977
uses: ./.github/workflows/build-docker.yml
7078
with:
7179
os: ubuntu-24.04
7280
secrets: inherit
7381

82+
build-docker-ubuntu-22_04-arm:
83+
if: ${{ contains('pull_request,push', github.event_name) }}
84+
uses: ./.github/workflows/build-docker.yml
85+
with:
86+
os: ubuntu-22.04
87+
tag_postfix: "-arm"
88+
secrets: inherit
89+
7490
build-docker-ubuntu-22_04:
7591
if: ${{ contains('pull_request,push', github.event_name) }}
7692
uses: ./.github/workflows/build-docker.yml
@@ -214,3 +230,12 @@ jobs:
214230
build-type: 'Release'
215231
cmake-configuration-ex: '-DUSE_CPPUNIT=OFF -DCLIENTTOOLS_ONLY=ON -DINCLUDE_PLUGINS=OFF -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DSUPPRESS_CASSANDRAEMBED=ON -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF'
216232
secrets: inherit
233+
234+
build-gh_runner-macos-14:
235+
if: ${{ contains('pull_request,push', github.event_name) }}
236+
uses: ./.github/workflows/build-gh_runner.yml
237+
with:
238+
os: macos-14
239+
build-type: 'Release'
240+
cmake-configuration-ex: '-DCMAKE_OSX_ARCHITECTURES=arm64 -DUSE_CPPUNIT=OFF -DCLIENTTOOLS_ONLY=ON -DINCLUDE_PLUGINS=OFF -DUSE_AZURE=OFF -DUSE_CASSANDRA=OFF -DSUPPRESS_CASSANDRAEMBED=ON -DUSE_JAVA=OFF -DUSE_OPENLDAP=OFF'
241+
secrets: inherit

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "esp/src/dgrid"]
22
path = esp/src/dgrid
33
url = https://github.com/hpcc-systems/dgrid.git
4-
[submodule "esp/services/ws_sql/libantlr3c"]
5-
path = esp/services/ws_sql/libantlr3c
6-
url = https://github.com/hpcc-systems/libantlr3c.git
74
[submodule "vcpkg"]
85
path = vcpkg
96
url = https://github.com/hpcc-systems/vcpkg.git

cmake_modules/FindANTLR.cmake

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,24 @@
1919
# ANTLR_FOUND - ANTLR found in local system
2020
# ANTLR_BUILDTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers
2121
# ANTLR_RUNTIME_JAR - The jar needed to build/generate ANTLR Lexers and Parsers
22+
# ANTLR_LIB - The runtime library needed by the generated ANTLR Lexers and Parsers
2223
################################################################################
2324

2425
include(UseJava)
2526

26-
set(ANTLR_BUILDTIME_DEP "antlr-3.4-complete" CACHE STRING "ANTLR buildtime jar file name.")
27-
set(ANTLR_RUNTIME_DEP "antlr-runtime-3.4" CACHE STRING "ANTLR runtime jar file name.")
28-
set(ANTLR_PATH "${HPCC_SOURCE_DIR}/esp/services/ws_sql/libantlr3c" CACHE PATH "Location of ANTLR jar files.")
29-
set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease run `git submodule update --init --recursive`\n")
27+
set(ANTLR_PKG_FIND_ERROR_MSG "Could not locate jars.\nPlease check vcpkg configure completed without issue.\n")
3028

29+
find_library(ANTLR_LIB NAMES antlr3c
30+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
31+
)
3132

32-
find_jar(ANTLR_BUILDTIME_JAR ${ANTLR_BUILDTIME_DEP} PATHS ${ANTLR_PATH})
33-
find_jar(ANTLR_RUNTIME_JAR ${ANTLR_RUNTIME_DEP} PATHS ${ANTLR_PATH})
33+
find_file(ANTLR_BUILDTIME_JAR "share/antlr3/antlr-3.4-complete.jar"
34+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
35+
)
36+
37+
find_file(ANTLR_RUNTIME_JAR "share/antlr3/antlr-runtime-3.4.jar"
38+
PATHS ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}
39+
)
3440

3541
include(FindPackageHandleStandardArgs)
3642
find_package_handle_standard_args(

cmake_modules/plugins.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ if (USE_PARQUET)
8585
endif()
8686

8787
# vcpkg.json options ---
88+
set(VCPKG_ANTLR3 "${VCPKG_SUPPRESS}")
89+
if (WSSQL_SERVICE)
90+
set(VCPKG_ANTLR3 "${VCPKG_INCLUDE}")
91+
endif()
92+
8893
set(VCPKG_APR "${VCPKG_SUPPRESS}")
8994
if (USE_APR)
9095
set(VCPKG_APR "${VCPKG_INCLUDE}")

cmake_modules/vcpkg.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ elseif(APPLE)
1919
set(VCPKG_TARGET_TRIPLET "x64-osx" CACHE STRING "target triplet")
2020
endif()
2121
elseif(UNIX)
22+
execute_process(COMMAND uname -m OUTPUT_VARIABLE ARCHITECTURE)
23+
string(STRIP ${ARCHITECTURE} ARCHITECTURE)
24+
if(ARCHITECTURE MATCHES "arm" OR ARCHITECTURE MATCHES "aarch64")
25+
set(VCPKG_HOST_TRIPLET "arm64-linux-dynamic" CACHE STRING "host triplet")
26+
set(VCPKG_TARGET_TRIPLET "arm64-linux-dynamic" CACHE STRING "target triplet")
27+
else()
2228
set(VCPKG_HOST_TRIPLET "x64-linux-dynamic" CACHE STRING "host triplet")
2329
set(VCPKG_TARGET_TRIPLET "x64-linux-dynamic" CACHE STRING "target triplet")
30+
endif()
2431
endif()
2532

2633
message("-- vcpkg settings:")

dockerfiles/image.sh

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ trapFunc() {
1111
trap 'trapFunc "${LINENO}/${BASH_LINENO}" "$?" "$BASH_COMMAND"' ERR
1212

1313
globals() {
14+
detect_arch
1415
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"
1516
ROOT_DIR=$(git rev-parse --show-toplevel)
1617

1718
set +e
18-
export $(grep -v '^#' $ROOT_DIR/.env | sed -e 's/\r$//' | xargs) > /dev/null
19+
if [ -f $ROOT_DIR/.env ]; then
20+
export $(grep -v '^#' $ROOT_DIR/.env | sed -e 's/\r$//' | xargs) > /dev/null
21+
fi
1922
set -e
2023

2124
GIT_REF=$(git rev-parse --short=8 HEAD)
@@ -24,6 +27,10 @@ globals() {
2427
pushd $ROOT_DIR/vcpkg
2528
VCPKG_REF=$(git rev-parse --short=8 HEAD)
2629
popd
30+
if [ "$ARCH" == "arm64" ]; then
31+
VCPKG_REF="$VCPKG_REF-arm"
32+
RELEASE_BASE_IMAGE="arm64v8/$RELEASE_BASE_IMAGE"
33+
fi
2734
DOCKER_USERNAME="${DOCKER_USERNAME:-hpccbuilds}"
2835

2936
CMAKE_OPTIONS="-G Ninja -DCPACK_THREADS=$(docker info --format '{{.NCPU}}') -DUSE_OPTIONAL=OFF -DCONTAINERIZED=ON -DINCLUDE_PLUGINS=ON -DSUPPRESS_V8EMBED=ON"
@@ -265,6 +272,10 @@ build() {
265272
exit 1
266273
fi
267274

275+
if [ "$ARCH" == "arm64" ]; then
276+
base="$base"
277+
fi
278+
268279
if [ "$RECONFIGURE" -eq 1 ]; then
269280
reconfigure
270281
fi
@@ -331,6 +342,25 @@ function cleanup() {
331342
fi
332343
}
333344

345+
function detect_arch() {
346+
if [ -z "$ARCH" ]; then
347+
if [ "$(uname -m)" == "x86_64" ]; then
348+
ARCH="x64"
349+
elif [ "$(uname -m)" == "aarch64" ]; then
350+
ARCH="arm64"
351+
elif [ "$(uname -m)" == "arm64" ]; then
352+
ARCH="arm64"
353+
else
354+
echo "Unsupported architecture: $(uname -m)"
355+
exit 1
356+
fi
357+
fi
358+
if [ "$ARCH" != "x64" ] && [ "$ARCH" != "arm64" ]; then
359+
echo "Unsupported architecture: $ARCH"
360+
exit 1
361+
fi
362+
}
363+
334364
trap cleanup EXIT
335365

336366
status() {
@@ -344,7 +374,9 @@ status() {
344374
echo "MODE: $MODE"
345375
echo "RECONFIGURE: $RECONFIGURE"
346376
echo "BUILD_OS: $BUILD_OS"
377+
echo "RELEASE_BASE_IMAGE: $RELEASE_BASE_IMAGE"
347378
echo "HPCC_BUILD: $HPCC_BUILD"
379+
echo "ARCH: $ARCH"
348380
}
349381

350382
# Print usage information
@@ -361,6 +393,7 @@ usage() {
361393
echo " -t, --tag tag the build volume with the current branch ref"
362394
echo " will preserve build state per branch"
363395
echo " -r, --reconfigure reconfigure CMake before building"
396+
echo " -a, --architecture override default architecture (x64 or arm64)"
364397
}
365398

366399
# Set default values
@@ -369,8 +402,9 @@ MODE="release"
369402
RECONFIGURE=0
370403
DEB_FILE=""
371404
BUILD_OS="ubuntu-22.04"
372-
RELEASE_BASE_IMAGE="ubuntu:jammy-20230308" # Matches vcpkg base image (does not need to be an exact match)
405+
RELEASE_BASE_IMAGE="ubuntu:22.04" # Matches vcpkg base image (does not need to be an exact match)
373406
TAG_BUILD=0
407+
ARCH=""
374408

375409
# Parse command line arguments
376410
while [[ $# -gt 0 ]]
@@ -413,6 +447,11 @@ case $key in
413447
RECONFIGURE=1
414448
shift # past argument
415449
;;
450+
-a|--architecture)
451+
ARCH="$2"
452+
shift # past argument
453+
shift # past value
454+
;;
416455
-h|--help)
417456
usage
418457
exit 0
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
##############################################################################
2+
#
3+
# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
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+
18+
# Create base container image to be used by all HPCC processes
19+
20+
ARG BASE_IMAGE=arm64-platform-core-ubuntu-22.04:latest
21+
FROM ${BASE_IMAGE}
22+
23+
USER root
24+
25+
RUN apt-get install -y libcap2-bin
26+
RUN setcap cap_sys_ptrace+eip /usr/bin/gdb
27+
28+
USER hpcc
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
##############################################################################
2+
#
3+
# HPCC SYSTEMS software Copyright (C) 2020 HPCC Systems®.
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+
18+
# Create base container image to be used by all HPCC processes
19+
20+
ARG BASE_IMAGE=ubuntu:22.04
21+
FROM ${BASE_IMAGE}
22+
23+
ENV DEBIAN_FRONTEND=noninteractive
24+
25+
RUN apt-get clean -y && \
26+
apt-get autoclean -y && \
27+
apt-get install -y -f && \
28+
apt-get autoremove -y && \
29+
apt-get update -y && \
30+
apt-get install --no-install-recommends -y \
31+
default-jdk \
32+
elfutils \
33+
expect \
34+
g++ \
35+
git \
36+
locales \
37+
jq \
38+
openssh-client \
39+
openssh-server \
40+
python3 \
41+
python3-dev \
42+
psmisc \
43+
r-base-core \
44+
r-cran-rcpp \
45+
r-cran-inline \
46+
rsync \
47+
zip \
48+
curl \
49+
clang
50+
51+
ARG USE_CPPUNIT=1
52+
RUN if [ ${USE_CPPUNIT} -eq 1 ] ; then apt-get install -y libcppunit-1.15-0 ; fi
53+
54+
# these are developer tools - we may want to move them elsewhere so that they are only in the incremental builds?
55+
56+
RUN apt-get install -y \
57+
dnsutils \
58+
gdb \
59+
nano
60+
61+
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.29.7/bin/linux/arm64/kubectl && \
62+
chmod +x ./kubectl && \
63+
mv ./kubectl /usr/local/bin
64+
65+
RUN curl -LO http://ports.ubuntu.com/pool/universe/g/git-lfs/git-lfs_3.0.2-1_arm64.deb && \
66+
dpkg -i git-lfs_3.0.2-1_arm64.deb && \
67+
rm git-lfs_3.0.2-1_arm64.deb
68+
69+
# Set the locale
70+
RUN locale-gen en_US.UTF-8
71+
ENV LANG en_US.UTF-8
72+
ENV LANGUAGE en_US:en
73+
ENV LC_ALL en_US.UTF-8
74+
75+
RUN groupadd -g 10001 hpcc
76+
RUN useradd -s /bin/bash -m -r -N -c "hpcc runtime User" -u 10000 -g hpcc hpcc
77+
RUN passwd -l hpcc
78+
79+
RUN mkdir /var/lib/HPCCSystems && chown hpcc:hpcc /var/lib/HPCCSystems
80+
RUN mkdir /var/log/HPCCSystems && chown hpcc:hpcc /var/log/HPCCSystems
81+
RUN mkdir /var/lock/HPCCSystems && chown hpcc:hpcc /var/lock/HPCCSystems
82+
RUN mkdir /var/run/HPCCSystems && chown hpcc:hpcc /var/run/HPCCSystems
83+
84+
USER hpcc
85+
ENV PATH="/opt/HPCCSystems/bin:${PATH}"
86+
ENV HPCC_containerized=1
87+
WORKDIR /var/lib/HPCCSystems
88+
89+
ENTRYPOINT ["/bin/bash", "--login", "-c"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ARG VCPKG_REF=latest
2+
FROM hpccsystems/platform-build-base-ubuntu-22.04:hpcc-platform-9.10.x-arm
3+
4+
ENTRYPOINT ["/bin/bash", "--login", "-c"]
5+
6+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)