Comments (11)
@craigatgoogle thanks for the feedback.
I see that it won't be trivial to support the requirement from the plugins point of view.
I had see the k8s plugin. I had hoped being able to avoid it, as it adds another layer of complexity, compared to a solution, that runs only in GCE VM instances.
I created kind of workaround for my requirement:
I am using Packer/Packer Google Compute Builder
to extend the CoreOS (stable) image, which is already present at GCE image marketplace. I am using CoreOS here, because in contrast to ContainerOptimizedOS, I am able to install binaries (though not recommended). I am installing OpenJDK11 into this image, and using the created custom image for my Jenkins slave. The final VM instance is capable of OpenJDK11 and Docker (only). Perfect for https://jenkins.io/doc/book/pipeline/docker/.
You can find the packer image template at https://gist.github.com/SchulteMarkus/4221cfa6059b9e4827c073017a9bac35
from google-compute-engine-plugin.
Thanks for bringing this up. Didn't realize it wasn't trivial to be running containers on GCE instances with the plugin when I first commented on the JIRA issue.
Right now, as you may know, the plugin SSH's directly to the VM. We programmatically insert a security key to the compute engine vm's instance metadata and have the other key when we SSH. Consequently, we won't be able to reach the container running on the VM.
However, this is an interesting use case. I can't guarantee we will implement it, but I will label it as a feature request.
from google-compute-engine-plugin.
Thanks for the update, Rachel.
In my opinion, this is THE usecase for the google-compute-engine-plugin. Using https://cloud.google.com/container-optimized-os/ in combination with https://jenkins.io/doc/book/pipeline/docker/ as Jenkins slave would be awesome.
from google-compute-engine-plugin.
Thanks for the extra information!
from google-compute-engine-plugin.
@SchulteMarkus thanks for the feedback. Fyi, the work to support this is non-trivial, so it will merit some further consideration. In the mean time, have you considered using the k8s plugin and running workloads in GKE? Running containers is what GKE excels at. We have a great solutions article which covers this use case here: https://cloud.google.com/solutions/jenkins-on-kubernetes-engine-tutorial
from google-compute-engine-plugin.
@SchulteMarkus thanks for sharing. I think in the interim, highlighting this workaround in the plugin docs could provide value to other users who share a similar requirement.
from google-compute-engine-plugin.
@SchulteMarkus may we use your JSON template in our documentation for a workaround?
from google-compute-engine-plugin.
from google-compute-engine-plugin.
@SchulteMarkus were you able to get this working? if yes how?
from google-compute-engine-plugin.
@SchulteMarkus were you able to get this working? if yes how?
I wasn't able to get this working.
from google-compute-engine-plugin.
i was able to get it to pass java issue but not able to redirect stdin to the container so that agent can come up. basically i am passing below init script to vm and wait for the image to load, once it is loaded, i run agent.jar, but jenkins to write stdin to remote agent to start it which i do not know how to achieve.
cat > /tmp/java <<'EOF'
#!/bin/bash
if [ "$1" == "-fullversion" ]; then
echo $@
else
while ! docker ps | grep IMAGE_NAME; do
sleep 5
docker ps
done
docker exec -it $(docker ps | grep IMAGE_NAME | cut -d ' ' -f 1 | tr -s ' ') 'java -jar /tmp/agent.jar'
fi
EOF
from google-compute-engine-plugin.
Related Issues (20)
- Feature request: Option to delay agent connection to allow custom startup script to finish HOT 3
- Option the set MAXIMUM triggered builds for an agent
- Enable billing measure of GCP Jenkins workers HOT 2
- The hpi download link is broken HOT 2
- Add new spot for provision type HOT 2
- New Node with "Google Compute Engine" failed HOT 1
- Add an ability to provide image family name instead of image name HOT 1
- Create snapshot defaulting to multi-region
- Expose Prefix Start Agent Command and Suffix Start Agent Command
- Jobs on preempted VMs hang indefinitely until manually cancelled HOT 2
- Option to limit run time of VM HOT 1
- Large number of offline build executors when there is no capacity
- Add option for enabling nested virtualization
- External IP Address can't be configured HOT 10
- Attaching a start up script to an instance template
- Nullsafe operator required
- Change mahine type from configuration not working
- Long wait times to provision a VM in GCP HOT 4
- Jenkins losing connection to GCE VM / GCE VM shutting down HOT 1
- Preempted VMs are sometimes not properly detected HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-compute-engine-plugin.