-
Couldn't load subscription status.
- Fork 128
[CI] Add some more steps to test on Macos ARM #2030
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
Conversation
933fe0c to 3694852 Compare a4cc1fb to 735c1aa Compare | /test |
| # TODO: Missing docker & docker-compose in MACOS ARM agent image, skip installation of packages in the meantime. | ||
| # If docker and docker-compose are available for this platform/architecture, it could be added a step to test the stack commands (or even replace this one). | ||
| echo " - label: \":macos: :go: Integration test: build-zip\"" | ||
| echo " command: ./.buildkite/scripts/integration_tests.sh -t test-build-zip-skip-install" |
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 it be interesting to add this step in the CI pipeline ? WDYT ?
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.
Sounds good, yes.
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.
LGTM, but added suggestion about having a test script that just builds the zip.
| # TODO: Missing docker & docker-compose in MACOS ARM agent image, skip installation of packages in the meantime. | ||
| # If docker and docker-compose are available for this platform/architecture, it could be added a step to test the stack commands (or even replace this one). | ||
| echo " - label: \":macos: :go: Integration test: build-zip\"" | ||
| echo " command: ./.buildkite/scripts/integration_tests.sh -t test-build-zip-skip-install" |
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.
Sounds good, yes.
scripts/test-build-zip.sh Outdated
| | ||
| if [[ "${SKIP_INSTALL}" == 1 ]]; then | ||
| exit 0 | ||
| fi |
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.
Nit. Instead of having this if and the ones in with_docker and with_docker_compose, maybe we can add a new script that just builds the zip and doesn't call to with_docker and with_docker_compose. Even if we have some duplication between the scripts, it would be more explicit. WDYT?
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.
Sure, I'll do that. It is going to be better to have that script with less "ifs"
.buildkite/scripts/install_deps.sh Outdated
| if [[ "${platform_type_lowercase}" == "darwin" ]]; then | ||
| echo "Skip. Not supported in Darwin." | ||
| return | ||
| fi |
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.
This is not needed now, right?
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.
It is still needed. These function (with_docker and with_docker_compose) are called from the script .buildkite/scripts/integrations_tests.sh. This script is used for all the steps that could run with Linux containers or Linux VMs, so it is needed to keep these safeguards/checks.
elastic-package/.buildkite/scripts/integration_tests.sh
Lines 83 to 88 in 10509f6
| echo "--- install docker" | |
| with_docker | |
| echo "--- install docker-compose plugin" | |
| with_docker_compose_plugin | |
| fi |
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.
Maybe I am missing something, but do we want these scripts to continue if docker installation cannot be performed?
This script is used for all the steps that could run with Linux containers or Linux VMs, so it is needed to keep these safeguards/checks.
Is it run in darwin?
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.
This script is used for all the steps that could run with Linux containers or Linux VMs, so it is needed to keep these safeguards/checks.
Is it run in darwin?
Ok, I see it is run with -t test-just-build-zip, could we avoid calling with_docker and with_docker_compose_plugin when the target is test-just-build-zip? The same way as we are avoiding it when running for serverless.
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.
Exactly, for now just Macos ARM is used for that specific make target.
It could be added as you mentioned that condition to not call those functions if that target is the one to be executed.
I'll give it a try 👍
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.
Applied the suggestion here 2e7220d
.buildkite/scripts/install_deps.sh Outdated
| if ! command -v docker &> /dev/null ; then | ||
| echo "Skip. Docker is not installed by default" | ||
| return | ||
| fi |
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.
Or this.
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.
As mentioned here, I would keep this condition too.
In this case, if there is no docker there is no need to install docker-compose.
| /test |
| /test |
💚 Build Succeeded
History
cc @mrodm |
| test-build-zip: | ||
| ./scripts/test-build-zip.sh |
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.
What does this apart of just building the zip? 😅
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.
This script builds the packages and then installs them (without the zip file). It would be briefly like:
elastic-package stack up -v -d # for each package elastic-package build -v --zip --sign elastic-package install -v elastic-package stack down -vThen, there is another script that builds the packages and installs them using the zip file (scripts/test-install-zip.sh):
elastic-package stack up -v -d # for each package elastic-package build -v --zip --sign elastic-package install -v --zip <zip_file_path> # check via curl that it is installed elastic-package stack down -vAnd there is another script file, that just builds the zip file. Used specially for testing in Macos ARM:
elastic-package stack up -v -d # for each package elastic-package build -v --zip --sign elastic-package stack down -vProbably, they could be renamed so it is clear what they do. What about rename them as this? @jsoriano
scripts/test-build.zip.sh:scripts/test-build-install.sh- Package build and installed from the working copy
scripts/test-install.zip.sh:scripts/test-build-install-zip-file.sh- Package built and installed using the zip file
scripts/test-just-build-zip.sh:scripts/test-build.zip.sh- Package built
If so, I could create a follow-up PR to rename those files as well as Makefile and buildkite scripts accordingly.
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.
Yeah, these scripts are a bit confusing. Let's rename them in a follow up.
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.
Created PR to rename test scripts: #2072
Relates #539
This PR adds a new step in the CI pipeline to test to build packages using
elastic-package buildcommand in MacOS ARM VMs. Doing that allows us to check that the at least can be executed this command in that platform and architecture.For the time being, it is not available docker/docker-compose commands in those MacOS ARM VMs.