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

Update simple-smoke-test to check Hazelcast version [DI-163] #776

Conversation

JackPGreen
Copy link
Collaborator

@JackPGreen JackPGreen commented Jul 2, 2024

  • adds a version check
  • refactors simple-smoke-test
    • adds functions to aid readability now it's got a bit larger
    • resolve Spellcheck IDE warnings

Fixes: DI-163

@JackPGreen JackPGreen self-assigned this Jul 2, 2024
@JackPGreen JackPGreen marked this pull request as ready for review July 2, 2024 15:54
@JackPGreen JackPGreen requested a review from a team as a code owner July 2, 2024 15:54
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
echo "Checking if $image is EE"
if docker run --rm $image bash -c 'compgen -G lib/*enterprise*'; then
echo "Checking if ${image} is EE"
if docker run --rm "${image}" bash -c 'compgen -G lib/*enterprise*'; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why without brackets?

Suggested change
if docker run --rm "${image}" bash -c 'compgen -G lib/*enterprise*'; then
if [ docker run --rm "${image}" bash -c 'compgen -G lib/*enterprise*' ]; then

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why without brackets?

Spellcheck didn't like it as it was. What's the difference?

E.G. https://www.shellcheck.net

#!/usr/bin/env bash

if [ docker run ]; then
   echo "EE contents identified"
fi

.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
JackPGreen and others added 3 commits July 2, 2024 18:11
Co-authored-by: Łukasz Dziedziul <lukasz.dziedziul@hazelcast.com>
…n-sync-with-actual-contents-of-the-distribution' of https://github.com/hazelcast/hazelcast-docker into DI-163---Add-tests-verifying-that-docker-metadata-are-in-sync-with-actual-contents-of-the-distribution
@JackPGreen JackPGreen requested a review from nishaatr July 3, 2024 10:30
…ts-verifying-that-docker-metadata-are-in-sync-with-actual-contents-of-the-distribution
Base automatically changed from use-snapshot-internal-repository to master July 3, 2024 10:35
…etadata-are-in-sync-with-actual-contents-of-the-distribution
…etadata-are-in-sync-with-actual-contents-of-the-distribution
@nishaatr
Copy link
Contributor

nishaatr commented Jul 4, 2024

Fix PR desc Spellcheck --> Shellcheck (may be add link)

@JackPGreen
Copy link
Collaborator Author

Fix PR desc Spellcheck --> Shellcheck (may be add link)

I genuinely thought it was Spellcheck 🤦

.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
@JackPGreen JackPGreen requested a review from nishaatr July 8, 2024 12:59
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Show resolved Hide resolved
.github/scripts/simple-smoke-test.sh Outdated Show resolved Hide resolved
@JackPGreen JackPGreen requested a review from nishaatr July 8, 2024 16:05
@JackPGreen JackPGreen merged commit 6478714 into master Jul 9, 2024
6 of 8 checks passed
@JackPGreen JackPGreen deleted the DI-163---Add-tests-verifying-that-docker-metadata-are-in-sync-with-actual-contents-of-the-distribution branch July 9, 2024 08:16
JackPGreen added a commit to hazelcast/hazelcast-packaging that referenced this pull request Jul 29, 2024
In hazelcast/hazelcast-docker#776, additional checks were added to `hazelcast-docker`'s tests to assert variant and version.

Rather than duplicate these tests, here, instead refactored those tests so that the logic can be shared - hazelcast/hazelcast-docker#790

This PR adapts these tests to use this framework, giving additional validation:
- variant and version
- `CLC` can connect to `IMap` in instance
ldziedziul added a commit that referenced this pull request Jul 31, 2024
…z] (#791)

Backport of:
-
114d45d
- #747
- #754
- #756
- #765
- #768
- #766
- #772
- #774
- #776
- #775

I suggest to review it commit-by-commit

`SNAPSHOT` OS distribution ZIPs (e.g. [those indexed

here](https://oss.sonatype.org/content/repositories/snapshots/com/hazelcast/hazelcast-distribution/5.4.0-SNAPSHOT))
will no longer be generated, which causes problems with the
`hazelcast-docker` PR builder (amongst others).

Instead, the distribution ZIPs will be uploaded to a private AWS S3
bucket, which requires authentication.

**This was a non-trivial change**:
- Updated the default distribution in the Docker images to be the latest
released version
   - This is guaranteed to be available (without any credentials)
- Allows the `Dockerfile` to be executed normally outside of a build
(e.g. for the security scan)
- "latest released" is looked up via Maven to ensure this doesn't need
any explicit maintenance in future
- Added unit tests to all modified shell scripts
- Moved `get_hz_dist_zip` into `os_build.functions` (and same for EE)
- Created additional `maven.functions` script to support resolution of
"latest released" for a given artifact
   - This has to be duplicated for OS & EE because of Docker limitations
- Added `xmllint` to all the runner images that build anything as
required for the Maven stuff
- Updated the `get_dist` OS script to generate a pre-signed S3 URL to
get it from S3 rather than a Maven repository
- Because this requires authentication, had to move this from inside the
image to outside to access the repository secrets
- Simplified the `Dockerfile` arguments - the URL resolution is now
being done outside of the `Dockerfile` more of the time, meaning not
always required
   - removed the redundant `HZ_VARIANT` parameter
    - removed `HZ_VERSION` from OS and reduced usage in EE

For testing, I've been doing what I can locally to assert the results
between `master` and my branch are the same:
- E.G. the `build-pr.yml` doesn't pass locally for me on EE, I presume
due to some `act` incompatibility - so a milestone for my PR is to get
the same failure in the same place
- I've build the images locally (outside of `act`, just a plain `docker
buildx build hazelcast-os`) and they build ok.
- Because of the reliance on repository secrets, it's not possible to
run many tests properly

Fixes: [DI-95](https://hazelcast.atlassian.net/browse/DI-95)
[DI-210](https://hazelcast.atlassian.net/browse/DI-210)

[DI-95]:

https://hazelcast.atlassian.net/browse/DI-95?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ



[DI-95]:
https://hazelcast.atlassian.net/browse/DI-95?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Jack Green <jack.green@hazelcast.com>
ldziedziul added a commit that referenced this pull request Jul 31, 2024
…z] (#789)

Backport of:
- #747
- #754
- #756
- #765
- #768
- #766
- #772
- #774
- #776
- #775

I suggest to review it commit-by-commit

`SNAPSHOT` OS distribution ZIPs (e.g. [those indexed

here](https://oss.sonatype.org/content/repositories/snapshots/com/hazelcast/hazelcast-distribution/5.4.0-SNAPSHOT))
will no longer be generated, which causes problems with the
`hazelcast-docker` PR builder (amongst others).

Instead, the distribution ZIPs will be uploaded to a private AWS S3
bucket, which requires authentication.

**This was a non-trivial change**:
- Updated the default distribution in the Docker images to be the latest
released version
   - This is guaranteed to be available (without any credentials)
- Allows the `Dockerfile` to be executed normally outside of a build
(e.g. for the security scan)
- "latest released" is looked up via Maven to ensure this doesn't need
any explicit maintenance in future
- Added unit tests to all modified shell scripts
- Moved `get_hz_dist_zip` into `os_build.functions` (and same for EE)
- Created additional `maven.functions` script to support resolution of
"latest released" for a given artifact
   - This has to be duplicated for OS & EE because of Docker limitations
- Added `xmllint` to all the runner images that build anything as
required for the Maven stuff
- Updated the `get_dist` OS script to generate a pre-signed S3 URL to
get it from S3 rather than a Maven repository
- Because this requires authentication, had to move this from inside the
image to outside to access the repository secrets
- Simplified the `Dockerfile` arguments - the URL resolution is now
being done outside of the `Dockerfile` more of the time, meaning not
always required
   - removed the redundant `HZ_VARIANT` parameter
    - removed `HZ_VERSION` from OS and reduced usage in EE

For testing, I've been doing what I can locally to assert the results
between `master` and my branch are the same:
- E.G. the `build-pr.yml` doesn't pass locally for me on EE, I presume
due to some `act` incompatibility - so a milestone for my PR is to get
the same failure in the same place
- I've build the images locally (outside of `act`, just a plain `docker
buildx build hazelcast-os`) and they build ok.
- Because of the reliance on repository secrets, it's not possible to
run many tests properly

Fixes: [DI-95](https://hazelcast.atlassian.net/browse/DI-95)
[DI-210](https://hazelcast.atlassian.net/browse/DI-210)

[DI-95]:

https://hazelcast.atlassian.net/browse/DI-95?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ



[DI-95]:
https://hazelcast.atlassian.net/browse/DI-95?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ

---------

Co-authored-by: Jack Green <jack.green@hazelcast.com>
JackPGreen added a commit to hazelcast/hazelcast-packaging that referenced this pull request Aug 1, 2024
)

In hazelcast/hazelcast-docker#776, additional
checks were added to `hazelcast-docker`'s tests to assert variant and
version.

Rather than duplicate these tests, here, instead refactored those tests
so that the logic can be shared -
hazelcast/hazelcast-docker#790

This PR adapts these tests to use this framework, giving additional
validation:
- variant and version
- `CLC` can connect to `IMap` in instance

Fixes: [DI-215](https://hazelcast.atlassian.net/browse/DI-215)

[DI-215]:
https://hazelcast.atlassian.net/browse/DI-215?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants