-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
gh-136728: Refactor build.yml CI config and multissltests.py #136729
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
gh-136728: Refactor build.yml CI config and multissltests.py #136729
Conversation
Suggested by @hugovk [1]. [1]: hugovk@a3f2ba9
picnixz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I want multissltests to be refactored separately.
.github/workflows/build.yml
Outdated
| - { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.0.16 } | ||
| - { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.1.8 } | ||
| - { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.2.4 } | ||
| - { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.3.3 } | ||
| - { os: ubuntu-24.04, ssl: openssl, ssl_ver: 3.4.1 } | ||
| - { os: ubuntu-24.04, ssl: awslc, ssl_ver: 1.55.0 } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the os from the include and have:
matrix:
os: [ubuntu-24.04]
include:
- { ssl: openssl, ssl_ver: 3.0.16 }
- ...It would be possible to merge two matrices but we'll need a pre-step and I don't think it's more maintainable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we do ssl_lib: openssl | awslc? It would be easier to follow later on than just matrix.ssl everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry but what would ssl_lib: openssl | awslc in this case? does it run on both and if it doesn't work for one, it picks the other? (also, how would we use it below?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@picnixz I'm not sure I follow, the suggestion is just to rename matrix.ssl to matrix.ssl_lib. openssl | awslc are the valid values for either name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh! I thought you suggested something like this:
matrix:
os: [ubuntu-24.04]
include:
- { ssl_lib: openssl | awslc, ssl_ver: 3.0.16 }and I didn't know what it would means. Yes, we can have matrix.ssl_lib
| if [ "${{ matrix.ssl }}" = "openssl" ]; then | ||
| "${CMD[@]}" | ||
| else | ||
| "${CMD[@]}" --with-builtin-hashlib-hashes=blake2 --with-ssl-default-suites=openssl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we populate a variable called "CONFIGURE_FLAGS" instead and use a switch/case so that we exactly match the SSL libname. It will become easier in the future if we add BoringSSL or LibreSSL tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point I'd almost suggest using a small Python script to calculate flags. We should avoid complex shell logic in workflow files as much as possible, I don't want to read a bash switch-case in YAML! An if-statement is simpler to understand here for me, though the ${CMD[@]} syntax is arcane.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, a small Python script is also fine; here what matters to me is to be able to easily add a new library without having 3km long of options. As for ${CMD[@]}, it expands the array's content, so you end up with ./configure [...]. Usually, it's more common to expand the options and hardcode the command rather than expand the entire array containing the command as well.
| path: ./multissl/openssl/${{ env.OPENSSL_VER }} | ||
| key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }} | ||
| - name: Install OpenSSL | ||
| if: steps.cache-openssl.outputs.cache-hit != 'true' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With steps.cache-openssl here, we won't be hitting the cache-ssl entry right? maybe it's better to store a cache hit with steps.cache-${{ matrix.ssl }} if it's possible?
| @property | ||
| @abstractmethod | ||
| def library(self=None): | ||
| pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this. As we can't have abstract class methods, I prefer having real class variables where we would raise if they are not set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, better to raise NotImplementedError. That's treated equivalently to an abstract method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's just better to have abstract class variables here. The reason is that I don't think we would ever need a non-static computation for most of those abstract properties. If they must be abstract class properties that are represented by dynamic values that need a bit more work to compute (but only needed to be computed once), just a @classmethod together with NotImplementedError.
| ) | ||
|
|
||
| versions = [] | ||
| ssl_libs = AbstractBuilder.__subclasses__() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, don't use this. It's harder to maintain if we do it like this. Just hardcode the classes.
| format="*** %(levelname)s %(message)s" | ||
| ) | ||
|
|
||
| versions = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could have a dict of classes to a list of versions instead of storing a tuple of (class, version)
.github/workflows/build.yml
Outdated
| name: 'Ubuntu SSL tests with OpenSSL' | ||
| build-ubuntu-ssltests: | ||
| name: 'Ubuntu SSL tests' | ||
| runs-on: ${{ matrix.os }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All jobs run on the same OS, this is simpler:
| runs-on: ${{ matrix.os }} | |
| runs-on: ubuntu-24.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use matrix.os in the cache key so better not hardcode it here?
| "LibreSSL versions, defaults to '{}' (ancient: '{}') if no " | ||
| "OpenSSL and LibreSSL versions are given." | ||
| ).format(LIBRESSL_RECENT_VERSIONS, LIBRESSL_OLD_VERSIONS) | ||
| '--ssl', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again I'd suggest --ssl-library or etc
|
Hi folks, sorry for my delayed responses. Hoping to incorporate feedback here later this week or next. |
|
Oh yuck, sorry for the pings, this knotty merge resolution pulled in a lot of code... I'll apply some of the suggestions to the branch, then close the PR and open a new one. |
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
Let's continue in #143940. |
Notes
Please see #136728. Changes to
build.ymlare directly adapted from @hugovk's proof-of-concept here.Testing