-
Notifications
You must be signed in to change notification settings - Fork 20
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
Web build #19
Web build #19
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.*un~ | ||
home/.* | ||
home/*.log | ||
home/cache/ | ||
home/fingerprints/ | ||
home/identity.key.enc | ||
home/init.groovy.d/ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<hudson.tasks.Shell_-DescriptorImpl/> | ||
<hudson.tasks.Shell_-DescriptorImpl> | ||
<shell>/bin/bash</shell> | ||
</hudson.tasks.Shell_-DescriptorImpl> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<project> | ||
<actions/> | ||
<description></description> | ||
<keepDependencies>false</keepDependencies> | ||
<properties> | ||
<jenkins.plugins.slack.SlackNotifier_-SlackJobProperty plugin="slack@1.8.1"> | ||
<teamDomain></teamDomain> | ||
<token></token> | ||
<room></room> | ||
<startNotification>true</startNotification> | ||
<notifySuccess>true</notifySuccess> | ||
<notifyAborted>true</notifyAborted> | ||
<notifyNotBuilt>true</notifyNotBuilt> | ||
<notifyUnstable>true</notifyUnstable> | ||
<notifyFailure>true</notifyFailure> | ||
<notifyBackToNormal>true</notifyBackToNormal> | ||
<notifyRepeatedFailure>false</notifyRepeatedFailure> | ||
<includeTestSummary>false</includeTestSummary> | ||
<showCommitList>false</showCommitList> | ||
<includeCustomMessage>false</includeCustomMessage> | ||
<customMessage></customMessage> | ||
</jenkins.plugins.slack.SlackNotifier_-SlackJobProperty> | ||
</properties> | ||
<scm class="hudson.scm.NullSCM"/> | ||
<assignedNode>web</assignedNode> | ||
<canRoam>false</canRoam> | ||
<disabled>false</disabled> | ||
<blockBuildWhenDownstreamBuilding>false</blockBuildWhenDownstreamBuilding> | ||
<blockBuildWhenUpstreamBuilding>false</blockBuildWhenUpstreamBuilding> | ||
<triggers/> | ||
<concurrentBuild>false</concurrentBuild> | ||
<builders> | ||
<hudson.tasks.Shell> | ||
<command>OMERO_DIST=$HOME/OMERO.server | ||
if [ -e $OMERO_DIST ]; then | ||
|
||
if [ -e $WORKSPACE/omeropy-virtualenv ]; then | ||
source $WORKSPACE/omeropy-virtualenv/bin/activate | ||
eval $(bash /opt/multi-config.sh ice3.5) | ||
$OMERO_DIST/bin/omero web stop | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is one thing that is still not clear to me how that meant to work. I thought web docker container is created every time jenkins job is run, that would result in job just passing appropriate OMERO.py artifact to the docker build. This will reduce maintenance of scripts There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not yet. At the moment, the docker-compose creates a single web container which is re-used for multiple runs. We'll need to look into new jenkins plugins in order to enable the "spin up a fresh container each time" workflow. Definitely for it, but I think we should make the migration to omero-install atomically and then look at the bigger step to a many-container system. |
||
sleep 5 | ||
$OMERO_DIST/bin/omero web status | ||
deactivate | ||
rm -rf $WORKSPACE/omeropy-virtualenv | ||
fi | ||
rm -rf $OMERO_DIST | ||
fi | ||
|
||
</command> | ||
</hudson.tasks.Shell> | ||
<hudson.plugins.copyartifact.CopyArtifact plugin="copyartifact@1.37"> | ||
<project>OMERO-build</project> | ||
<filter>src/target/OMERO.py*zip</filter> | ||
<target></target> | ||
<excludes></excludes> | ||
<selector class="hudson.plugins.copyartifact.StatusBuildSelector"/> | ||
<flatten>true</flatten> | ||
<doNotFingerprintArtifacts>false</doNotFingerprintArtifacts> | ||
</hudson.plugins.copyartifact.CopyArtifact> | ||
<hudson.tasks.Shell> | ||
<command>OMERO_DIST=$HOME/OMERO.server | ||
OMERO_INSTALL=/tmp/omero-install/linux | ||
|
||
ZIP=$(ls OMERO.py*.zip) | ||
DIST=${ZIP%.zip} | ||
unzip $ZIP | ||
rm -f $ZIP | ||
mv $WORKSPACE/$DIST $OMERO_DIST | ||
|
||
virtualenv $WORKSPACE/omeropy-virtualenv --system-site-packages | ||
source $WORKSPACE/omeropy-virtualenv/bin/activate | ||
|
||
cd $OMERO_INSTALL | ||
source settings.env | ||
|
||
# From step04 | ||
$OMERO_DIST/bin/omero web config nginx --http "$OMERO_WEB_PORT" > $OMERO_DIST/nginx.conf.tmp | ||
|
||
sudo -u root bash step05_centos7_nginx.sh | ||
sudo -u root bash step06_centos7_daemon.sh | ||
|
||
eval $(bash /opt/multi-config.sh ice3.5) | ||
BUILD_ID=DONT_KILL_ME $OMERO_DIST/bin/omero web start | ||
|
||
$OMERO_DIST/bin/omero admin diagnostics</command> | ||
</hudson.tasks.Shell> | ||
</builders> | ||
<publishers/> | ||
<buildWrappers/> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl plugin="git-client@1.19.0"> | ||
<installations class="hudson.plugins.git.GitTool-array"/> | ||
</org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl> | ||
</org.jenkinsci.plugins.gitclient.JGitTool_-DescriptorImpl> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ubuntu:12.04 | ||
|
||
MAINTAINER OME | ||
|
||
ENV JENKINS_SWARM_VERSION 1.24 | ||
ENV LANG en_US.UTF-8 | ||
|
||
RUN adduser -u 11521 slave | ||
RUN apt-get update && apt-get install -y curl | ||
|
||
USER slave | ||
WORKDIR /tmp | ||
RUN curl --create-dirs -sSLo /tmp/swarm-client-$JENKINS_SWARM_VERSION-jar-with-dependencies.jar http://maven.jenkins-ci.org/content/repositories/releases/org/jenkins-ci/plugins/swarm-client/$JENKINS_SWARM_VERSION/swarm-client-$JENKINS_SWARM_VERSION-jar-with-dependencies.jar | ||
|
||
COPY jenkins-slave.sh /tmp/jenkins-slave.sh | ||
ENTRYPOINT ["/tmp/jenkins-slave.sh"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# https://raw.githubusercontent.com/carlossg/jenkins-swarm-slave-docker/master/jenkins-slave.sh | ||
|
||
# if `docker run` first argument start with `-` the user is passing jenkins swarm launcher arguments | ||
if [[ $# -lt 1 ]] || [[ "$1" == "-"* ]]; then | ||
|
||
# jenkins swarm slave | ||
JAR=`ls -1 /tmp/swarm-client-*.jar | tail -n 1` | ||
|
||
# if -master is not provided and using --link jenkins:jenkins | ||
if [[ "$@" != *"-master "* ]] && [ ! -z "$JENKINS_PORT_8080_TCP_ADDR" ]; then | ||
PARAMS="-master http://$JENKINS_PORT_8080_TCP_ADDR:$JENKINS_PORT_8080_TCP_PORT" | ||
fi | ||
|
||
echo Running java $JAVA_OPTS -jar $JAR -fsroot $HOME $PARAMS "$@" | ||
exec java $JAVA_OPTS -jar $JAR -fsroot $HOME $PARAMS "$@" | ||
fi | ||
|
||
# As argument is not jenkins, assume user want to run his own process, for sample a `bash` shell to explore this image | ||
exec "$@" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM openmicroscopy/devslave-c7:latest | ||
MAINTAINER ome-devel@lists.openmicroscopy.org.uk | ||
|
||
USER root | ||
|
||
# Likely remove | ||
#RUN sed -i.bak -re 's/( default_server.*)/; #\1/' /etc/nginx/nginx.conf | ||
#ADD ./omeroweb.sh /home/omero/omeroweb.sh | ||
#RUN chown omero:omero /home/omero/omeroweb.sh | ||
#RUN chmod +x /home/omero/omeroweb.sh | ||
#RUN chmod a+X /home/omero | ||
|
||
EXPOSE 80 | ||
|
||
# Configuration for a general slave | ||
# Note: a JDK MUST be installed above. | ||
RUN usermod -u 11521 omero | ||
|
||
# Ola new commit | ||
ADD ./omeroweb.service /etc/systemd/system/omeroweb.service | ||
RUN ln -s /etc/systemd/system/omeroweb.service /etc/systemd/system/multi-user.target.wants/omeroweb.service | ||
|
||
# AS OMERO user | ||
USER omero | ||
ENV HOME /home/omero | ||
WORKDIR /home/omero |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[Unit] | ||
Description=OMERO.web | ||
Requires=nginx.service | ||
|
||
[Service] | ||
User=omero | ||
Type=forking | ||
PIDFile=/home/omero/OMERO.py/var/django.pid | ||
Restart=on-failure | ||
RestartSec=10 | ||
Environment="VENVDIR=/home/omero/omeropy-virtualenv" "BINDIR=/home/omero/OMERO.py/bin" | ||
ExecStart=/usr/bin/bash -c "source $VENVDIR/bin/activate; $BINDIR/omero web start" | ||
ExecStop=/usr/bin/bash -c "source $VENVDIR/bin/activate; $BINDIR/omero web stop" | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need newer swarm plugin jenkinsci/swarm-plugin#33, otherwise this is never going to work because of jenkinsci/swarm-plugin#26
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was using the label here to tie jobs to the correct location rather than the name. But as long as the newer plugin works with the rest of the stack, 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newer plugin is needed to
disableClientsUniqueId
otherwise jenkins adds unique id to the name