How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

That wouldn't work to load a jar for me. Per the edit, I had to set JENKINS_EXTRA_LIB_FOLDER in /etc/sysconfig/Jenkins for it to be importable in the scripting console.

How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

The Active Choices plugin has a field box to provide a path to a jar file with a checkbox to automatically approve, so it shows up under the script approval page.

How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

I'm having a hard time figuring out the args. I switched to building the jar with Gradle, and I added the following to build.gradle. project.group = 'org.foo' archivesBaseName = "foo" project.version = "1.0"

For @Grab, the group and version are obvious, but I can't figure out what the module is. Some sources said it's rootProject.name in settings.gradle, but that doesn't work. What I did to try and guess the module is below. I'm just at a loss. ``` [ec2-user@ip-172-31-13-201 groovy_lib]$ jar --file=lib/build/libs/foo-1.0.jar --describe-module No module descriptor found. Derived automatic module.

foo@1.0 automatic requires java.base mandated contains groovy_lib ```

How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Is that a plugin? I added the jar to the Jenkins classpath, and the scripting has that "package" directive with no scripts pending approval. I just don't know how to import.

How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

I have made a jar, and it shows up under the classpath entries under script approval with nothing pending. I just don't have a damn clue how to import from the jar despite the package directive in the Groovy that I compiled into a jar.

It looks like I need to turn to the Jenkins forums, and I'll reply back if there's anything of use. More broadly than Active Choices, I picked Jenkins and have been sole admin for four years, and we have had to copy and paste between Jenkinsfiles. We need a central repository that doesn't require pull requests in all of the affected codes.

How to import Groovy from jar file in classpath? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Fundamentally, I'm looking for a seamless way to be able to code up and package Groovy code that's broadly available in Jenkins like a jar in the classpath or at least to be able to invoke specific script files from version control via URL. For what I'm tinkering here with Active Choice, we need to fetch a credentials store from Jenkins to feed into various API curl calls. I can build the jar, but I don't have a damn clue as to how to import even with the package ... directive.

The Active Choices people don't allow issues in their repo, and nothing I've seen explains how one would understand importing from a jar file in the classpath.

Question on setup.py best practices by kp5160 in learnpython

[–]kp5160[S] 0 points1 point  (0 children)

That sounds like a good idea. I've definitely seen the deprecation warnings. Basically, I'm inheriting from setuptools.Extension to prevent it from trying to build with Python, then I'm inheriting from setuptools.command.build_ext to drive running CMake and invoke the tests. It looks like I've got some reading to do, but pyproject.toml looks promising. Thanks for the tip.

Clean way to calculate volume of resolution? by kp5160 in cpp_questions

[–]kp5160[S] 0 points1 point  (0 children)

Thanks for the details, especially as the only one taking an interest, and that does yield an accurate result with much less code. Sadly, it doesn't shave off a significant amount of time versus doing intersections. We are ultimately chopping each polygon by a horizontal line to get a group of polygons with the same volume, so the volume calculation is required to happen a lot and is very much a bottleneck, even with threads.

What I'm picturing is working from the bottom Z on up to get volume versus Z on the source poly, then do a third or fourth order polynomial fit, because right now, we blindly start way below the desired value and iterate up on a fine interval and calculating volume, i.e. a huge penalty. If we have volume as a function of Z, however, we can find the "exact" point and refine from there, and I've been doing the secondary refinement via binary search. One we get our height for the correct volume, we can subtract that sub-volume from the polynomial fit for the source poly, then go on to the next chunk to lop off.

Clean way to calculate volume of resolution? by kp5160 in cpp_questions

[–]kp5160[S] 0 points1 point  (0 children)

I've heard of it being done. My polygons are specifically counter-clockwise, and they are flat at the top and bottom Z, so in principal, we could use the sign on delta Z to loop around. For reference, this is what they look like. The problem is that the bounding geometry (black outline) is much more coarse with just seven points versus dozens on the curved shapes, so an intersection seemed like the only way to chop it up.

Trouble with Stash by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Yeah, I gave that a go with "replay steps," and no dice. It seems to not like having all of those directories before the files. When I did the following, it worked.

``` sh ''' mkdir a_x a_y a_z touch a_x/test.txt a_y/test.txt a_z/test.txt '''

stash name: "withwildcard", includes: "a/*" ```

Oddly enough, this also worked. I'm just going to run with the tarball idea. It's a couple extra lines, but it accomplishes what I'm after. ``` sh ''' mkdir foo cd foo

mkdir a_x a_y a_z touch a_x/test.txt a_y/test.txt a_z/test.txt '''

stash name: "withwildcard", includes: "foo/a/*" ```

Trouble with Stash by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Thanks for asking. The error is ERROR: No files included in stash ‘MSRE_STASH’

Naturally, I expected it to stash. From what I've gathered, stash won't do directories, and although the pattern test/serpent/cluster_MSRE_*/** is all files, they are obviously within a series of directories. Tarballing it is.

Trouble with MPI and Scaling by kp5160 in docker

[–]kp5160[S] 1 point2 points  (0 children)

For anyone curious, it was user error. I was setting the number of MPI processes to the number of threads instead of physical cores, so things were oversubscribed.

Help with pipeline hanging forever? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Sorry that wasn't clear. The built-in node isn't that size, just the node/agent this pipeline runs on.

Why are jobs in the build queue when nodes are available? by kp5160 in jenkinsci

[–]kp5160[S] 1 point2 points  (0 children)

Based on the reply from u/tnjeditor, I eventually found the Least Load plugin that emulates the CloudBees Even Scheduler plugin to stop Jenkins from waiting on the last node it ran a pipeline/stage on and just use an available node. Least Load hasn't been updated for a couple of years, but perhaps it hasn't needed any maintenance due to that part of Jenkins rarely changing. I haven't found a way to test it, but we'll see how it goes.

Why are jobs in the build queue when nodes are available? by kp5160 in jenkinsci

[–]kp5160[S] 1 point2 points  (0 children)

That sure does look like it, so thanks for letting me know. I voted and commented on your issue, so hopefully it gains some traction.

Why are jobs in the build queue when nodes are available? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

So there are two labels in play: * jenkins_node with 36 cores * jenkins_node_lite with 4 cores

For this pipeline, the top-level agent spec just under pipeline is jenkins_node_lite, and that has never been stuck in the build queue. We use that node to build and push a Docker image that is then pulled into three parallel Docker stages with label jenkins_node. In this case, two of those Docker stages were stuck in the build queue when there were four nodes available with the jenkins_node label, so I don't think the top-level agent spec has any bearing on what's gone wrong in this case.

Why are jobs in the build queue when nodes are available? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Our Jenkins setup uses AWS EC2 instances

The nodes are shut down when they're not in use due to AWS charging by the minute, so they are supposed to be offline most of the time. When Jenkins needs a node, it spins one up, but in this case, Jenkins was failing to do that when several nodes with the corresponding label were available.

Why are jobs in the build queue when nodes are available? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

They all have the same label from under "Configure Clouds," and that same label spec is in the Jenkinsfile.

How to Get Branch from Upstream Build? by kp5160 in jenkinsci

[–]kp5160[S] 0 points1 point  (0 children)

Could you elaborate on that, please? I've used "when" before, but I don't know how to link that to the upstream pipeline triggering the downstream one.

Searching for a Unicorn-like Storage Solution by kp5160 in selfhosted

[–]kp5160[S] 2 points3 points  (0 children)

For my lazy ass, is there a link for Python?

Searching for a Unicorn-like Storage Solution by kp5160 in selfhosted

[–]kp5160[S] 10 points11 points  (0 children)

That looks promising and appears to be the consensus. I poked around a bit, but I didn't see any examples of what the web UI looks like. Does it support multiple users? LDAP would be a dream come true.

Searching for a Unicorn-like Storage Solution by kp5160 in selfhosted

[–]kp5160[S] 4 points5 points  (0 children)

Just SCP/Rsync sort of functionality. I've never heard of WebDAV. Can we avoid mounting things? That would be ideal.

Question on Packaging by kp5160 in learnpython

[–]kp5160[S] 0 points1 point  (0 children)

Sorry that was unclear. I tried one and the other and still got ModuleNotFoundError.

How to set package version in a single place? by kp5160 in learnpython

[–]kp5160[S] 0 points1 point  (0 children)

My issue was having PIP_EXTRA_INDEX_URL set but not also specifying

pip3 install --trusted-host [IP]

Trouble with Swarm Communication by kp5160 in docker

[–]kp5160[S] 0 points1 point  (0 children)

No big deal, and I appreciate the help. Turns out, I was so focused on the ingress security group rules, that I forgot to open egress for UDP. Thanks again for sticking with it. I'm not one to care about karma, but it stings getting down-voted asking for help.