setup for HOL-4957 – Automating Your CI/CD Stack with Java and Groovy

Main menu:

Topics

Recent Posts

Feeds

RSS Feed RSS - Posts

September 2018
M T W T F S S
« Aug    
 12
3456789
10111213141516
17181920212223
24252627282930

Past Posts

Java/Java EE

JDBC

Other

setup for HOL-4957 – Automating Your CI/CD Stack with Java and Groovy

September 2nd, 2018 by Jeanne Boyarsky

Scott and I’ll be leading a hands on lab “Automating your Ci/CD Stack with Java and Groovy” at Oracle Code One. This is a BYOL (bring your own laptop) lab.

If you run into any trouble setting up for the lab, you can post a comment on this blog post or start a thread in the Cloud/Virtualization forum at CodeRanch.

This lab requires the following:

  1. Docker
  2. Docker images
  3. Groovy
  4. The ability to run curl
  5. JDK 8 or higher

Docker

To install Docker, follow the instructions at: https://docs.docker.com/install/

Validation:

At the command line, run docker –version. (Small version differences are ok in the output)

$ docker --version

Docker version 18.06.0-ce, build 0ffa825

Docker images

These images a little under 2GB combined. So as not to tax the conference network, please pull them in advance. This will also let you deal with any corporate internet proxies while you are still at work and can ask for help.

At the command line run:

docker pull sonatype/nexus3:3.13.0

docker pull jenkins/jenkins:2.140

docker pull sonarqube:7.1

 Note: “latest” will probably work. These version numbers are the ones we tested with.

$ docker pull sonatype/nexus3:3.13.0
3.13.0: Pulling from sonatype/nexus3
256b176beaff: Pull complete
18d124afa1e9: Pull complete
9bb412307f82: Pull complete
Digest: sha256:19d186d5bc8be1ea4f7bae72756baa830e79bf20aae0e9e7b1a0c7d3ce7ac136
Status: Downloaded newer image for sonatype/nexus3:3.13.0

$ docker pull jenkins/jenkins:2.140
2.140: Pulling from jenkins/jenkins
55cbf04beb70: Pull complete
1607093a898c: Pull complete
9a8ea045c926: Pull complete
d4eee24d4dac: Pull complete
c58988e753d7: Pull complete
794a04897db9: Pull complete
70fcfa476f73: Pull complete
806029475e0c: Pull complete
67959b355155: Pull complete
4d217ccd3d4c: Pull complete
0261bb88a4a5: Pull complete
96f2a3ae5539: Pull complete
f6bf99db32d5: Pull complete
bb47d4bbb0e1: Pull complete
4b48ec5d60cf: Pull complete
7280a8dfb767: Pull complete
91091f8d44ca: Pull complete
8ca02cad320f: Pull complete
46009bfec329: Pull complete
f9860b79812e: Pull complete
89ac8103ea67: Pull complete
Digest: sha256:161cb25fbb23a1c5ac5fdd0feebd713edd62c235e199e68b34d1a78205a42da7
Status: Downloaded newer image for jenkins/jenkins:2.140
JeanneBrskysMBP:OracleCodeOne2018-HOL-Automating-Stack-Groovy nyjeanne$ docker pull sonarqube:7.1
7.1: Pulling from library/sonarqube
55cbf04beb70: Already exists 
1607093a898c: Already exists 
9a8ea045c926: Already exists 
d4eee24d4dac: Already exists 
c58988e753d7: Already exists 
794a04897db9: Already exists 
70fcfa476f73: Already exists 
806029475e0c: Already exists 
67959b355155: Already exists 
1e6b3af7f55a: Pull complete 
e0b67c57c8e1: Pull complete 
ce12e009fbe7: Pull complete 
3edf8e47f9c4: Pull complete 
Digest: sha256:4438a37735caa24d80da31ee29e72d686abdaa8f5009746ec60e0d43519e1a57
Status: Downloaded newer image for sonarqube:7.1

Groovy

Follow the instructions at: http://groovy-lang.org/install.html

Note: Please download Groovy 2.X rather than 3.X. Version 3.X is in alpha at the time of writing this lab.

Validation:

At the command line, run groovy –version.(Small version differences are ok in the output)

$ groovy -version

Groovy Version: 2.5.2 JVM: 1.8.0_45 Vendor: Oracle Corporation OS: Mac OS X

Disk space

This lab uses about 1.5 GB of disk space (not counting Docker itself.) The last step of the lab explains how to recover disk space.

The ability to run curl

If you are running Mac, Linux or Windows 10, you don’t need to do anything. If you are running an older version of Windows, you can install Cygwin.

JDK 8 or higher

Come on. You must have this by now!

Validation

At the command line, run curl https://www.oracle.com/code-one/index.html and ensure the output isn’t an error message.

 

cleaning up docker

August 26th, 2018 by Jeanne Boyarsky

It’s been a while since I used Docker on my machine so I decided to clean things up. When I launched Docker, it prompted me to upgrade. Half a gig but easy to get that out of the way at least.

Then I ran “docker images” and was reminded that I haven’t done a good job of keeping this clean. I had:

  • the original docker-whale play
  • a bunch of experiments from when I didn’t know what I was doing (some of which have unnamed layers so I don’t even know what they are)
  • some Java 9 early access edition stuff
  • following along with the “Kubernetes in Action” book when I was the Technical Development Editor
  • a lab I went to

Note: i’m not sure if any of this is a good way of doing things. But it worked for me.

Deleting the images the slow way

Yuck. I decided to delete all the images. For some, it was easy. Just run “docker rmi <imageHash>”.

For some, I got

Error response from daemon: conflict: unable to delete xxx (cannot be forced) - image has dependent child images

I also tried running “docker rmi $(docker images -a -q)” to delete all the images. This deleted some, but gave the same dependent child images error.

Great, I don’t know what they are.  Luckily, StackOverflow had a command to find the children.

for i in $(docker images -q)
do
    docker history $i | grep -q xxx && echo $i
done | sort -u

I also got:

Error response from daemon: conflict: unable to delete xxx (must be forced) - image is referenced in multiple repositories

For these, it was just a matter of running “docker -rmi –force xxx.”

Deleting the images the fast way

I deleted the rest of the images with:

“docker rmi –force $(docker images -a -q)”

Containers and volumes

I did a far better job of cleaning these up!

docker ps -a

docker volume ls

two factor and google voice

August 25th, 2018 by Jeanne Boyarsky

I’ve been using two factor authentication for a number of years.  I like when services offer a choice of two factor options. Or the common Google Authenticator app. Less of a fan of SMS required two factor. If I lose my phone or number, I can’t two factor authenticate to a few services. The most recent being Venmo. Ironically, Venmo wouldn’t let me change.

One of my friends has used Google Voice for phone for years. I decided to switch to a Google Voice number. This gives me a few advantages:

  • phone rings on multiple devices
  • texts get turned into email which means I can view them on multiple devices (nice for two factor)
  • I’m decoupled from my cell phone number for two factor

Today I’m switching over a bunch of services to use a different phone number for two factor. This table shows the services I can think of where I use two factor.

Interestingly, having possession of the original phone number was not necessary for any of the services. So I could have done this even if I had lost my phone. I had enough other options set up for two factor. Also ironically, I couldn’t switch Venmo which motivated all this. I can close the account though so if this ever becomes a problem…

Service Two Factor Options How Switching Went
Google

(original blog post)

Authenticator, SMS, phone, codes, key, Google prompt Google knew my number in my profile, but I still had to verify to set in profile. And again when wetting as my two factor option. Emailed that changed number.
Amazon

(original blog post)

Authenticator, phone, SMS Under my account added a mobile number. Confirmed with SMS text verification.
Twitter

(original blog post)

Authenticator, SMS, security key, backup code Went to mobile and clicked edit to change number. I didn’t enable SMS, but now it has the right number in case I need it as a one off. Confirmed with SMS text verification.
Facebook Authenticator, SMS, codes, key Went to security and use two factor. Added Google voice and backup. Emailed that added number.

(Only allowed SMS last I looked. Good improvement).

Venmo Just SMS Won’t accept my Google voice number and gave an error that it needs a mobile number. 
GitHub (original blog post) Choice of authenticator, SMS, security keys, recovery tokens (other site), and recovery codes (strings) Clear existing number. Set new Google voice number. Enter code texted to new number. GitHub also emailed me that I added and removed a SMS number.
PayPal

(original blog post)

SMS, phone Confirming my landline number, it had me type a code when they called instead of supplying a code read to me. This seems more secure. Good! The new number was added as unconfirmed. I clicked confirm to get a text to confirm it.
LinkedIn

(original blog post)

SMS I couldn’t find the two factor page without a direct link. I scrolled up and added a phone number. After confirming the verification code, it automatically made the new phone number primary. I couldn’t delete the original since it is used for two factor. So I went to the two factor section and changed the number. it sent me a code again. Then I finally went back and deleted the original number. And for every one of those operations, I had to enter my linked in password. This felt excessive.
DropBox

(original blog post)

Authenticator, SMS, codes, physical device Went to settings and changed my number. I had to enter my authenticator code but not verify possession of the phone number. Emailed that changed two factor settings.
Yahoo

(original blog post)

Email, phone, text Went to account to try to change number. Got an error that it can’t accept a VOIP number. I was able to change it my land line. I use Yahoo almost never so it doesn’t matter whether this is convenient. Emailed that removed and added number.
Slack Authenticator Added my phone number. No verification required.
Apple

(original blog post)

Various Added a trusted phone number and confirmed code. Verified with my computer as well as the code. Removed original number. Emailed that number changed