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

Added jenkinsfile to run gradle check in OpenSearch #2166

Merged
merged 3 commits into from
Mar 25, 2022

Conversation

owaiskazi19
Copy link
Member

@owaiskazi19 owaiskazi19 commented Feb 18, 2022

Signed-off-by: Owais Kazi [email protected]

Description

Created a new ubuntu docker image for gradle check. Link
Added a jenkinsfile to run gradle check in OpenSearch. After jenkins go public logs will be available in the CI.

Sample run: http://opens-jenki-a7sro6sneahz-2051798054.us-west-2.elb.amazonaws.com/job/Gradle_Check/job/Gradle_Check/4/console

Steps to run the jenkinsfile:

  1. Create a pipeline job with Git as SCM. Add the opensearch repo url to clone, branch as main.
  2. Provide the script path as jenkins/jenkinsfile.

Issues Resolved

Closes #2507

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • 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.

@owaiskazi19 owaiskazi19 requested a review from a team as a code owner February 18, 2022 02:35
@opensearch-ci-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@owaiskazi19 owaiskazi19 changed the title Moved Gradle check into OpenSearch repo Moved Gradle check scripts into OpenSearch repo Feb 18, 2022
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success b30ca615221dbb8097a6fdb00dff663304ebe693
Log 2553

Reports 2553

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success bce0434
Log 2554

Reports 2554

jenkins/gradle-check-assemble.sh Outdated Show resolved Hide resolved
jenkins/gradle-check-assemble.sh Outdated Show resolved Hide resolved
jenkins/post-build-task2.sh Outdated Show resolved Hide resolved
docker ps
docker stop `docker ps -qa` > /dev/null 2>&1

cd search
Copy link
Member

Choose a reason for hiding this comment

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

Similar question, why is this needed?

Copy link
Member

@peterzhuamazon peterzhuamazon Feb 22, 2022

Choose a reason for hiding this comment

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

I have stated many times that search is just a folder name of the repo.
If you just git clone opensearch then the default folder is opensearch not search.
The reason we use search back in the day because opensearch naming is not defined.

If you clone as opensearch (which seems like you do in the jenkins file), you should remove cd into search and cd into the corresponding folder instead.

Copy link
Member

Choose a reason for hiding this comment

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

Sure that makes sense, the question was to @owaiskazi19, do we still need this ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed the design. Created a new ubuntu docker image for gradle check purpose and run it in a jenkisnfile. We don't need the scripts anymore.

Comment on lines 16 to 18
REPORTS_DIR=`find ./search -name reports`
zip -9 -q -r gradle_check_${BUILD_NUMBER}_reports.zip ${REPORTS_DIR}
ls | grep "gradle_check_${BUILD_NUMBER}"
Copy link
Member

Choose a reason for hiding this comment

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

Not a blocker for this PR, just a thought:
Looks like we can publish code coverage results from here.
cc: @tlfeng

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 see a lot of code directly copy paste from previous Jenkins without considering the circumstances of the new Jenkins and why the old code was being written that way.

I also would like to see some results of this workflow in practice before approving it.

Seems like the jenkins pipeline file is also written in scripted way instead of decalarative which makes the maintenance a bit harder.

Block this PR for now as I am concerned about the outcome of this PR.

@peterzhuamazon
Copy link
Member

Hi Owais,

Also realize this is not even a Jenkins Pipeline file, but instead a dsl groovy which we are not using anymore.

  1. Please follow the build repo jenkins folder to see examples of how to setup proper jenkinsfile
  2. The workflow needs to be run within a docker container. Since you are running multiple containers within the runner container, you need to use the ubuntu buildx image we provided for docker build, see jenkins/docker for instances.
  3. You should simplify the workflow and remove old scripts from the old workflow if they can be re-written or replaced in the new setup.
  4. You pipeline should be able to run on our dev jenkins and should be testable.

Thanks.

cc: @bbarani

@owaiskazi19
Copy link
Member Author

owaiskazi19 commented Mar 25, 2022

Thanks for the input here @peterzhuamazon. I have pushed the changes.

@owaiskazi19 owaiskazi19 changed the title Moved Gradle check scripts into OpenSearch repo Added jenkinsfile to run gradle check in OpenSearch Mar 25, 2022
@opensearch-ci-bot
Copy link
Collaborator

❌   Gradle Check failure 3031c13
Log 3761

Reports 3761

@owaiskazi19
Copy link
Member Author

#1703

@owaiskazi19
Copy link
Member Author

start gradle check

@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 3031c13
Log 3765

Reports 3765

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.

Great to see such a short JenkinsFile :)

agent {
docker {
label 'AL2-X64'
image 'opensearchstaging/ci-runner:ci-runner-ubuntu1804-build-v1'
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Sounds good. Pushed the change. Thanks for the review :)

Signed-off-by: Owais Kazi <[email protected]>
@opensearch-ci-bot
Copy link
Collaborator

✅   Gradle Check success 82f97b1
Log 3771

Reports 3771

@CEHENKLE CEHENKLE merged commit f1d35d0 into opensearch-project:main Mar 25, 2022
@@ -0,0 +1,32 @@
pipeline {
agent {

Choose a reason for hiding this comment

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

@owaiskazi19 - Can you help create a test case for this job and add timeout as well? Thank you!

Copy link
Member Author

Choose a reason for hiding this comment

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

@abhinavGupta16 can you create an issue for the above so that it can be pick up later? Thanks

Copy link

@abhinavGupta16 abhinavGupta16 Mar 31, 2022

Choose a reason for hiding this comment

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

@owaiskazi19 - #2690 . There you go!

@owaiskazi19 owaiskazi19 added backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch labels Mar 28, 2022
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2022
* Added jenkinsfile for gradle check

Signed-off-by: Owais Kazi <[email protected]>

* Added jenkinsfile to run gradle check

Signed-off-by: Owais Kazi <[email protected]>

* PR comment

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit f1d35d0)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 28, 2022
* Added jenkinsfile for gradle check

Signed-off-by: Owais Kazi <[email protected]>

* Added jenkinsfile to run gradle check

Signed-off-by: Owais Kazi <[email protected]>

* PR comment

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit f1d35d0)
dblock pushed a commit that referenced this pull request Mar 30, 2022
* Added jenkinsfile for gradle check

Signed-off-by: Owais Kazi <[email protected]>

* Added jenkinsfile to run gradle check

Signed-off-by: Owais Kazi <[email protected]>

* PR comment

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit f1d35d0)

Co-authored-by: Owais Kazi <[email protected]>
dblock pushed a commit that referenced this pull request Mar 30, 2022
* Added jenkinsfile for gradle check

Signed-off-by: Owais Kazi <[email protected]>

* Added jenkinsfile to run gradle check

Signed-off-by: Owais Kazi <[email protected]>

* PR comment

Signed-off-by: Owais Kazi <[email protected]>
(cherry picked from commit f1d35d0)

Co-authored-by: Owais Kazi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport 2.0 Backport to 2.0 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Gradle Check script in OpenSearch
9 participants