jenkinsci / jenkinsci/google-compute-engine-plugin

Attaching a start up script to an instance template

Open
#443 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
58
Forks
97
PR merge metrics
No merged PRs in 30d

Description

> Have the same issue with Jenkins 2.249.3 and compute engine plugin 4.3.3 despite installing java in "Startup script" section. Image used: "ubuntu-2004-focal-v20201028"
>
> The issue appears to be related to:
> #165
>
> #166
> #186

Have you got OSLogin enabled globally? If so then you you will need to create an instance template outside of jenkins and disable OSLogin within the metadata. In Jenkins then you just reference the instance template that you've already created.

That was how I resolved the issue in my case. OSLogin is enabled globally but the GCP Plugin in Jenkins doesn't seem to work when it is enabled so you need to disable it for any Jenkins nodes

_Originally posted by @emmaLP in https://github.com/jenkinsci/google-compute-engine-plugin/issues/194#issuecomment-728144929_

Sorry, I know this is a long time after this issue but please would you know if it was possible to attach a start up script to an instance template (not a vm instance) and if possible how to do so? I have successfully set up an instance template in jenkins that was cloned from an existing vm instance that had Java 11 installed but when the on-demand agents are created in GCP, I get the Java not installed error. I am hoping that a start up script will install Java on the fly, on the agents created from the template...Thanks

Contributor guide

Open the contributing guide

Research direction

Review the Google Compute Engine plugin's instance-template configuration and the related issues #165, #166, and #186 first. Reproduce the behavior with Jenkins 2.249.3, plugin 4.3.3, the Ubuntu 20.04 image, and OSLogin enabled; done means a configured startup script is applied to agents created from the template.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud, java
Domain
cloud, devops, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.