You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by David Blevins <da...@gmail.com> on 2022/10/10 14:57:18 UTC

Pull request builds

Was putting some thoughts into how we can maybe keep the build more stable.

One obstacle seems to be that the PR builder doesn't build PRs unless they're coming from branches inside the apache/tomee.git repo, not branches from a fork.  Is anyone else seeing the same thing or have any information there?

If there is some kind of limitation for that plugin, maybe we need to setup a git branch for each person who regularly submits PRs?

Brainstorming at this point.  Any thoughts?


-David


Re: Pull request builds

Posted by "Zowalla, Richard" <ri...@hs-heilbronn.de>.
Perhaps worth a mail to build@ ?

I can't imagine that others do not run into same issues related to
random number generations / entropy issues.

Gruß
Richard

Am Dienstag, dem 11.10.2022 um 17:50 +0200 schrieb Jean-Louis Monteiro:
> Yes you are correct. This is a possible problem.
> 
> Digging down a bit
> 
>  TomEE :: TCK :: MicroProfile Config TCK                     1 mn 38
> s
>  TomEE :: TCK :: MicroProfile Fault Tolerance TCK       1 h 11 mn
>  TomEE :: TCK :: MicroProfile Health TCK                     5 mn 6 s
>  TomEE :: iTests :: MicroProfile JWT                              11
> mn
>  TomEE :: TCK :: MicroProfile JWT TCK                        1 mn 50
> s
>  TomEE :: TCK :: MicroProfile Metrics TCK                    45 mn
>  TomEE :: TCK :: MicroProfile Open API TCK               8 mn 21 s
>  TomEE :: TCK :: MicroProfile Rest Client TCK             4 mn 8 s
> 
> I'm running them all locally to get a taste of how long they actually
> should take in an ideal world. So we have some more materials to
> reach out
> to infra.
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
> 
> 
> On Tue, Oct 11, 2022 at 5:42 PM David Blevins <
> david.blevins@gmail.com>
> wrote:
> 
> > > On Oct 11, 2022, at 2:33 AM, Jean-Louis Monteiro <
> > jlmonteiro@tomitribe.com> wrote:
> > > I can't measure without investing a lot of time, but looking at
> > > what
> > Maven
> > > reports
> > > CDI + BVal TCK around 25 min
> > > MicroProfile TCK 2 hours and a half
> > 
> > There's definitely something going on with the build machines as
> > the
> > MicroProfile TCK takes 1 or 2 minutes on my machine.
> > 
> > I've seen issues before where the random number generator runs out
> > of
> > entropy and basically stops any call to SecureRandom for several
> > minutes
> > while it just sits there and waits for more random numbers to be
> > generated.
> > 
> > With all the signing and encryption in the MicroProfile TCK, I bet
> > that's
> > what's going on.  Not too sure what options we might have.
> > 
> > We'd probably need something very simple we could use to show infra
> > and
> > work with them on a solution.
> > 
> > -David
> > 
> > 

Re: Pull request builds

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
Yes you are correct. This is a possible problem.

Digging down a bit

 TomEE :: TCK :: MicroProfile Config TCK                     1 mn 38 s
 TomEE :: TCK :: MicroProfile Fault Tolerance TCK       1 h 11 mn
 TomEE :: TCK :: MicroProfile Health TCK                     5 mn 6 s
 TomEE :: iTests :: MicroProfile JWT                              11 mn
 TomEE :: TCK :: MicroProfile JWT TCK                        1 mn 50 s
 TomEE :: TCK :: MicroProfile Metrics TCK                    45 mn
 TomEE :: TCK :: MicroProfile Open API TCK               8 mn 21 s
 TomEE :: TCK :: MicroProfile Rest Client TCK             4 mn 8 s

I'm running them all locally to get a taste of how long they actually
should take in an ideal world. So we have some more materials to reach out
to infra.
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Tue, Oct 11, 2022 at 5:42 PM David Blevins <da...@gmail.com>
wrote:

> > On Oct 11, 2022, at 2:33 AM, Jean-Louis Monteiro <
> jlmonteiro@tomitribe.com> wrote:
> >
> > I can't measure without investing a lot of time, but looking at what
> Maven
> > reports
> > CDI + BVal TCK around 25 min
> > MicroProfile TCK 2 hours and a half
>
> There's definitely something going on with the build machines as the
> MicroProfile TCK takes 1 or 2 minutes on my machine.
>
> I've seen issues before where the random number generator runs out of
> entropy and basically stops any call to SecureRandom for several minutes
> while it just sits there and waits for more random numbers to be generated.
>
> With all the signing and encryption in the MicroProfile TCK, I bet that's
> what's going on.  Not too sure what options we might have.
>
> We'd probably need something very simple we could use to show infra and
> work with them on a solution.
>
> -David
>
>

Re: Pull request builds

Posted by David Blevins <da...@gmail.com>.
> On Oct 11, 2022, at 2:33 AM, Jean-Louis Monteiro <jl...@tomitribe.com> wrote:
> 
> I can't measure without investing a lot of time, but looking at what Maven
> reports
> CDI + BVal TCK around 25 min
> MicroProfile TCK 2 hours and a half

There's definitely something going on with the build machines as the MicroProfile TCK takes 1 or 2 minutes on my machine.  

I've seen issues before where the random number generator runs out of entropy and basically stops any call to SecureRandom for several minutes while it just sits there and waits for more random numbers to be generated.

With all the signing and encryption in the MicroProfile TCK, I bet that's what's going on.  Not too sure what options we might have.

We'd probably need something very simple we could use to show infra and work with them on a solution.

-David


Re: Pull request builds

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
We have a couple of other challenges in my opinion.

Deps - all the shading is a pain but also takes a significant amount of time
Examples - they are somehow also some testing code for our server, but they
take time
TCK - more and more TCK are now standalone and we can run them easily. As a
result we do run CDI, BVal and all microprofile TCK for many flavors.
Should we have a specific TCK build triggered once per day unless we are
actively working on the project? Should we have the same approach as the
full platform TCK?
Webapps - aside from the disk space all the WAR manipulation to build the
drop in war jars, then build the zip, unzip the webapps, copy the jars is
heavy and a long process

I can't measure without investing a lot of time, but looking at what Maven
reports
CDI + BVal TCK around 25 min
MicroProfile TCK 2 hours and a half
Building TomEE and all the webapps, around 10 min
All examples 10 mins
Deps around 5 mins

The entire build takes almost 6 hours


--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Mon, Oct 10, 2022 at 9:58 PM David Blevins <da...@gmail.com>
wrote:

> > On Oct 10, 2022, at 12:50 PM, Zowalla, Richard <
> richard.zowalla@hs-heilbronn.de> wrote:
> >
> > Hi,
> >
> > The INFRA docs [1] do not mention any constraint that the PR needs to
> > come from the same repository.
> >
> > It is also a problem, that we need to rely on different versions of
> > Java based on a given branch, i.e. Java 8 for 8.x and Java 11 for 9.x,
> > etc - there is no easy way to decide which one to use for the naive PR
> > builder job.
> >
> > It might be possible, that there is a restriction regarding the GitHub
> > Apache org members due to security concerns?
> >
> > For example: https://github.com/apache/tomee/pull/782 did build on the
> > PR builder but the branch did not reside inside the ASF repo but was
> > located in my fork.
>
> I checked the build definition and it looks like we're just keeping max 3
> builds for 2 days, so possibly (likely) other builds were there and deleted
> before I could notice them.
>
> Looks like we have the clean workspace post-build step to delete the big
> files.  I added *.war to that and did a run locally with the same settings
> to see how it affected our size.  The workspace goes from 2.5GB to 262MB,
> which is great so I upped our max builds to 10 and retention to 20 days.
>
> We'll see if that helps.  Definitely we're not merging PRs in two days --
> usually more.
>
> Speaking of my own committing habits, I tend to push to main often.  I'll
> be trying to change that and do more PRs in hopes of not adding to the
> build instability.  Let's see how disciplined I can be in practice. :)
>
> If we all get in the habit of doing PRs, we could/should potentially
> increase that max builds as it would effectively become the main CI job.
>
>
> -David
>

Re: Pull request builds

Posted by Richard Zowalla <rz...@apache.org>.
Yes. Setting up an entire job is cumbersome.

I think, that it would be possible to have interactive user input (i.e.
the branch) for a Jenkins job using Jenkins pipelines without
additional plugins. Some solutions seem to require additional plugins.
So we need to check, which plugins are available on the ASF instance.

This might be a good first time contribution, if someone has access to
a Jenkins installation. It might be even possible to setup a test
instance locally via docker compose.

Gruß
Richard


Am Freitag, dem 11.11.2022 um 09:24 -0800 schrieb David Blevins:
> > On Nov 10, 2022, at 10:34 PM, Richard Zowalla <rz...@apache.org>
> > wrote:
> > 
> > Currently, it is not possible with Jenkins to run jobs from forked
> > repositories or for contributors, who do not have committer access
> > to
> > the TomEE repositories.
> 
> Thanks for getting that confirmed.
> 
> > However, they are discussing the possibility of having temporary
> > nodes
> > (on k8s) in the future, so these (security) restrictions can be
> > dropped.
> > 
> > Another possibility would be to explore the use of GitHub actions
> > for
> > running or (quick) tests in a PR build. I remember, that we
> > experimented with it in the past and it wasn't a good option due to
> > limitations / timing / resources. Maybe time to revisit and try the
> > "quick" build for PRs / commits again?
> 
> Speaking for myself only, I personally would not want to see PRs
> merged with only a quick build.  I always do a quick build before
> pushing any code and I routinely break the build.
> 
> Similarly, I don't like to merge PRs that do not have full clean
> build as I would feel it's my responsibility to find/fix any issues
> they caused.  Library upgrades in particular more often than not
> break something in the build, so definitely need a full build before
> merging.
> 
> > The workaround is to push the branch to the asf repo and let it
> > build
> > (as we are doing it).
> 
> Along these lines, we should be able to setup a manually run PR
> builder where we just enter the PR number and it does the rest.
> 
> The git portions might have to be a shell script, but it should be a
> little better than having to make an entire job definition for one PR
> (and also having to delete those old job definitions later)
> 
> I don't really have the time to work on anything like that now, but
> seems promising if someone wanted to volunteer.  Theoretically,
> anyone with access to a jenkins install could try it out, get
> something that works and then we can set it up in the Apache install.
> 
> 
> -David
> 

Re: Pull request builds

Posted by David Blevins <da...@gmail.com>.
> On Nov 10, 2022, at 10:34 PM, Richard Zowalla <rz...@apache.org> wrote:
> 
> Currently, it is not possible with Jenkins to run jobs from forked
> repositories or for contributors, who do not have committer access to
> the TomEE repositories.

Thanks for getting that confirmed.

> However, they are discussing the possibility of having temporary nodes
> (on k8s) in the future, so these (security) restrictions can be
> dropped.
> 
> Another possibility would be to explore the use of GitHub actions for
> running or (quick) tests in a PR build. I remember, that we
> experimented with it in the past and it wasn't a good option due to
> limitations / timing / resources. Maybe time to revisit and try the
> "quick" build for PRs / commits again?

Speaking for myself only, I personally would not want to see PRs merged with only a quick build.  I always do a quick build before pushing any code and I routinely break the build.

Similarly, I don't like to merge PRs that do not have full clean build as I would feel it's my responsibility to find/fix any issues they caused.  Library upgrades in particular more often than not break something in the build, so definitely need a full build before merging.

> The workaround is to push the branch to the asf repo and let it build
> (as we are doing it).

Along these lines, we should be able to setup a manually run PR builder where we just enter the PR number and it does the rest.

The git portions might have to be a shell script, but it should be a little better than having to make an entire job definition for one PR (and also having to delete those old job definitions later)

I don't really have the time to work on anything like that now, but seems promising if someone wanted to volunteer.  Theoretically, anyone with access to a jenkins install could try it out, get something that works and then we can set it up in the Apache install.


-David


Re: Pull request builds

Posted by Richard Zowalla <rz...@apache.org>.
Hi,

I got some updates from builds@

Currently, it is not possible with Jenkins to run jobs from forked
repositories or for contributors, who do not have committer access to
the TomEE repositories.

The workaround is to push the branch to the asf repo and let it build
(as we are doing it).

However, they are discussing the possibility of having temporary nodes
(on k8s) in the future, so these (security) restrictions can be
dropped.

Another possibility would be to explore the use of GitHub actions for
running or (quick) tests in a PR build. I remember, that we
experimented with it in the past and it wasn't a good option due to
limitations / timing / resources. Maybe time to revisit and try the
"quick" build for PRs / commits again?

Gruß
Richard

Am Freitag, dem 28.10.2022 um 06:09 +0000 schrieb Zowalla, Richard:
> Hi,
> 
> I dropped a message in the builds slack channel to get some thoughts
> on
> our PR issue. Maybe they can give us some hints to docs. 
> 
> If the topic is to broad / wide for a quick slack chat, I will sent a
> mail to builds@ to get some thoughts / ideas. 
> 
> I agree with David, that we cannot be the only project, which suffers
> from that issue.
> 
> Gruß
> Richard
> 
> 
> Am Donnerstag, dem 27.10.2022 um 10:38 +0200 schrieb Jean-Louis
> Monteiro:
> > It only works if you push the PR straight to Apache repo I think
> > Richard
> > mentioned.
> > So every non committer submitting a PR is out of the builder. We
> > need
> > to
> > ask Infra maybe. I'd be surprised if we would be the first project
> > to
> > face
> > it.
> > --
> > Jean-Louis Monteiro
> > http://twitter.com/jlouismonteiro
> > http://www.tomitribe.com
> > 
> > 
> > On Thu, Oct 27, 2022 at 12:47 AM David Blevins <
> > david.blevins@gmail.com>
> > wrote:
> > 
> > > > On Oct 26, 2022, at 2:13 PM, David Blevins <
> > > > david.blevins@gmail.com>
> > > wrote:
> > > > I wonder if there's some way this can be improved so Richard
> > > > doesn't
> > > have to create CI jobs for individual PRs.  At minimum, maybe we
> > > can have a
> > > PR builder job that takes the PR number as a parameter?
> > > 
> > > I wonder also if there's some way with a Github Action that a
> > > committer
> > > could comment "test this please" and have that PR build kicked
> > > off
> > > in
> > > Apache's Jenkins?
> > > 
> > > 
> > > -David
> > > 
> > > 

Re: Pull request builds

Posted by "Zowalla, Richard" <ri...@hs-heilbronn.de>.
Hi,

I dropped a message in the builds slack channel to get some thoughts on
our PR issue. Maybe they can give us some hints to docs. 

If the topic is to broad / wide for a quick slack chat, I will sent a
mail to builds@ to get some thoughts / ideas. 

I agree with David, that we cannot be the only project, which suffers
from that issue.

Gruß
Richard


Am Donnerstag, dem 27.10.2022 um 10:38 +0200 schrieb Jean-Louis
Monteiro:
> It only works if you push the PR straight to Apache repo I think
> Richard
> mentioned.
> So every non committer submitting a PR is out of the builder. We need
> to
> ask Infra maybe. I'd be surprised if we would be the first project to
> face
> it.
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
> 
> 
> On Thu, Oct 27, 2022 at 12:47 AM David Blevins <
> david.blevins@gmail.com>
> wrote:
> 
> > > On Oct 26, 2022, at 2:13 PM, David Blevins <
> > > david.blevins@gmail.com>
> > wrote:
> > > I wonder if there's some way this can be improved so Richard
> > > doesn't
> > have to create CI jobs for individual PRs.  At minimum, maybe we
> > can have a
> > PR builder job that takes the PR number as a parameter?
> > 
> > I wonder also if there's some way with a Github Action that a
> > committer
> > could comment "test this please" and have that PR build kicked off
> > in
> > Apache's Jenkins?
> > 
> > 
> > -David
> > 
> > 

Re: Pull request builds

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
It only works if you push the PR straight to Apache repo I think Richard
mentioned.
So every non committer submitting a PR is out of the builder. We need to
ask Infra maybe. I'd be surprised if we would be the first project to face
it.
--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com


On Thu, Oct 27, 2022 at 12:47 AM David Blevins <da...@gmail.com>
wrote:

>
> > On Oct 26, 2022, at 2:13 PM, David Blevins <da...@gmail.com>
> wrote:
> >
> > I wonder if there's some way this can be improved so Richard doesn't
> have to create CI jobs for individual PRs.  At minimum, maybe we can have a
> PR builder job that takes the PR number as a parameter?
>
> I wonder also if there's some way with a Github Action that a committer
> could comment "test this please" and have that PR build kicked off in
> Apache's Jenkins?
>
>
> -David
>
>

Re: Pull request builds

Posted by David Blevins <da...@gmail.com>.
> On Oct 26, 2022, at 2:13 PM, David Blevins <da...@gmail.com> wrote:
> 
> I wonder if there's some way this can be improved so Richard doesn't have to create CI jobs for individual PRs.  At minimum, maybe we can have a PR builder job that takes the PR number as a parameter?

I wonder also if there's some way with a Github Action that a committer could comment "test this please" and have that PR build kicked off in Apache's Jenkins?


-David


Re: Pull request builds

Posted by David Blevins <da...@gmail.com>.
> On Oct 10, 2022, at 12:57 PM, David Blevins <da...@gmail.com> wrote:
> 
>> On Oct 10, 2022, at 12:50 PM, Zowalla, Richard <ri...@hs-heilbronn.de> wrote:
>> 
>> It might be possible, that there is a restriction regarding the GitHub
>> Apache org members due to security concerns? 
>> 
>> For example: https://github.com/apache/tomee/pull/782 did build on the
>> PR builder but the branch did not reside inside the ASF repo but was
>> located in my fork.
> 
> I checked the build definition and it looks like we're just keeping max 3 builds for 2 days, so possibly (likely) other builds were there and deleted before I could notice them.

Looking a the PR builder job I still don't see it building all the PRs

 - https://ci-builds.apache.org/job/Tomee/job/master-pull-request/

I see it building PRs from myself, Jean-Louis and Richard.  I don't see it building any of Swell's PRs.

It seems that (likely for security reasons) it ignores any PRs that don't come from people with write access to the repo.

I wonder if there's some way this can be improved so Richard doesn't have to create CI jobs for individual PRs.  At minimum, maybe we can have a PR builder job that takes the PR number as a parameter?


-David


Re: Pull request builds

Posted by David Blevins <da...@gmail.com>.
> On Oct 10, 2022, at 12:50 PM, Zowalla, Richard <ri...@hs-heilbronn.de> wrote:
> 
> Hi,
> 
> The INFRA docs [1] do not mention any constraint that the PR needs to
> come from the same repository. 
> 
> It is also a problem, that we need to rely on different versions of
> Java based on a given branch, i.e. Java 8 for 8.x and Java 11 for 9.x,
> etc - there is no easy way to decide which one to use for the naive PR
> builder job.
> 
> It might be possible, that there is a restriction regarding the GitHub
> Apache org members due to security concerns? 
> 
> For example: https://github.com/apache/tomee/pull/782 did build on the
> PR builder but the branch did not reside inside the ASF repo but was
> located in my fork.

I checked the build definition and it looks like we're just keeping max 3 builds for 2 days, so possibly (likely) other builds were there and deleted before I could notice them.

Looks like we have the clean workspace post-build step to delete the big files.  I added *.war to that and did a run locally with the same settings to see how it affected our size.  The workspace goes from 2.5GB to 262MB, which is great so I upped our max builds to 10 and retention to 20 days.

We'll see if that helps.  Definitely we're not merging PRs in two days -- usually more.

Speaking of my own committing habits, I tend to push to main often.  I'll be trying to change that and do more PRs in hopes of not adding to the build instability.  Let's see how disciplined I can be in practice. :)

If we all get in the habit of doing PRs, we could/should potentially increase that max builds as it would effectively become the main CI job.


-David
   

Re: Pull request builds

Posted by "Zowalla, Richard" <ri...@hs-heilbronn.de>.
Hi,

The INFRA docs [1] do not mention any constraint that the PR needs to
come from the same repository. 

It is also a problem, that we need to rely on different versions of
Java based on a given branch, i.e. Java 8 for 8.x and Java 11 for 9.x,
etc - there is no easy way to decide which one to use for the naive PR
builder job.

It might be possible, that there is a restriction regarding the GitHub
Apache org members due to security concerns? 

For example: https://github.com/apache/tomee/pull/782 did build on the
PR builder but the branch did not reside inside the ASF repo but was
located in my fork.

Sadly our full build takes too long for GH actions...

Gruß
Richard

[1] 
https://cwiki.apache.org/confluence/display/INFRA/Kicking+off+a+Jenkins+build+with+a+GitHub+PR


Am Montag, dem 10.10.2022 um 09:57 -0500 schrieb David Blevins:
> Was putting some thoughts into how we can maybe keep the build more
> stable.
> 
> One obstacle seems to be that the PR builder doesn't build PRs unless
> they're coming from branches inside the apache/tomee.git repo, not
> branches from a fork.  Is anyone else seeing the same thing or have
> any information there?
> 
> If there is some kind of limitation for that plugin, maybe we need to
> setup a git branch for each person who regularly submits PRs?
> 
> Brainstorming at this point.  Any thoughts?
> 
> 
> -David
>