Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

Cleanup Prod Jenkins Node configurations #7

Closed
gowthamchinna opened this issue Jul 9, 2020 — with Board Genius Sync · 21 comments
Closed

Cleanup Prod Jenkins Node configurations #7

gowthamchinna opened this issue Jul 9, 2020 — with Board Genius Sync · 21 comments
Assignees
Labels
enhancement improvement Improvement in current workflow. Patrick Assigned to Patrick Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate

Comments

Copy link
Contributor

gowthamchinna commented Jul 9, 2020

There are many unused and disconnected Jenkins Agents in Production Jenkins. We need to remove them to free up infra resources. In order to do that we need the following info for each node 

  • Use who added node
  • VM/HW node configured in the node

We should create a Jenkins job to list down the above info for offline nodes. 

Refernce - 

  • To get user details - [https://eos-jenkins.colo.seagate.com/computer/0427_althummar/jobConfigHistory/] 
  • VM/HW Details - [https://eos-jenkins.colo.seagate.com/computer/0427_althummar/configure] 

 

@gowthamchinna gowthamchinna added the improvement Improvement in current workflow. label Jul 9, 2020
@stale
Copy link

stale bot commented Aug 13, 2020

This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale
Copy link

stale bot commented Aug 20, 2020

This issue/pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the auto-stale label Aug 20, 2020
@shailesh-vaidya
Copy link
Contributor

@gowthamchinna Can you please take a look

@stale stale bot removed the auto-stale label Aug 26, 2020
@gowthamchinna
Copy link
Contributor Author

Sure will work on it

@hessio
Copy link

hessio commented Jan 5, 2022

Hi @gowthamchinna can you provide an update on this issue?

@hessio hessio added Patrick Assigned to Patrick Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate labels Jan 5, 2022
Copy link

For the convenience of the Seagate development team, this issue has been mirrored in a private Seagate Jira Server: https://jts.seagate.com/browse/EOS-28328. Note that community members will not be able to access that Jira server but that is not a problem since all activity in that Jira mirror will be copied into this GitHub issue.

@hessio
Copy link

hessio commented Feb 11, 2022

Hi @shailesh-vaidya can you provide an update on this issue?

@shailesh-vaidya
Copy link
Contributor

@nikhilpatil2995 is working on this task in the current sprint. @nikhilpatil2995 Please update details.

@nikhilpatil2995
Copy link
Contributor

We have created an excel sheet which contains the offline agent details. We will share the excel to the respective team to delete the node/agent if it is not required.

Copy link

Anmol Vijwani commented in Jira Server:

I have verified the nodes in Prod Jenkins, Unable to find the nodes which is specified in ticket.

It maybe cleaned earlier. 

Copy link

Shailesh Vaidya commented in Jira Server:

[~945475] - Updated ticket details based on scrum discussion.  CC: [~940197]

Copy link

Anmol Vijwani commented in Jira Server:

I have created script to extract the information of nodes, But to run that it needs admin access.

As [~729494] rightly suggested me to setup one dev Jenkins and try the script there first.

So, I have setup Jenkins ( [http://ssc-vm-g4-rhev4-1690.colo.seagate.com:8080/ |http://ssc-vm-g4-rhev4-1690.colo.seagate.com:8080/]) and created 2 nodes(ssc-vm-g3-rhev4-3198.colo.seagate.com & ssc-vm-g3-rhev4-3198.colo.seagate.com) with different users. 

One is online and another node is offline for testing. Then I have tested my script getting the following output : ====================

Name: Node1 getLabelString: ssc-vm-g3-rhev4-3203.colo.seagate.com

getNumExectutors: 1 getRemoteFS: /root getMode: NORMAL getRootPath: /root getDescriptor: hudson.slaves.DumbSlave$DescriptorImpl@530c28a1 getComputer: hudson.slaves.SlaveComputer@51e2a0de computer.isAcceptingTasks: true computer.isLaunchSupported: true computer.getConnectTime: 1654854879632 computer.getDemandStartMilliseconds: 9223372036854775807 computer.isOffline: false ====================

Name: Node2 getLabelString: NojavaNode

getNumExectutors: 1 getRemoteFS: /root getMode: NORMAL getRootPath: null getDescriptor: hudson.slaves.DumbSlave$DescriptorImpl@530c28a1 getComputer: hudson.slaves.SlaveComputer@6e383529 computer.isAcceptingTasks: true computer.isLaunchSupported: true computer.getConnectTime: 1654855520383 computer.getDemandStartMilliseconds: 9223372036854775807 computer.isOffline: true

 

Now trying to enhancing the script to extract VM & user details. 

cc: [~940197]

Copy link

Anmol Vijwani commented in Jira Server:

Hi [~729494] ,I am able to extract the VM, Label & Status details via job on development Jenkins.

Below is the output:
[Pipeline] Start of Pipeline[Pipeline] echoSlave: Node1[Pipeline]

echoHostname: ssc-vm-g3-rhev4-3203.colo.seagate.com[Pipeline]

echo computer.isOffline: false

[Pipeline] echo--------------------------------

[Pipeline] echoSlave: Node2[Pipeline]

echoHostname: ssc-vm-g3-rhev4-3198.colo.seagate.com

[Pipeline] echo computer.isOffline: true
Unable to extract the user details as of now. 

CC: [~940197]

Copy link

Anmol Vijwani commented in Jira Server:

Hi [~729494], 

I am now able to extract all the needed information.

Below is the output:
Started by user
[user3|http://ssc-vm-g4-rhev4-1690.colo.seagate.com:8080/user/user3]
[Pipeline] Start of Pipeline[Pipeline] echoHostname: ssc-vm-g3-rhev4-3203.colo.seagate.com Label: ssc-vm-g3-rhev4-3203.colo.seagate.com Computer.isOffline: false[Pipeline] echo--------------------------------[Pipeline] echoHostname: ssc-vm-g3-rhev4-3198.colo.seagate.com Label: NojavaNode Computer.isOffline: true[Pipeline] echo--------------------------------[Pipeline] echoSlave: Node4 User: Anmol UserId: admin[Pipeline] echoHostname: ssc-vm-g3-rhev4-3203.colo.seagate.com Label: Java Computer.isOffline: false[Pipeline] echo--------------------------------[Pipeline] echoSlave: Node5 User: Anmol UserId: admin[Pipeline] echoHostname: ssc-vm-g3-rhev4-3198.colo.seagate.com Label: NoJavanode Computer.isOffline: true[Pipeline] echo--------------------------------[Pipeline] echoSlave: Node6 User: user3 UserId: user3[Pipeline] echoHostname: ssc-vm-g3-rhev4-3203.colo.seagate.com Label: JavaNode Computer.isOffline: false[Pipeline] echo--------------------------------[Pipeline] End of PipelineFinished: SUCCESS
 CC: [~940197]

Copy link

Anmol Vijwani commented in Jira Server:

I found there were some security vulnerabilities in some functions like:
staticMethod hudson.model.Hudson getInstance
staticMethod jenkins.model.Jenkins getInstance 

Getting this warning when approving the functions  "Approving this signature may introduce a security vulnerability! You are advised to deny it."
So, I have done some research and found this :CVE-2009-3728. 
[https://www.cvedetails.com/cve/CVE-2009-3728/]

So, replacing it with staticMethod jenkins.model.Jenkins get as per [https://github.com/jenkinsci/jenkins/pull/4042#:~:text=Note%20that%20Jenkins,PR%20is%20fine]

No vulnerabilities is scanned over dev Jenkins. Getting the output as per desired.

cc: [~729494]

Copy link

Anmol Vijwani commented in Jira Server:

Fixed some issues in Prod Jenkins, Able to get the details.
Jenkins Job: [https://eos-jenkins.colo.seagate.com/job/Cortx-Automation/job/Reports/job/offline-node-report]

Made some improvements as per [~729494] : 

  • Only print nodes which are offline
  • redirect out to file
  • Archive file so that it will be available after job execution

Script: [https://github.com/vijwani-seagate/cortx-re/blob/CORTX-28328/jenkins/env_setup/Jenkinsnodedetails.groovy]

cc: [~940197]

Copy link

Anmol Vijwani commented in Jira Server:

PR: #1088

Copy link

Anmol Vijwani commented in Jira Server:

Hello [~940197], 

The PR got merged, but I am unable to put this ticket in resolve state. Getting this error: "Environment is required. But it is not present on screen. "

!image-2022-06-29-17-10-43-220.png!

Can you please help me in putting it in resolve state?

Copy link

Gaurav Chaudhari commented in Jira Server:

{panel:bgColor=#c1c7d0}h2. cortx-rgw - main branch build pipeline SUCCESS
h3. Build Info:

h3. Image Location :

  • cortx-docker.colo.seagate.com/seagate/cortx-all:2.0.0-5698
    cortx-docker.colo.seagate.com/seagate/cortx-rgw:2.0.0-5698
    cortx-docker.colo.seagate.com/seagate/cortx-data:2.0.0-5698
    cortx-docker.colo.seagate.com/seagate/cortx-control:2.0.0-5698
    {panel}

Copy link

Anmol Vijwani commented in Jira Server:

Resolved

Copy link

Anmol Vijwani commented in Jira Server:

Completed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement improvement Improvement in current workflow. Patrick Assigned to Patrick Status: L1 Triage Initial triage Triage: DevAd Triage owner is a developer advocate
Projects
None yet
Development

No branches or pull requests

5 participants