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

[Dashboards] integ-test in Jenkins #1653

Merged
merged 5 commits into from
Mar 2, 2022

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Feb 18, 2022

Description

Execute the integ-test workflow for OpenSearch Dashboards including
tests.

As opposed to OpenSearch, we need an image with the appropriate libraries
so we pass the image but it does not have the wget so the steps were broken
to access the build manifest.

Hardcoding the OpenSearch build id for now until this get resolves:
#1492

ARM tests will fail still until this is resolved:
#1381

Signed-off-by: Kawika Avilla kavilla414@gmail.com

Issues Partially Resolved

#704

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@kavilla kavilla requested a review from a team as a code owner February 18, 2022 05:12
@kavilla kavilla linked an issue Feb 18, 2022 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2022

Codecov Report

Merging #1653 (c337d9d) into main (18c173c) will increase coverage by 0.06%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1653      +/-   ##
============================================
+ Coverage     94.68%   94.75%   +0.06%     
  Complexity       14       14              
============================================
  Files           163      168       +5     
  Lines          3446     3506      +60     
  Branches         21       26       +5     
============================================
+ Hits           3263     3322      +59     
- Misses          180      181       +1     
  Partials          3        3              
Impacted Files Coverage Δ
tests/jenkins/jobs/RunIntegTestScript_Jenkinsfile 100.00% <100.00%> (ø)
...nIntegTestScript_OpenSearch_Dashboards_Jenkinsfile 100.00% <100.00%> (ø)
src/manifests/bundle_manifest.py 97.43% <0.00%> (-2.57%) ⬇️
src/assemble_workflow/dist.py 95.08% <0.00%> (-0.58%) ⬇️
src/manifests/build_manifest.py 100.00% <0.00%> (ø)
src/assemble_workflow/bundle_recorder.py 100.00% <0.00%> (ø)
deployment/lib/artifacts-public-access.ts 100.00% <0.00%> (ø)
src/build_workflow/builder_from_source.py 100.00% <0.00%> (ø)
...loyment/lambdas/cf-url-rewriter/cf-url-rewriter.ts 100.00% <0.00%> (ø)
deployment/lambdas/cf-url-rewriter/https-get.ts 100.00% <0.00%> (ø)
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 18c173c...c337d9d. Read the comment docs.

@kavilla
Copy link
Member Author

kavilla commented Feb 18, 2022

Screen Shot 2022-02-17 at 9 20 35 PM

Build 52 was for linux x64 while build 53 was for linux arm64.

Screen Shot 2022-02-17 at 9 21 14 PM

tests/jenkins/TestRunIntegTestScript.groovy Show resolved Hide resolved
@@ -0,0 +1,132 @@
lib = library(identifier: "jenkins@20211118", retriever: legacySCM(scm))
Copy link
Contributor

Choose a reason for hiding this comment

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

We'll need to add this job to #1468 once PR is merged, so we can add test cases for this when libTesters are ready

jenkins/opensearch-dashboards/integ-test.jenkinsfile Outdated Show resolved Hide resolved
jenkins/opensearch-dashboards/integ-test.jenkinsfile Outdated Show resolved Hide resolved
jenkins/opensearch-dashboards/integ-test.jenkinsfile Outdated Show resolved Hide resolved
@dblock
Copy link
Member

dblock commented Feb 18, 2022

Would it be simpler and future-proof to read the agent from the test manifest just like we do from the build manifest?

https://github.com/opensearch-project/opensearch-build/blob/main/manifests/2.0.0/opensearch-2.0.0.yml#L3

@kavilla
Copy link
Member Author

kavilla commented Feb 21, 2022

Would it be simpler and future-proof to read the agent from the test manifest just like we do from the build manifest?

https://github.com/opensearch-project/opensearch-build/blob/main/manifests/2.0.0/opensearch-2.0.0.yml#L3

Will it change often? Regardless, I believe it would look cleaner and enables forks to have their own agents defined.

@kavilla kavilla force-pushed the avillk/osd-integ-test branch 4 times, most recently from 8950881 to cea6ac6 Compare February 22, 2022 02:37
@kavilla
Copy link
Member Author

kavilla commented Feb 22, 2022

Thanks for your comments @abhinavGupta16, made the updates as suggested.

@abhinavGupta16
Copy link
Contributor

@kavilla Thank you for making the changes. I have added a few more suggestions.

@abhinavGupta16
Copy link
Contributor

@peterzhuamazon - We have a few stages that run without docker. Should we add docker to all the stages?

@kavilla
Copy link
Member Author

kavilla commented Feb 23, 2022

@opensearch-project/engineering-effectiveness, anyway to get more reviews on this PR? It would be a big win to have this running integration tests running for OpenSearch Dashboards.

Thank you!

Copy link
Member

@gaiksaya gaiksaya left a comment

Choose a reason for hiding this comment

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

Not sure why tests/jenkins/data/opensearch-1.3.0-build.yml file is being added.

jenkins/opensearch-dashboards/integ-test.jenkinsfile Outdated Show resolved Hide resolved
jenkins/opensearch/integ-test.jenkinsfile Outdated Show resolved Hide resolved
vars/runIntegTestScript.groovy Outdated Show resolved Hide resolved
@kavilla
Copy link
Member Author

kavilla commented Feb 23, 2022

Not sure why tests/jenkins/data/opensearch-1.3.0-build.yml file is being added.

For testing purposes, the original jenkins/data files were added in here 6c54533

But to add it a test for runIntegTestScript it needed a build manifest but for the purpose of the test we added a build ID to a regular manifest. So it gave it my room to test on how manifests that go into the groovy script look like. I understand that there is https://github.com/opensearch-project/opensearch-build/tree/main/tests/data but given that more recent hash is in jenkins/data and the tests in the previous commit used jenkins/data it made sense to me to add the new file along with OpenSearch Dashboards.

However, if asking how come OpenSearch and not just OpenSearch Dashboards this PR comes with inclusion of new tests.

Execute the integ-test workflow for OpenSearch Dashboards including
tests.

As opposed to OpenSearch, we need an image with the appropriate libraries
so we pass the image but it does not have the wget so the steps were broken
to access the build manifest.

Hardcoding the OpenSearch build id for now until this get resolves:
opensearch-project#1492

ARM tests will fail still until this is resolved:
opensearch-project#1381

Issue partially resolved:
opensearch-project#704

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
}
stage('download-manifest') {
agent {
node {
Copy link
Contributor

@abhinavGupta16 abhinavGupta16 Feb 24, 2022

Choose a reason for hiding this comment

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

We should run this in a docker container

Copy link
Member Author

Choose a reason for hiding this comment

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

Within OpenSearch integ-test, they are able to have a single step that downloads and runs the test. However, the image that is required to run the integration tests for OpenSearch Dashboards does not support wget which is what the downloadBuildManifest requires.

Would the suggestion be to hardcode this stage to utilize a docker image that would normally be used by OpenSearch?

Also for my own curiosity, what's the benefit of running within a docker container vs running within a node? Does this prevent potential conflicts?

Copy link
Contributor

Choose a reason for hiding this comment

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

Running within container ensures a fresh run every-time because the container will be destroyed after every run. Also, as you rightly mentioned, it also helps prevent conflicts. It would also ensure that the node is not affected by the job.

We can specify any image that would help support this operation.

Also, why are we taking image name as input from the user? Can these possibly change without changes to the job?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can specify any image that would help support this operation.

Do you know of which I can use? Used a couple docker images and all fail with line 1: wget: command not found. It would appear that's why OpenSearch is doing the same for integ tests: https://github.com/opensearch-project/opensearch-build/blob/main/jenkins/opensearch/integ-test.jenkinsfile#L37

Also, why are we taking image name as input from the user?

When OpenSearch Dashboards builds it already detected the docker image and will require to use the appropriate image for example: https://github.com/opensearch-project/opensearch-build/blob/main/manifests/2.0.0/opensearch-dashboards-2.0.0.yml#L8. So when the build pipeline triggers the job it will pass the values it already has on hand.

Can these possibly change without changes to the job?

Apologies I'm not clear what you mean here could you clarify?

Copy link
Member

Choose a reason for hiding this comment

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

You can curl instead of wget I believe ...

Copy link
Member Author

Choose a reason for hiding this comment

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

You can curl instead of wget I believe ...

Secret sauce, was able to update.

Copy link
Member Author

@kavilla kavilla Mar 1, 2022

Choose a reason for hiding this comment

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

Does this job pick the docker image from the manifest file? If yes, we should not have an input param, but assign the image variable locally using manifest.

As of right now, the actual build manifest doesn't include the CI image stuff. The manifests in manifests/x.y.z/ do. There could be potential to pass MANIFEST, TEST_MANIFEST, and BUILD_MANIFEST_URL. But if we are going that route I would rather we open an issue and address that in both OpenSearch and OpenSearch Dashboards.

Copy link
Member Author

@kavilla kavilla Mar 2, 2022

Choose a reason for hiding this comment

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

Input manifest: #1687
OpenSearch Integ test not running in docker: #1688

Copy link
Contributor

Choose a reason for hiding this comment

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

@kavilla - In that case, can we code in the docker image rather than taking it as an input parameter? It would reduce one parameter for the user.
Once the manifest supports holding the image, the job would then parse the build manifest and get the image from there

Copy link
Member Author

Choose a reason for hiding this comment

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

We could utilize #1687, which would have the image available. But that wouldn't resolve the issue about the number of params. I wouldn't see any issue if we did include the CI information into the actual build manifest to reduce the amount of params.

I created an issue for that: #1694 since that will require more refactoring within the actual build repo.

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@kavilla
Copy link
Member Author

kavilla commented Mar 2, 2022

@opensearch-project/engineering-effectiveness

@bbarani
Copy link
Member

bbarani commented Mar 2, 2022

@opensearch-project/engineering-effectiveness

We are looking in to it.

Copy link
Member

@peterzhuamazon peterzhuamazon left a comment

Choose a reason for hiding this comment

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

I dont have too much issues with this PR except a few naming convention.

Thanks.

Signed-off-by: Kawika Avilla <kavilla414@gmail.com>
@peterzhuamazon
Copy link
Member

Need @abhinavGupta16 to remove his block before we merge.
Thanks.

@abhinavGupta16
Copy link
Contributor

Need @abhinavGupta16 to remove his block before we merge. Thanks.

Added comments. I believe we can get rid of the image name parameter. One less thing for the user to input and worry about

@abhinavGupta16
Copy link
Contributor

I have approved it for now, however, we should look at resolving these new issues at the earliest.

@kavilla @bbarani @gaiksaya @peterzhuamazon

@gaiksaya gaiksaya merged commit 2993c66 into opensearch-project:main Mar 2, 2022
@kavilla kavilla deleted the avillk/osd-integ-test branch March 2, 2022 23:00
@kavilla kavilla linked an issue Mar 14, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants