Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLIENT-2217] Bundle manylinux2014 wheels with OpenSSL 3.0 #688

Merged
merged 194 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
194 commits
Select commit Hold shift + click to select a range
f57bbcb
combine
juliannguyen4 Oct 10, 2024
f48d4f7
wip
juliannguyen4 Oct 14, 2024
8cd8eea
fix
juliannguyen4 Oct 14, 2024
9aee42b
build openssl 3 from source in manylinux2014
juliannguyen4 Nov 1, 2024
17fff11
Fix
juliannguyen4 Nov 1, 2024
ade6d4c
try
juliannguyen4 Nov 1, 2024
4bcb8e0
Fix
juliannguyen4 Nov 1, 2024
8d4616f
fix
juliannguyen4 Nov 1, 2024
c4ba003
Add dockerfile to build openssl 3 in docker image
juliannguyen4 Nov 4, 2024
e0c61da
create action to build img
juliannguyen4 Nov 4, 2024
3cf045e
trig
juliannguyen4 Nov 4, 2024
396e751
Revert "trig"
juliannguyen4 Nov 4, 2024
8a5f26e
y
juliannguyen4 Nov 4, 2024
1cb47c7
fix
juliannguyen4 Nov 4, 2024
5e5ab14
try
juliannguyen4 Nov 4, 2024
53a1f34
name better
juliannguyen4 Nov 4, 2024
9f4370c
caching first attempt
juliannguyen4 Nov 4, 2024
be7886f
what happens
juliannguyen4 Nov 4, 2024
c018c30
try another guide
juliannguyen4 Nov 5, 2024
6a1c589
Add back
juliannguyen4 Nov 5, 2024
16fedc8
install missing dep
juliannguyen4 Nov 5, 2024
b48f814
use a newer toolset that has the bug fix for binutils
juliannguyen4 Nov 5, 2024
07ca508
make 11 active
juliannguyen4 Nov 5, 2024
37b67e3
run in exec mode
juliannguyen4 Nov 5, 2024
b1bb260
apply to current shell
juliannguyen4 Nov 5, 2024
671c1d7
.
juliannguyen4 Nov 5, 2024
a4928f2
check
juliannguyen4 Nov 5, 2024
f1a4601
try
juliannguyen4 Nov 5, 2024
4e9f422
try
juliannguyen4 Nov 5, 2024
5efca45
try local
juliannguyen4 Nov 5, 2024
09c6bdb
Use gha cache
juliannguyen4 Nov 5, 2024
f7534f1
wip
juliannguyen4 Nov 5, 2024
5b97fb9
cleanup
juliannguyen4 Nov 6, 2024
e09164f
Build to sep folder to not interfere with current openssl install
juliannguyen4 Nov 6, 2024
2095ab8
temp disable
juliannguyen4 Nov 6, 2024
9bdeed6
wip
juliannguyen4 Nov 6, 2024
fa7bc9c
wip
juliannguyen4 Nov 7, 2024
e9a634b
test
juliannguyen4 Nov 7, 2024
550b19f
login first
juliannguyen4 Nov 7, 2024
73b78e7
add tag
juliannguyen4 Nov 7, 2024
eda7195
set tag
juliannguyen4 Nov 8, 2024
e9cfdf5
Fix
juliannguyen4 Nov 8, 2024
d522627
Set openssl version as image label
juliannguyen4 Nov 8, 2024
b6c634b
dont need to set
juliannguyen4 Nov 8, 2024
7558a22
ln
juliannguyen4 Nov 8, 2024
ba45f5c
dont need digest
juliannguyen4 Nov 8, 2024
0f142ee
fix
juliannguyen4 Nov 8, 2024
4fe4c1c
Fix
juliannguyen4 Nov 8, 2024
04eff99
Use default dev toolset
juliannguyen4 Nov 8, 2024
a0cfaa2
test
juliannguyen4 Nov 8, 2024
54179a9
test
juliannguyen4 Nov 8, 2024
efaeb88
what happens
juliannguyen4 Nov 8, 2024
d9dc594
Just build with default devtoolset to maximize compatibility. Don't r…
juliannguyen4 Nov 8, 2024
f51c531
try running make test as nonroot user
juliannguyen4 Nov 8, 2024
78406c0
do setup as nonroot
juliannguyen4 Nov 8, 2024
b0079c1
install openssl
juliannguyen4 Nov 11, 2024
2e00eb7
Run with full verbosity
juliannguyen4 Nov 11, 2024
f5a0278
Skip test_symbol_presence
juliannguyen4 Nov 11, 2024
2fe963a
Add comment
juliannguyen4 Nov 11, 2024
805d562
Try including dir for openssl3
juliannguyen4 Nov 11, 2024
0c0acc2
fix
juliannguyen4 Nov 11, 2024
228f267
fix
juliannguyen4 Nov 11, 2024
49df781
Point to custom directory for openssl3
juliannguyen4 Nov 11, 2024
38e1aa7
fix
juliannguyen4 Nov 11, 2024
c4d5345
include header files too
juliannguyen4 Nov 11, 2024
2c63212
fix?
juliannguyen4 Nov 11, 2024
3be367b
Also link openssl3 with python client?
juliannguyen4 Nov 11, 2024
6a08300
allow auditwheel to find openssl3
juliannguyen4 Nov 11, 2024
232746b
Dynamically set openssl 3 location using env var
juliannguyen4 Nov 11, 2024
98725ef
fix
juliannguyen4 Nov 11, 2024
8b62ca5
fix
juliannguyen4 Nov 11, 2024
b17cc2f
rm
juliannguyen4 Nov 11, 2024
5061fc2
fix
juliannguyen4 Nov 11, 2024
a04b9c5
fix
juliannguyen4 Nov 11, 2024
634d6ad
override make vars with env vars
juliannguyen4 Nov 11, 2024
349e342
attempt 1
juliannguyen4 Nov 12, 2024
05fbc15
Fix
juliannguyen4 Nov 12, 2024
772371f
fix
juliannguyen4 Nov 12, 2024
7b57f4b
Only client needs to authenticate with server
juliannguyen4 Nov 12, 2024
1323943
fix
juliannguyen4 Nov 12, 2024
1b9d2bf
enable tls in tests
juliannguyen4 Nov 12, 2024
84a129c
fix
juliannguyen4 Nov 12, 2024
fce6fe9
show logs after tests
juliannguyen4 Nov 12, 2024
6ddddf9
jerry rig for now
juliannguyen4 Nov 12, 2024
bcf1695
add tls port
juliannguyen4 Nov 12, 2024
2de8959
fix
juliannguyen4 Nov 12, 2024
bc57b93
fix
juliannguyen4 Nov 12, 2024
554d019
put in quotes so bash wont interpret as pipe
juliannguyen4 Nov 12, 2024
cb2f2b0
connect to tls port
juliannguyen4 Nov 12, 2024
8bf2bb9
Validate tls connection after starting up server
juliannguyen4 Nov 12, 2024
3a9501e
fix
juliannguyen4 Nov 12, 2024
2832931
fix
juliannguyen4 Nov 12, 2024
957216f
Use CA or else server wont accept tls requests
juliannguyen4 Nov 12, 2024
5a715c2
Fix
juliannguyen4 Nov 12, 2024
11385ce
Don't require password for testing purposes
juliannguyen4 Nov 12, 2024
7dfc7d5
Fix
juliannguyen4 Nov 12, 2024
a40c0e1
dont create self signed cert
juliannguyen4 Nov 12, 2024
f983aa4
try
juliannguyen4 Nov 12, 2024
59751d5
maybe server cert needs to end with pem?
juliannguyen4 Nov 12, 2024
b017622
fix
juliannguyen4 Nov 12, 2024
fae9435
fix
juliannguyen4 Nov 12, 2024
8b3eb36
fix
juliannguyen4 Nov 12, 2024
30814f5
try?
juliannguyen4 Nov 12, 2024
23c7883
Fix
juliannguyen4 Nov 12, 2024
cf5fff0
Fix
juliannguyen4 Nov 12, 2024
f778694
Merge remote-tracking branch 'origin/dev' into CLIENT-3027-cicd-combi…
juliannguyen4 Nov 13, 2024
0e7a577
finish
juliannguyen4 Nov 13, 2024
a749eaf
Get cluster name dynamically
juliannguyen4 Nov 13, 2024
25246c3
Fail out early if server ip wasnt set
juliannguyen4 Nov 13, 2024
ea26d97
move config.conf stuff below
juliannguyen4 Nov 13, 2024
d3a0c6f
fix
juliannguyen4 Nov 13, 2024
487b849
dont include openssl in final image
juliannguyen4 Nov 13, 2024
676ccbb
fix
juliannguyen4 Nov 13, 2024
b82316f
Merge remote-tracking branch 'origin/CLIENT-3027-cicd-combine-ee-comp…
juliannguyen4 Nov 14, 2024
c75bcdc
define in one place
juliannguyen4 Nov 14, 2024
13fa51c
Fix
juliannguyen4 Nov 14, 2024
66119a4
Fix
juliannguyen4 Nov 14, 2024
222eaa8
set tls port dynamically
juliannguyen4 Nov 14, 2024
5dc816e
Use container name var, get cluster name using asinfo
juliannguyen4 Nov 14, 2024
a4ba4c7
f
juliannguyen4 Nov 14, 2024
66f08f1
Fix
juliannguyen4 Nov 14, 2024
7b8c039
Fix
juliannguyen4 Nov 14, 2024
260dced
make global
juliannguyen4 Nov 14, 2024
096c537
fix
juliannguyen4 Nov 14, 2024
dad7989
fix
juliannguyen4 Nov 14, 2024
1cef37f
Fix
juliannguyen4 Nov 14, 2024
11a2bda
make global
juliannguyen4 Nov 14, 2024
0d4da6b
shouldve been copied over
juliannguyen4 Nov 14, 2024
60b3703
make global
juliannguyen4 Nov 14, 2024
db956a0
fix
juliannguyen4 Nov 14, 2024
2043df4
debug
juliannguyen4 Nov 14, 2024
d193e4d
break down
juliannguyen4 Nov 14, 2024
3acee90
why
juliannguyen4 Nov 14, 2024
38aabed
forgot
juliannguyen4 Nov 14, 2024
2102022
fix
juliannguyen4 Nov 14, 2024
5812399
prevent piping
juliannguyen4 Nov 14, 2024
4221132
Fix regression
juliannguyen4 Nov 14, 2024
3cb4ac9
Merge remote-tracking branch 'origin/CLIENT-3027-cicd-combine-ee-comp…
juliannguyen4 Nov 14, 2024
e086020
Fix
juliannguyen4 Nov 14, 2024
b750d3a
cleanup
juliannguyen4 Nov 14, 2024
b9692ab
dont need this step tbh
juliannguyen4 Nov 14, 2024
b6653bc
make easier to understand
juliannguyen4 Nov 14, 2024
1b06526
document which port to expose when running container
juliannguyen4 Nov 14, 2024
652874b
publish tls port for apps outside docker network to access
juliannguyen4 Nov 14, 2024
23ee22a
Fix windows
juliannguyen4 Nov 14, 2024
eea94ec
fix
juliannguyen4 Nov 14, 2024
250c0d5
wip
juliannguyen4 Nov 15, 2024
0da8c34
cleanup
juliannguyen4 Nov 15, 2024
b69281b
Sep each feature into its own build stage
juliannguyen4 Nov 15, 2024
9287928
just pull jq directly from image remotely
juliannguyen4 Nov 15, 2024
f542957
fix
juliannguyen4 Nov 15, 2024
fdb497d
fix
juliannguyen4 Nov 15, 2024
8134428
mv
juliannguyen4 Nov 15, 2024
cd93556
fix
juliannguyen4 Nov 15, 2024
59b4745
fix
juliannguyen4 Nov 15, 2024
73744ae
fix
juliannguyen4 Nov 15, 2024
003a8e6
reorder.
juliannguyen4 Nov 15, 2024
3220ceb
disable capturing output
juliannguyen4 Nov 15, 2024
6d6257f
fix
juliannguyen4 Nov 15, 2024
b4adfc3
fix casing
juliannguyen4 Nov 15, 2024
a83e119
Also verify tls works for windows
juliannguyen4 Nov 15, 2024
d463014
Merge remote-tracking branch 'origin/dev' into CLIENT-2217-openssl3-m…
juliannguyen4 Nov 15, 2024
9fa5ea1
Merge remote-tracking branch 'origin/CLIENT-3160-new-tests-tls' into …
juliannguyen4 Nov 15, 2024
2f5cc38
also build manylinux2014 aarch64 image
juliannguyen4 Nov 15, 2024
a63801c
run on correct os
juliannguyen4 Nov 15, 2024
48fb988
disable fail fast
juliannguyen4 Nov 15, 2024
179f578
fix
juliannguyen4 Nov 15, 2024
2fe6f9c
Try perl core for both archs
juliannguyen4 Nov 15, 2024
f2b024f
try
juliannguyen4 Nov 15, 2024
9ca0a83
fix
juliannguyen4 Nov 15, 2024
bfe654e
Fix
juliannguyen4 Nov 18, 2024
9bd2779
Fix postfix
juliannguyen4 Nov 18, 2024
27bce5a
Reverse
juliannguyen4 Nov 18, 2024
7da04c2
fix
juliannguyen4 Nov 18, 2024
ced633b
Merge remote-tracking branch 'origin/dev' into CLIENT-2217-openssl3-m…
juliannguyen4 Nov 21, 2024
8549d07
Merge remote-tracking branch 'origin/dev' into CLIENT-2217-openssl3-m…
juliannguyen4 Nov 22, 2024
66341f3
Get openssl install dir from image label
juliannguyen4 Nov 22, 2024
e4e5ca2
clarify
juliannguyen4 Nov 22, 2024
b6e0262
comment
juliannguyen4 Nov 22, 2024
b818d4d
mv
juliannguyen4 Nov 22, 2024
076789c
comment
juliannguyen4 Nov 22, 2024
d01d54e
clear up
juliannguyen4 Nov 22, 2024
6b5a9c3
undo useless changes
juliannguyen4 Nov 22, 2024
26d7445
fix
juliannguyen4 Nov 22, 2024
648dbda
comment
juliannguyen4 Nov 22, 2024
d3bd60b
Fix
juliannguyen4 Nov 22, 2024
85be083
remove debug logging
juliannguyen4 Nov 22, 2024
81d70cc
Just install in default location and rm system default openssl
juliannguyen4 Nov 25, 2024
6500df8
add back
juliannguyen4 Nov 25, 2024
892ace0
undo
juliannguyen4 Dec 2, 2024
67cbbc6
verify we built against openssl3
juliannguyen4 Dec 2, 2024
93a7568
Manually check logs for manylinux tests
juliannguyen4 Dec 2, 2024
30674d7
verify repaired wheel, not orig wheel
juliannguyen4 Dec 2, 2024
c5486bd
always label with latest tag to make less complicated
juliannguyen4 Dec 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ jobs:
env:
BUILD_IDENTIFIER: "${{ matrix.python-tag }}-${{ inputs.platform-tag }}"
MACOS_OPENSSL_VERSION: 3
CUSTOM_IMAGE_NAME: ghcr.io/aerospike/manylinux2014_{0}:latest
steps:
- name: Create status check message
run: echo STATUS_CHECK_MESSAGE="cibuildwheel (${{ env.BUILD_IDENTIFIER }})" >> $GITHUB_ENV
Expand Down Expand Up @@ -227,7 +228,7 @@ jobs:
- name: Otherwise, enable integration tests
if: ${{ env.RUN_INTEGRATION_TESTS_IN_CIBW == 'true' }}
# Run with capture output disabled to check that TLS works (i.e we are using the bundled openssl)
run: echo "TEST_COMMAND=cd {project}/test/ && pip install -r requirements.txt && python -m pytest -vv new_tests/${{ inputs.test-file }}" >> $GITHUB_ENV
run: echo "TEST_COMMAND=cd {project}/test/ && pip install -r requirements.txt && python -m pytest -vvs new_tests/${{ inputs.test-file }}" >> $GITHUB_ENV
shell: bash

- name: Set unoptimize flag
Expand All @@ -238,6 +239,19 @@ jobs:
if: ${{ inputs.include-debug-info-for-macos && startsWith(inputs.platform-tag, 'macosx') }}
run: echo "INCLUDE_DSYM=1" >> $GITHUB_ENV

- if: ${{ startsWith(inputs.platform-tag, 'manylinux') }}
run: echo CIBW_MANYLINUX_X86_64_IMAGE=${{ format(env.CUSTOM_IMAGE_NAME, 'x86_64') }} >> $GITHUB_ENV

- if: ${{ startsWith(inputs.platform-tag, 'manylinux') }}
run: echo CIBW_MANYLINUX_AARCH64_IMAGE=${{ format(env.CUSTOM_IMAGE_NAME, 'aarch64') }} >> $GITHUB_ENV

- uses: docker/login-action@v3
if: ${{ startsWith(inputs.platform-tag, 'manylinux') }}
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build wheel
uses: pypa/cibuildwheel@v2.21.3
env:
Expand All @@ -246,11 +260,11 @@ jobs:
CIBW_BUILD: ${{ env.BUILD_IDENTIFIER }}
CIBW_BUILD_FRONTEND: build
CIBW_BEFORE_ALL_LINUX: >
yum install openssl-devel -y &&
yum install python-devel -y &&
yum install python-setuptools -y
# delvewheel is not enabled by default but we do need to repair the wheel
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel==1.*"
# We want to check that our new openssl 3 install is used, not the system default
CIBW_REPAIR_WHEEL_COMMAND_LINUX: auditwheel repair -w {dest_dir} {wheel} && auditwheel show {dest_dir}/*
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path ./aerospike-client-c/vs/x64/Release -w {dest_dir} {wheel}"
CIBW_TEST_COMMAND: ${{ env.TEST_COMMAND }}

Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/manylinux2014-openssl.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ARG CPU_ARCH=x86_64
FROM quay.io/pypa/manylinux2014_$CPU_ARCH
ARG OPENSSL_VERSION
LABEL com.aerospike.clients.openssl-version=$OPENSSL_VERSION

RUN yum install -y perl-core wget

ARG OPENSSL_TAR_NAME=openssl-$OPENSSL_VERSION
RUN wget https://www.openssl.org/source/$OPENSSL_TAR_NAME.tar.gz
RUN tar xzvf $OPENSSL_TAR_NAME.tar.gz
WORKDIR $OPENSSL_TAR_NAME

Check warning on line 11 in .github/workflows/manylinux2014-openssl.Dockerfile

View workflow job for this annotation

GitHub Actions / main (aarch64, aerospike_arm_runners_2)

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "openssl-3.0.15" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

Check warning on line 11 in .github/workflows/manylinux2014-openssl.Dockerfile

View workflow job for this annotation

GitHub Actions / main (x86_64, ubuntu-24.04)

Relative workdir without an absolute workdir declared within the build can have unexpected results if the base image changes

WorkdirRelativePath: Relative workdir "openssl-3.0.15" can have unexpected results if the base image changes More info: https://docs.docker.com/go/dockerfile/rule/workdir-relative-path/

# The default folder pointed to by --prefix contains a default openssl installation
# But we're assuming it's fine to replace the default openssl that comes with the image
# We aren't going to use this image in production, anyways
RUN ./Configure
RUN make
# These tests are expected to fail because we are using a buggy version of nm
# https://github.com/openssl/openssl/issues/18953
# devtoolset-11 contains a newer version of binutils 2.36, which contains a bug fix for nm
# We don't use it though because we want to make sure the compiled openssl 3 library is compatible with manylinux2014's
# default env
RUN make V=1 TESTS='-test_symbol_presence*' test
RUN make install
62 changes: 62 additions & 0 deletions .github/workflows/update-manylinux-openssl-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 17 * * 1-5'
workflow_dispatch:

jobs:
main:
env:
# We want granular control over the openssl version bundled with our wheels
OPENSSL_VERSION: '3.0.15'
REGISTRY: ghcr.io
strategy:
matrix:
arch-and-runner-os: [
[x86_64, ubuntu-24.04],
[aarch64, aerospike_arm_runners_2]
]
fail-fast: false

runs-on: ${{ matrix.arch-and-runner-os[1] }}
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
.github/workflows

- run: docker pull quay.io/pypa/manylinux2014_${{ matrix.arch-and-runner-os[0] }}

- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.REGISTRY }}/aerospike/manylinux2014_${{ matrix.arch-and-runner-os[0] }}
flavor: latest=true

- name: Set up Docker Buildx so we can cache our Docker image layers
uses: docker/setup-buildx-action@v3

- name: Build and push
uses: docker/build-push-action@v6
with:
# Don't want to use default Git context or else it will clone the whole Python client repo again
context: .github/workflows
file: .github/workflows/manylinux2014-openssl.Dockerfile
build-args: |
OPENSSL_VERSION=${{ env.OPENSSL_VERSION }}
CPU_ARCH=${{ matrix.arch-and-runner-os[0] }}
# setup-buildx-action configures Docker to use the docker-container build driver
# This driver doesn't publish an image locally by default
# so we have to manually enable it
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Also cache intermediate layers to make development faster
cache-from: type=gha
cache-to: type=gha,mode=max
Loading