Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label maintenance. Show all posts
Showing posts with label maintenance. Show all posts

2012-06-06

Managing Jenkins job configurations

In JBoss Tools and Developer Studio, we manage a lot of build jobs in Jenkins. In fact, for the 3.2.x/4.x and 3.3.x/5.x streams, there are over 195 jobs. When we start building our next year's first milestone, we'll spawn another 40+ jobs.

Here are some of them:

To assist in performance, we use maven profiles in our parent pom to allow data to be shared outside the slaves' workspaces, without using shared workspaces (as that can lead to conflicts when multiple maven processes try to write to the same .m2 repo). Here's an example:

  <!-- same contents as jbosstools-nightly-staging-composite, but locally 
   available (to improve network lag) -->
  <profile>
   <id>local.composite</id>
   <activation>
    <activeByDefault>false</activeByDefault>
   </activation>
   <repositories>
    <repository>
     <id>local.composite</id>
     <url>${local.composite}</url>
     <layout>p2</layout>
     <snapshots>
      <enabled>true</enabled>
     </snapshots>
     <releases>
      <enabled>true</enabled>
     </releases>
    </repository>
   </repositories>
  </profile>

We also use profiles to turn on code coverage analysis or to take advantage of Jenkins variables like BUILD_NUMBER when setting a timestamped qualifier for features & plugins:

  <profile>
   <id>hudson</id>
   <activation>
    <property>
     <name>BUILD_NUMBER</name>
    </property>
   </activation>
   <properties>
    <local.site>file:///home/hudson/static_build_env/jbds/target-platform_3.3.indigo.SR2/e372M-wtp332M.target/</local.site>
   </properties>
   <build>
    <plugins>
     <plugin>
      <groupId>org.eclipse.tycho</groupId>
      <artifactId>tycho-packaging-plugin</artifactId>
      <version>${tychoVersion}</version>
      <configuration>
       <format>'v'yyyyMMdd-HHmm'-H${BUILD_NUMBER}-${BUILD_ALIAS}'</format>
       <archiveSite>true</archiveSite>
      </configuration>
     </plugin>
    </plugins>
   </build>
  </profile>

But how do you deal with hundreds of jobs' config files, and how do you update them all easily w/o hours of in-browser clicking?

We maintain the job config files (config.xml) offline.

To do this, we use a maven plugin I wrote to fetch jobs matching a given view & regular expression and store them locally on disk using the same structure as on the server.

Then that same plugin can be used to push the config.xml files BACK to the server after making changes to one (or all) the files.

For an extra level of auditing, we also commit these locally cached config.xml files to SVN so we can track their history. Admittedly Jenkins provides this functionality natively, but when you're POSTing changes to config.xml files the server doesn't always notice a change and record the delta, so having a backup (particularly one you can diff offline) is never a bad idea.

2009-02-21

Oops, I'll read it again!

Apparently at some point in the last month or so I set a filter to mark all inbound mail from Eclipse Bugzilla as already read. If I've been completely ignoring your comments in Bugzilla, I do apologize. Please ping me via those bugs - I've fixed the filter, so I'll now see your comment as unread and will respond.

I also discovered yesterday that since January about 80 emails to my Red Hat address had been incorrectly marked as Junk. I am now tracking that box too, just in case more gets incorrectly categorized.

On the plus side, this gives me an opportunity to use a Children of Bodom cover tune, in keeping with Britney Month. :)

Yeah yeah yeah yeah yeah
Yeah yeah yeah yeah yeah yeah



I think I did it again
I made you believe
I just didn't care
Oh baby
It might seem like a slight
But it doesn't mean that I'm serious
'Cause to misfile my email
That is just atypically me
Oh baby, baby

Oops! ...I did it again
I filtered your mail,
Ignored and prescreened
Oh baby, baby
Oops! ...Hundreds of notes a day
Gotta prioritize
With filters and labels

You see my problem is this
I'm reading away
'Bout UK lottos, that do not exist
I cry, four one nine, yeah
"Don't you see I'm a prince, from Nigeria!"
But to miss so much email
That is just atypically me
Baby, oh

Oops! ...I did it again
I filtered your mail,
Got lost in the trash
Oh baby, baby
Oops! ...Bayes thought that you were spam
Not sent here as pure ham
No, not so innocent

Yeah yeah yeah yeah yeah yeah
Yeah yeah yeah yeah yeah yeah

Oops! ...I filed it away from my view
Lost in a gig of email
Oops! ...I've fixed the filter that was screwed
Mistake was innocent

Britney Spears - Oops! ...I Did It Again

2008-10-16

Password management with ccrypt

Intro
Server
Client(s)
About ccrypt

For the past few years, the list of passwords I use for all the various websites, servers, and applications has been growing ever longer. Some people limit themselves to 3-4 passwords, or a handful of formulas for password generation. I used to do that, but it's insecure, and when you control the fate of numerous servers, it's irresponsible. These day, I generally create new passwords at random, and replace them every 3-4 months.

Every flavour of linux has its own system for managing passwords; for example, KDE has KWallet; Gnome has Keyring. Tuesday I started playing with Fedora for the first time in years, and discovered yet another way: System > Preferences > System > Authorizations (polkit-gnome-authorization). And, of course, even Mozilla (Firefox, Thunderbird) handles password management like this... but each application has its own repository, and each one will get out of sync in time.

So, for a password management system that doesn't care about window manager, application, or even OS (this works with under cygwin on Windows, too), I've designed my own method.

How do you remember 100s of passwords which have nothing in common? Store them in a database, encrypted by a passphrase/password, then use a simple query engine to retrieve them.

Here's how it works, and how you can set up something similar.

Home Server / CVS Server

First, define these 3 scripts.

  1. /home/user/passwds/PWget.sh
  2. #!/bin/bash
    dir=/home/user/passwds;
    mkdir -p $dir;
    echo -n "Retrieve latest? [y/N] "; read yn;
    if [[ $yn == "y" ]]; then
     scp user@home-server:$dir/passwds.cpt $dir
    fi
  3. /home/user/passwds/PWsearch.sh
  4. #!/bin/bash
    file="/home/user/passwds/passwds.cpt";
    ccrypt -c $file | grep -i "$1";
  5. /home/user/passwds/PWedit.sh
  6. #!/bin/bash
    file="/home/user/passwds/passwds";
    ccrypt -d $file.cpt; vi $file; ccrypt -e $file

Next, define 2 aliases -- one for password lookup, and one to modify the encrypted password file. I use ~/.alias, which I load as part of my ~/.bashrc file.

  1. /home/user/.alias
  2. alias PW='/home/user/passwds/PWsearch.sh $1'
    alias PWE='~/PWDs/PWedit.sh'

Now, on the home server, I can run `PW eclipse` to decrypt the file, look up any lines in the password file with "eclipse" in them, and return those entries to me. Or, I can run `PW | more` by itself to display the entire file (paged with `more`). To modify the file, I use `PWE` to decrypt, edit, and re-encrypt the file. I also periodically save this file into my CVS repository (cvs add -kb passwds.cpt; cvs ci -m "" passwds.cpt) so I can track changes.

Remote Client(s) / Other Servers

Well, you think, that's great for a single system, but I need my passwords on 3 or 4 different systems. Plus, my home server may or may not always be accessible (eg., only when I'm on my home network).

So, once again, we start with the same three bash scripts.

Next, define a different version of the `PW` alias:

  1. /home/user/.alias
  2. alias PW='/home/user/passwds/PWget.sh;/home/user/passwds/PWsearch.sh $1'

Now, on any other server which can reach the home server over ssh, `PW eclipse` can be used to (optionally) retrieve the latest version of the password file, then search it as in the example above. Can't reach the home server? That's fine, we keep a local cache of the encrypted password file -- good enough until the next synch.

Voila! Centralized encrypted password management for Windows & Linux clients!

About ccrypt

So, what handles the encryption, and how secure is it?

ccrypt is based on the Rijndael block cipher, which was also chosen by the U.S. government as the Advanced Encryption Standard (AES, see http://www.nist.gov/aes/). This cipher is believed to provide very strong cryptographic security.

 

If your linux or cygwin distro doesn't include ccrypt in its repositories, here are a couple places you can find it:

2008-06-17

Toward Standardized Groups

June 5 marked the death knell for my conquest for world domination through Eclipse committer groups.

Before then, I was in a whopping 62 different linux groups on dev.eclipse.org, coming in third behind Kim and Sonia (80 and 79, respectively).

However, with Karl and Matt actively cleaning up these duplicate and often empty groups & standardizing the names, my numbers have dwindled to a mere 55. Sadly, I'll lose 4 more when we standardize GEF...

Still, consistency is better than world domination, right?

If your project needs some housecleaning, Karl's looking for volunteers to work with him on this effort. If you are interested, I'd recommend starting with a shared spreadsheet (eg., [1], [2]) to document your before and after states.

2007-10-08

EMF: September Release Roundup

A quick list of some recent EMF releases:

  • EMF 2.4.0M2 (Eclipse 3.4.0M2 / Ganymede)
  • EMF 2.3.1 (Eclipse 3.3.1 / Europa)
  • EMF 2.2.4 (Eclipse 3.2.2 / Callisto)
  • EMF 2.1.3 (Eclipse 3.1.2)
  • EMF 2.0.6 (Eclipse 3.0.2)

Also, here's a few EMF-related releases out last month:

Did I miss anything? Let me know!

2007-09-28

EuroFM is on the air!

Europa Fall Maintenance is out today, so in tribute...

(Ctrl-) Space Down

Hey Eclipse you know you drive me crazy.
Ctrl-3 puts the rhythm in my hand.
Still I'll never understand how you can do so much
Plugins, features and such
Install Europa bundles from a mirror
Tell yourself it's so gonna rock your world again
You fire it up and then you swear a little

Do you feel like a geek
When you push its buttons?
Do you feel better now Ctrl-Space'ing a ton?
Well I'll tell you my friend no way this world's going to end
IDEs crumble down, they're eclipsed by this one

A pebble in the water makes a ripple effect
Every action in this world will bear a consequence
If you code by hand forever you will surely drown
I see what's goin' down.
Don't be a fool and use vi, emacs or notepad,
Startin' from scratch again,
Heed my lecture

Do you feel like a geek
When you push its buttons?
Do you feel better now Ctrl-Space'ing a ton?
Well I'll tell you my friend no way this world's going to end
IDEs crumble down, they're eclipsed by this one

In June '08 when we've all had enough,
Time for the Gany train!
[x2]

Do you feel like a geek
When you push its buttons?
Do you feel better now Ctrl-Space'ing a ton?
Well I'll tell you my friend no way this world's going to end
IDEs crumble down, they're eclipsed by this one

Downloadin' the code, she said, 'The mother lode!'
She said, I've finally found the best!
[x2]

Red Jumpsuit Aparatus - Face Down

10,000 Hits

Europa!
Europa!

One more download, yay! I know what I want
And my want will be an upgrade all right, an upgrade all right
Just another day when all that I want
Will mark me as an Eclipser tonight, an Eclipse geek tonight, yeah

[Chorus]
Jupiter's moons that can block out the Sun
If this disturbs you then walk away
You will remember: use -vmargs and -vm
10,000 Googlin' away!

Plug-ins un-restrained, dead on the mark
Is what we will deliver tonight, deliver tonight
"Features suck," they say, "but Update finally works!"
With even plugins tonight? Yes, even plugins tonight. Yeah!

[Chorus]

We are the ones that will open your mind
Leave the weak and the NetBeans behind
[x4]

[Chorus]

10,000 Googlin' away! 10,000 reqs per half-day!

Disturbed - Ten Thousand Fists