Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 552266

Summary: Pod Template works with one image, but not another
Product: Community Reporter: Nobody - feel free to take it <nobody>
Component: CI-JenkinsAssignee: CI Admin Inbox <ci.admin-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: frederic.gurr, webmaster
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Nobody - feel free to take it CLA 2019-10-21 03:52:57 EDT
Hi all!

I'm trying to set up a new pipeline on ci.eclipse.org/xtext but my podTemplate fails to spawn any nodes:

https://ci.eclipse.org/xtext/job/xtext-reference-projects/44/console

I basically copied the template from another (working) job and changed nothing but the label, container name and the image to use. I plan to use the images xtext/maven:jdk8 and xtext/maven:jdk11.

Because I could not find any errors (and am not allowed to see any logs), I tried to use the other image (smoht/xtext-buildenv:0.7 in this pipeline and the nodes spawned:

https://ci.eclipse.org/xtext/job/xtext-reference-projects/43/console

The job fails expectedly because it's not using the correct image, but it shows at least that the podTemplate should be correct.

Changing back to xtext:mavenjdk8/11 and it fails to spawn a node again.

I can pull those images without logging in from other machines, as it's a public repository.

Is there anything I'm missing?

Any help is appreciated.
Comment 1 Frederic Gurr CLA 2019-10-21 06:01:35 EDT
Here is what the Jenkins log says:

Error in provisioning; agent=KubernetesSlave name: xtext-ref-jdk-8-null-44-smclk-fnn7h, template=PodTemplate{, name='xtext-ref-jdk-8-null-44-smclk', namespace='xtext', label='xtext-ref-jdk-8-null-44', nodeUsageMode=EXCLUSIVE, annotations=[org.csanchez.jenkins.plugins.kubernetes.PodAnnotation@aab9c821]}. Container xtext-maven-jdk-8 exited with error 1. Logs: Can not write to /root/.m2/copy_reference_file.log. Wrong volume permissions? Carrying on ...
[[1;31mERROR[m] Could not create local repository at /?/.m2/repository -> [1m[Help 1]

So it seems like it's an issue with the image.
Comment 2 Nobody - feel free to take it CLA 2019-10-21 06:51:11 EDT
Thanks!

Okay. It looks like I'm still using the default root user :-( 

I created a new user, using the same UID from the other (functioning) image, but I still don't get any agents: https://ci.eclipse.org/xtext/job/xtext-reference-projects/48/console

Did the error message change at least? :-)
Comment 3 Frederic Gurr CLA 2019-10-21 08:41:25 EDT
New error (in the container log) is:

  bash: /home/default/.bashrc: Permission denied
Comment 4 Nobody - feel free to take it CLA 2019-10-28 07:26:57 EDT
Okay, I've been trying to find out what the main difference is between my image and the one that works, and it turns out I don't seem to configure the uid stuff correctly. However, I decided against using this image altogether, because using the "official" eclipse-cbi image should be enough. And I thought, this should work out of the box, but it does not:

https://ci.eclipse.org/xtext/job/xtext-reference-projects/54/console
Comment 5 Nobody - feel free to take it CLA 2019-11-25 07:26:30 EST
This bug seems to go stale, but I still don't know what I'm doing wrong.

This build successfully spawned an agent: https://ci.eclipse.org/xtext/job/xtext-reference-projects/59/

It basically uses the same pod template as another job and executes the pipeline in docker.io/smoht/xtext-buildenv:0.7.

xtext-buildenv:0.7 is based on `eclipsecbi/fedora-gtk3-mutter:29-gtk3.24` and does little more than install some tools and create a new user (uid 10002).

This build does not spawn any agent: https://ci.eclipse.org/xtext/job/xtext-reference-projects/60/

The only difference here is that I switched the image spec to: `image: eclipsecbi/fedora-gtk3-mutter:31-gtk3.24` in the pod template.

Why does this image (which I assume is somewhat 'official') fail, while our downstream image continues to work?
Comment 6 Frederic Gurr CLA 2019-11-25 08:25:35 EST
Your container immediately terminates, since no command is run.

Please try to add "command: - cat" like

  - name: xtext-ref-env
    image: eclipsecbi/fedora-gtk3-mutter:31-gtk3.24
    tty: true
    command:
    - cat
Comment 7 Nobody - feel free to take it CLA 2019-11-25 09:07:56 EST
https://ci.eclipse.org/xtext/job/xtext-reference-projects/61/console

Well, that did the trick.

Our xtext-buildenv image does not add any command, but it does set the entrypoint to /bin/bash, while the entrypoint of the base image actually depends on receiving commands.

This was very confusing to figure out. Might I suggest adding 'cat' as default command in the base images?

Thanks for your help!