Re: Jenkins + Kubernetes - Cache .m2 for jobs

2020-03-25 Thread Liejun Tao
This is my solution for a little different purpose: use a .m2 cache for
common libs.
https://github.com/liejuntao001/jenkins-k8sagent-lib/blob/a6ced3975e37fe559c0ae8a918ed01b6920f1efa/resources/podtemplates/base.yaml#L24
The idea is to make a docker image with the most used artifacts(external
dependencies) in .m2 folder.
At the launch of the Agent, copy them to workspace's .m2 folder from the
image.

This should be adapted to fit your needs.
I assume you are not going to run concurrent builds for a job to avoid
concurrent write, if you want a job has a dedicated cache.
At the end of a build, create a docker image based on the existing .m2
content and push back for next time use.

If you are going to run concurrently builds, this idea of a sharing cache
is invalid, I think.

On Tue, Jul 10, 2018 at 8:05 AM Enguerrand A <
allamel.enguerr...@thalesaleniaspace.com> wrote:

> Hello everyone,
>
> I use the Kubernetes plugin for Jenkins to launch all Jenkins jobs in a
> Kubernetes cluster. For better performance, I want to use a persistent
> disk for the cache of different job Maven with insulation of it, ie a disk
> space per job (to separate the cache)
>
> Do you have ideas for automatic solutions with the Kubernetes plugin to
> have cache on the .m2 (or another type of cache) with a different disk by
> jobs ?
>
> Thank you in advance !
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/de71d26c-115e-4679-af8e-0151fbb3b8c9%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks,
Baibai

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAMRm5jbRhhtF5S4bzzT%3Du7La4sggNW2c-kEAjVMaqBeBK6cHPg%40mail.gmail.com.


Re: Security for team-specific nodes

2020-03-25 Thread Jason Swager
If you use CloudBees Jenkins and their Folder Plus plugin, there is a 
feature on Folders that allows exactly this.  There is a Controlled 
Slave/Folder feature where you can set a mapping between one or more 
folders to a slave.  Such that only jobs in the mapped folder can execute 
on the mapped slave.  If a job in an unmapped folder tries to run on the 
slave, the build won't run on the slave and instead have to find a public 
one (one with no restrictions) or sit in the queue forever.

On Wednesday, March 25, 2020 at 6:25:22 AM UTC-7, Roland Asmann wrote:
>
> Hey everybody,
>
> I am a Jenkins admin in my company, but since the introduction of 
> pipelines, I feel like I have lost a lot of control over Jenkins. There are 
> a couple of things in my company that are really important for me to remain 
> in control of, so I was hoping to get some pointers from some/all of you.
>
> As a company, we supply the Jenkins Master with several 'public' nodes. 
> These can be used by all projects and are paid for by all. Then we have 
> some projects that have their own, special nodes, which only they pay for. 
> The thing is, although these slaves are configured to be used only by jobs 
> that request their specific labels, some of the teams have figured out that 
> some of these nodes are a lot faster than our public ones and keep using 
> these 'private' nodes. Since the projects that supplied these servers can 
> sometimes run ONLY on these nodes (eg because they use lots of memory or 
> have some specific hardware connected), they are obviously unhappy when 
> they have to wait because the nodes are running 'illegal' jobs -- not even 
> mentioning the fact they actually pay for these nodes...
>
> Now, I was wondering if it was possible to configure nodes to be only used 
> by certain people/groups/jobs/..., or even better, have the UI hide them 
> from people that are not supposed to use them?
>
> We are currently using Project-based security with LDAP and the Folder 
> Plugin --> Every Project has a Group in LDAP and a folder in Jenkins where 
> they have their jobs. It would be great if I can somehow 'connect' a server 
> to one or more group(s) or folder(s).
>
> Does anybody have any ideas on how to get (something like) this setup? Any 
> suggestions are welcome!
>
> Thanks,
> Roland
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/80930fd7-c433-45ce-a963-ae47b67653ca%40googlegroups.com.


Re: Jenkins + Kubernetes - Cache .m2 for jobs

2020-03-25 Thread Tristan FAURE
Hello !
we have the same issue

what we would like is the same behavior as : 
https://docs.gitlab.com/ee/ci/caching/

I have seen this example : 
https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/maven-with-cache.groovy
but if several jobs run in parallel I don't want them to modify the same 
volumes and I would like to not create volumes before the jobs

I have seen the dynamic claim options for workspace but data are common for 
a run and not a job does it ?

our idea currently is creating a volume claim with a name ${jobid} or 
{folderId} and set a K8S cron job that delete frequently but we don't find 
a way to set this by default (we tried in raw yaml option but it seems it 
only support kind : Pod)

Regards

Le mercredi 11 juillet 2018 09:48:23 UTC+2, Enguerrand A a écrit :
>
> The problem is that I would like to automate the installation of the PV or 
> PVC without needing to specify it in the Jenkinsfile but at least I can 
> automate the creation of PVC or PV for each job to avoid manual operation. 
>
> I saw that automatically a PVC or PV could be mounted for the workspace 
> Jenkins, but it raises concerns if 2 build on the same job runs on the same 
> shared workspace (build can inflict another by removing files for example)
>
> Le mardi 10 juillet 2018 15:35:17 UTC+2, Carlos Sanchez a écrit :
>>
>> you can mount a PV or PVC but depending on what backend you use that will 
>> prevent concurrent executions
>>
>> On Tue, Jul 10, 2018 at 3:05 PM Enguerrand A <
>> allamel.e...@thalesaleniaspace.com> wrote:
>>
>>> Hello everyone,
>>>
>>> I use the Kubernetes plugin for Jenkins to launch all Jenkins jobs in a 
>>> Kubernetes cluster. For better performance, I want to use a persistent 
>>> disk for the cache of different job Maven with insulation of it, ie a disk 
>>> space per job (to separate the cache)
>>>
>>> Do you have ideas for automatic solutions with the Kubernetes plugin to 
>>> have cache on the .m2 (or another type of cache) with a different disk by 
>>> jobs ?
>>>
>>> Thank you in advance !
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Jenkins Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to jenkinsci-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/de71d26c-115e-4679-af8e-0151fbb3b8c9%40googlegroups.com
>>>  
>>> 
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/58617773-5901-4f03-97e3-4bfae081b207%40googlegroups.com.


Re: Your profile name includes a 'profile ' prefix

2020-03-25 Thread Alan Sparks
I apologize for the spam, I was able to determine the cause... found a 
message in logs that suggested it was an AWS credential issue.  Log 
messages stopped after fixing this.

2020-03-25 15:52:12.362+ [id=35]WARNING 
c.a.p.p.c.CredentialsLegacyConfigLocationProvider#getLocation: Found the 
legacy config profiles file at [/var/lib/jenkins/.aws/config]. Please move 
it to the latest default location [~/.aws/credentials].

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f3df3df2-9391-40e8-a157-9fefc7dc4da9%40googlegroups.com.


Your profile name includes a 'profile ' prefix

2020-03-25 Thread Alan Sparks
I've suddenly started getting a lot of the following message in my Jenkins 
logs.  I'm figuring it happened coincident with one of my team members copying 
a jobs folder from our previous Jenkins install to my newer one (running LTS 
2.204.5).

Can anyone tell me what the log messages are referring to, and how to clean it 
up?  Thanks in advance.
-Alan

2020-03-25 15:17:35.966+ [id=31]WARNING 
c.a.a.p.i.BasicProfileConfigLoader#loadProfiles: Your profile name includes a 
'profile ' prefix. This is considered part of the profile name in the Java SDK, 
so you will need to include this prefix in your profile name when you reference 
this profile from your Java code.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/SN1PR18MB21418F66777C229F00198190C5CE0%40SN1PR18MB2141.namprd18.prod.outlook.com.


Re: CI with Git in Jenkins

2020-03-25 Thread Mark Waite
Multibranch pipelines assume that you want to build all branches that
include a Jenkinsfile any time the notification is received through
notifyCommit or through a Web Hook.  If you do not want one or more
branches built on multibranch pipelines, you'll need to exclude them.  The
Basic Branch Build Strategies plugin (
https://github.com/jenkinsci/basic-branch-build-strategies-plugin/blob/master/docs/user.adoc)
provides many branch selection options.

On Wed, Mar 25, 2020 at 7:39 AM Roland Asmann 
wrote:

> Hi everybody,
>
> Way-back-when, Kohsuke wrote this post about how to setup CI with Git in
> Jenkins:
> https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/
>
> I have been using this in most my builds since and am still trying to get
> all colleagues to do the same (don't ask, my company can be difficult
> sometimes). Anyway, the other day I noticed that in one of my Jenkinsfiles,
> I forgot to activate the SCM polling. However, this project had been
> building on git pushes since the start!
>
> Doing some testing on my own, I came to the following conclusion:
> - Non-pipeline jobs all need to have the polling activated to react to the
> Git hook
> - Single pipeline jobs also need to have polling activated
> - Multibranch pipelines **don't** need to have polling activated, they
> just build whenever the git hook sends its request to Jenkins
>
> Now, my question is, is this behavior correct? Does it mean that for
> multibranch pipelines, I **can't** NOT do CI? (Except for removing the
> hook, but that might influence other builds as well!) Is this actual
> behavior documented somewhere and did I just miss this information?
>
> And what is now the correct way to setup CI? Should I still add the
> polling in my Jenkinsfile or, if I am sure I will be using a multibranch
> pipeline, just leave it out?
>
> Thanks.
>
> Roland
>
> --
> You received this message because you are subscribed to the Google Groups
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jenkinsci-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/828bed5a-dda6-4782-82d9-6834b1f0e074%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtF-Hx%3Ds5MvNssLoE5jDnzhhVu4HkuSvosNd_Y9zdoxmrA%40mail.gmail.com.


CI with Git in Jenkins

2020-03-25 Thread Roland Asmann
Hi everybody,

Way-back-when, Kohsuke wrote this post about how to setup CI with Git in 
Jenkins: 
https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/

I have been using this in most my builds since and am still trying to get 
all colleagues to do the same (don't ask, my company can be difficult 
sometimes). Anyway, the other day I noticed that in one of my Jenkinsfiles, 
I forgot to activate the SCM polling. However, this project had been 
building on git pushes since the start!

Doing some testing on my own, I came to the following conclusion:
- Non-pipeline jobs all need to have the polling activated to react to the 
Git hook
- Single pipeline jobs also need to have polling activated
- Multibranch pipelines **don't** need to have polling activated, they just 
build whenever the git hook sends its request to Jenkins

Now, my question is, is this behavior correct? Does it mean that for 
multibranch pipelines, I **can't** NOT do CI? (Except for removing the 
hook, but that might influence other builds as well!) Is this actual 
behavior documented somewhere and did I just miss this information?

And what is now the correct way to setup CI? Should I still add the polling 
in my Jenkinsfile or, if I am sure I will be using a multibranch pipeline, 
just leave it out?

Thanks.

Roland

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/828bed5a-dda6-4782-82d9-6834b1f0e074%40googlegroups.com.


Security for team-specific nodes

2020-03-25 Thread Roland Asmann
Hey everybody,

I am a Jenkins admin in my company, but since the introduction of 
pipelines, I feel like I have lost a lot of control over Jenkins. There are 
a couple of things in my company that are really important for me to remain 
in control of, so I was hoping to get some pointers from some/all of you.

As a company, we supply the Jenkins Master with several 'public' nodes. 
These can be used by all projects and are paid for by all. Then we have 
some projects that have their own, special nodes, which only they pay for. 
The thing is, although these slaves are configured to be used only by jobs 
that request their specific labels, some of the teams have figured out that 
some of these nodes are a lot faster than our public ones and keep using 
these 'private' nodes. Since the projects that supplied these servers can 
sometimes run ONLY on these nodes (eg because they use lots of memory or 
have some specific hardware connected), they are obviously unhappy when 
they have to wait because the nodes are running 'illegal' jobs -- not even 
mentioning the fact they actually pay for these nodes...

Now, I was wondering if it was possible to configure nodes to be only used 
by certain people/groups/jobs/..., or even better, have the UI hide them 
from people that are not supposed to use them?

We are currently using Project-based security with LDAP and the Folder 
Plugin --> Every Project has a Group in LDAP and a folder in Jenkins where 
they have their jobs. It would be great if I can somehow 'connect' a server 
to one or more group(s) or folder(s).

Does anybody have any ideas on how to get (something like) this setup? Any 
suggestions are welcome!

Thanks,
Roland

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/6fa22e96-bb24-4362-8bd5-8d25e6ede649%40googlegroups.com.