Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-62927

Add a Docker image for Jupyter notebooks

    XMLWordPrintable

Details

    Description

      It might be useful to have a base agent Docker image which would include components required for using the plugin: https://github.com/jenkinsci/machine-learning-plugin#using-with-python

      Such base image could simplify setup of the plugin in the CI environment. It would also simplify creating of demos for the plugin.

       

      Attachments

        Activity

          Hi oleg_nenashev,

          I have built and run this docker file using this

           

          docker build -t jenkins-ml-plugin-tutorial .
          
          docker run -it -p 8090:8090 -p 50000:50000 jenkins-ml-plugin-tutorial
          

          Docker file

           

          FROM jenkins/agent
          # if we want to install via apt
          USER root
          RUN apt-get update
          RUN apt-get install python -y
          RUN apt-get purge python-pip
          RUN apt-get install python-pip -y
          RUN DEBIAN_FRONTEND=noninteractive \
              apt-get -y install default-jre-headless && \
              apt-get clean && \
              rm -rf /var/lib/apt/lists/*# Fix certificate issues
          RUN apt-get install ca-certificates-java && \
              apt-get clean && \
              update-ca-certificates -f;RUN export JAVA_HOME
          RUN pip install ipython
          RUN pip install ipykernel
          RUN pip install jupyter-client
          RUN pip install protobuf
          RUN pip install grpcio# Setup JAVA_HOME -- useful for docker commandline
          ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/
          
          

          I created an agent from master which is in my local machine host.

           

          While I ran this

           

          java -jar agent.jar -jnlpUrl http://localhost:8080/jenkins/computer/Agent/slave-agent.jnlp -workDir "/home/loghi/Kajan"
          

           

          Following error has popped

           

          Failed to obtain http://localhost:8080/jenkins/computer/Agent/slave-agent.jnlp
          java.net.ConnectException: Connection refused (Connection refused)
          

          Do I need run any extra things to get connected?

           

           

           

           

          loghijiaha Loghi Perinpanayagam added a comment - Hi oleg_nenashev , I have built and run this docker file using this   docker build -t jenkins-ml-plugin-tutorial . docker run -it -p 8090:8090 -p 50000:50000 jenkins-ml-plugin-tutorial Docker file   FROM jenkins/agent # if we want to install via apt USER root RUN apt-get update RUN apt-get install python -y RUN apt-get purge python-pip RUN apt-get install python-pip -y RUN DEBIAN_FRONTEND=noninteractive \ apt-get -y install default -jre-headless && \ apt-get clean && \ rm -rf / var /lib/apt/lists/*# Fix certificate issues RUN apt-get install ca-certificates-java && \ apt-get clean && \ update-ca-certificates -f;RUN export JAVA_HOME RUN pip install ipython RUN pip install ipykernel RUN pip install jupyter-client RUN pip install protobuf RUN pip install grpcio# Setup JAVA_HOME -- useful for docker commandline ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64/ I created an agent from master which is in my local machine host.   While I ran this   java -jar agent.jar -jnlpUrl http: //localhost:8080/jenkins/computer/Agent/slave-agent.jnlp -workDir "/home/loghi/Kajan"   Following error has popped   Failed to obtain http: //localhost:8080/jenkins/computer/Agent/slave-agent.jnlp java.net.ConnectException: Connection refused (Connection refused) Do I need run any extra things to get connected?        

          People

            loghijiaha Loghi Perinpanayagam
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: