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

Add K8-Agent to 'e.platform.releng' to build linux.x86_64 swt-natives #261

Closed

Conversation

HannesWell
Copy link
Contributor

@HannesWell HannesWell commented Jan 21, 2023

This is an attempt to add a Kubernetes-Agent to the eclipse.platform.releng Jenkins based on the configuration defined in https://ci.eclipse.org/releng/view/SWT%20Natives/job/gtk_linux_x86_64/configure to be capable to build the swt-natives for linux.x86_64, while being addressable as agent with label swt.natives-gtk.linux.x86_64.

This is required for eclipse-platform/eclipse.platform.swt#514 and was requested in https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/2448#note_1059781.

I'm not familiar with the JIRO and only created this by comparing/considering the following files:

Therefore I'm not sure at, if this is the right thing to do or if something else is missing, but I hope it is and have a least a minimal level of confidence that it is not completely wrong.

The goal was to create an additional clouds-template like the following in https://github.com/eclipse-cbi/jiro/blob/master/instances/eclipse.platform.releng/target/jenkins/configuration.yml, what is hopefully what is needed to achieve the described result.

Expected additional Cloud template clouds: - kubernetes: name: "kubernetes" containerCapStr: "10" jenkinsUrl: "http://jenkins-ui.releng.svc.cluster.local/releng" jenkinsTunnel: "jenkins-discovery.releng.svc.cluster.local:50000" maxRequestsPerHostStr: "32" namespace: "releng" podRetention: "never" templates: - name: "swtbuild" namespace: "releng" label: "swt.natives-gtk.linux.x86_64" containers: - name: "jnlp" image: docker.io/eclipse/platformreleng-centos-swt-build:8 alwaysPullImage: true livenessProbe: failureThreshold: 0 initialDelaySeconds: 0 periodSeconds: 0 successThreshold: 0 timeoutSeconds: 0 resourceLimitCpu: "2000m" resourceRequestCpu: "1000m" resourceLimitMemory: "4096Mi" resourceRequestMemory: "512Mi" ttyEnabled: true command: "" args: "" instanceCap: -1 nodeUsageMode: EXCLUSIVE envVars: - envVar: key: "JAVA_TOOL_OPTIONS" value: "" - envVar: key: "JENKINS_REMOTING_JAVA_OPTS" value: "-showversion -XshowSettings:vm -Xmx256m -Dorg.jenkinsci.remoting.engine.JnlpProtocol3.disabled=true -Dorg.jenkinsci.plugins.gitclient.CliGitAPIImpl.useSETSID=true" - envVar: key: "OPENJ9_JAVA_OPTIONS" value: "-XX:+IgnoreUnrecognizedVMOptions -XX:+IdleTuningCompactOnIdle -XX:+IdleTuningGcOnIdle" - envVar: key: "_JAVA_OPTIONS" value: "" volumes: - persistentVolumeClaim: claimName: "tools-claim-jiro-releng" mountPath: "/opt/tools" readOnly: true - configMapVolume: configMapName: "known-hosts" mountPath: "/home/jenkins/.ssh/" subPath: "." - emptyDirVolume: memory: false mountPath: "/home/jenkins/" - emptyDirVolume: memory: false mountPath: "/home/jenkins/.m2/repository" - emptyDirVolume: memory: false mountPath: "/home/jenkins/.m2/wrapper" workspaceVolume: emptyDirWorkspaceVolume: memory: false yaml: | apiVersion: v1 kind: Pod spec: containers: - name: "swtbuild" image: "eclipse/platformreleng-centos-swt-build:8" imagePullPolicy: "Always" resources: limits: memory: "4096Mi" cpu: "2000m" requests: memory: "512Mi" cpu: "1000m" command: - cat tty: true volumeMounts: - name: tools mountPath: /opt/tools volumes: - name: tools persistentVolumeClaim: claimName: tools-claim-jiro-releng

@fredg02 can you please review this in depth?
@sravanlakkimsetti, @akurtakov can you assess if the additional template is sufficient to build swt-natives for linux.x86_64?

@HannesWell
Copy link
Contributor Author

Btw. I tried to build the generated files in the target of the eclipse.platform.releng as described in the documentation using make deploy_eclipse.platform.releng, but it failed on my Windows computer:

C:\dev\git\eclipse.cbi.jiro>make deploy_eclipse.platform.releng
bash -c "$(curl -fsSL https://raw.githubusercontent.com/completeworks/bashtools/
master/install.sh)"
bash: -c: line 23: syntax error near unexpected token `&'
make: *** [.bashtools] Error 2

I didn't expect a full success, since I don't have access to the build-cluster, but this early failure is unexpected.
Calling clean_eclipse.platform.releng leads to a similar result.
Can the makefile even work on Windows?

Comment on lines +44 to +49
volumes+: {
name: "tools"
mounts+: {
mountPath: "/opt/tools"
},
},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure if this is necessary?

@HannesWell
Copy link
Contributor Author

I was able to create a k8-agent only for the linux.x86_64 platform in the swt-pipeline in eclipse-platform/eclipse.platform.swt#514 (comment).
So unless you prefer to manage that agent in jiro, this is not necessary anymore.

@mickaelistria
Copy link
Contributor

IMO, it's better to get as much as possible of the infrastructure requirement specified in the project. It will make it easier for project to evolve its target infrastructure without having to involve EF infra foundation staff (who may not be available or busy with other things). I believe having the more infra defined in Jenkinsfile increases agility for the project.
So I would be in favor of closing it if we have a self-contained solution in Jenkinsfile.

@fredg02
Copy link
Contributor

fredg02 commented Jan 30, 2023

Closing this PR as proposed.

@fredg02 fredg02 closed this Jan 30, 2023
@HannesWell HannesWell deleted the swtNativesLinux_x86_64-Agent branch January 30, 2023 17:54
@HannesWell
Copy link
Contributor Author

Just out of curiosity, would it have been the right thing to do to achieve the desired goal?

@fredg02
Copy link
Contributor

fredg02 commented Jan 30, 2023

Just out of curiosity, would it have been the right thing to do to achieve the desired goal?

It would probably have worked (with minor adjustments). In general, custom build agents should not be defined in the Jiro configuration, but rather in Jenkinsfiles.

@HannesWell
Copy link
Contributor Author

Just out of curiosity, would it have been the right thing to do to achieve the desired goal?

It would probably have worked (with minor adjustments). In general, custom build agents should not be defined in the Jiro configuration, but rather in Jenkinsfiles.

Good to know. Thanks. Yes that's right.
Btw. are you interested in the documenting the solution I used to create a matrix build that uses labeled and k8 agents together on the Jenkins Wiki-FAQ as suggested by Mickael in eclipse-platform/eclipse.platform.swt#514 (comment)?

@fredg02
Copy link
Contributor

fredg02 commented Jan 30, 2023

Btw. are you interested in the documenting the solution I used to create a matrix build that uses labeled and k8 agents together on the Jenkins Wiki-FAQ as suggested by Mickael in eclipse-platform/eclipse.platform.swt#514 (comment)?

Yes, please! 👍

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.

None yet

3 participants