Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slave node uses systemd #2

Merged
merged 12 commits into from
Apr 12, 2016
Merged

slave node uses systemd #2

merged 12 commits into from
Apr 12, 2016

Conversation

atarkowska
Copy link
Member

This PR improves slave node using systemd

To test it:

  • deploy jenkins (use https://github.com/aleksandra-tarkowska/omero-ssh-systemd-jenkins-slave)

  • attache to jenkins container to find out env | grep JENKINS_PORT_8080_TCP

  • build using make build

  • start container:

    UNIX: make start ENV="-e JENKINS_PORT_8080_TCP_ADDR=172.17.0.2 -e JENKINS_PORT_8080_TCP_PORT=8080" VOLUME="-v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /run"
    
    OSX: make start PORTS="--privileged" ENV="-e JENKINS_PORT_8080_TCP_ADDR=172.17.0.2 -e JENKINS_PORT_8080_TCP_PORT=8080"
    
  • jenkins logs will show:

    jenkins_1 | INFO: Accepted connection #2 from /172.17.0.4:43378
    
  • attache to devslave:

    $ docker exec -it devslave bash -c "service jenkins status"
    service jenkins status                                                                                    Redirecting to /bin/systemctl status  jenkins.service    
    ● jenkins.service - Jenkins slave
    Loaded: loaded (/etc/systemd/system/jenkins.service; enabled; vendor preset: disabled)
    Active: active (running) since Thu 2016-04-07 21:14:02 UTC; 14min ago
     Docs: https://developer.cloudbees.com/bin/view/DEV/On-Premise+Executors
    Main PID: 223 (java)
     CGroup: /system.slice/jenkins.service
             └─223 java -jar /tmp/swarm-client-2.0-jar-with-dependencies.jar -fsroot /home/omero -master http://172.17.0.2:8080 -lab...
    
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: Apr 07, 2016 9:14:02 PM hudson.remoting.jnlp.Main$CuiListener <init>
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: INFO: Jenkins agent is running in headless mode.
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: Apr 07, 2016 9:14:02 PM hudson.remoting.jnlp.Main$CuiListener status
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: INFO: Locating server among [http://172.17.0.2:8080/]
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: Apr 07, 2016 9:14:02 PM hudson.remoting.jnlp.Main$CuiListener status
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: INFO: Connecting to 172.17.0.2:50000
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: Apr 07, 2016 9:14:02 PM hudson.remoting.jnlp.Main$CuiListener status
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: INFO: Handshaking
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: Apr 07, 2016 9:14:02 PM hudson.remoting.jnlp.Main$CuiListener status
    Apr 07 21:14:02 cca03c032f77 jenkins-slave.sh[223]: INFO: Connected
    
  • check jenkins http://jenkins:8080/computer/ if new node is up

cc: @joshmoore

@joshmoore
Copy link
Member

My concern here, @aleksandra-tarkowska, is that this strategy makes it difficult to deploy to hub. If we can have only the changes here for devslave, then we can have a separate devjenkins (devmaster?) repo, and each of those can produce an image on hub which you can re-use in docker-compose.

@atarkowska
Copy link
Member Author

np, I have just rebased with slave only.

@atarkowska atarkowska closed this Apr 7, 2016
@atarkowska atarkowska reopened this Apr 7, 2016
@@ -0,0 +1,27 @@
NS = openmicroscopy
VERSION ?= latest
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to local

@atarkowska atarkowska closed this Apr 8, 2016
@atarkowska atarkowska reopened this Apr 8, 2016
@joshmoore joshmoore mentioned this pull request Apr 8, 2016
2 tasks
@atarkowska atarkowska force-pushed the slave_systemd branch 4 times, most recently from d28afd1 to eede6cf Compare April 9, 2016 23:31
- make start ENV="-e JENKINS_PORT_8080_TCP_ADDR=$JENKINS_ADDR -e JENKINS_PORT_8080_TCP_PORT=$JENKINS_PORT" VOLUMES="-v /sys/fs/cgroup:/sys/fs/cgroup:ro -v /run"
- docker inspect -f {{.State.Running}} devslave
- SLAVE_ADDR=`docker inspect --format '{{ .NetworkSettings.IPAddress }}' devslave`
- d=10; while ! docker logs jenkins 2>&1 | grep "from /${SLAVE_ADDR}" ; do sleep 10; d=$[$d -1]; if [ $d -lt 0 ]; then exit 1; fi; done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@joshmoore
Copy link
Member

Nice. Merging. To be "integration tested" in the devspace along with @aleksandra-tarkowska's upcoming redis PR. This should significantly speed up the build.

@joshmoore joshmoore merged commit a0bd30a into ome:master Apr 12, 2016
@atarkowska atarkowska deleted the slave_systemd branch April 12, 2016 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants