diff --git a/.github/workflows/Dockerfile b/.github/workflows/Dockerfile new file mode 100644 index 000000000..f2336b4d3 --- /dev/null +++ b/.github/workflows/Dockerfile @@ -0,0 +1,59 @@ +# Copyright 2023 University of Stuttgart + +# This file is a modified version of the original that can be found here: +# https://github.com/sathwik/docker-buildr + +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM openjdk:8 + +MAINTAINER Sathwik B P + +ENV JRUBY_VERSION 9.1.12.0 +ENV BUILDR_VERSION 1.5.3 +ENV JRUBY_OPENSSL_VERSION 0.9.17 +ENV RSPEC-EXPECTATIONS 2.14.3 +ENV RSPEC-MOCKS 2.14.3 +ENV RSPEC-CORE 2.14.5 +ENV RSPEC 2.14.1 +ENV NOKOGIRI 1.6.8 + +RUN mkdir /opt/jruby \ + && curl http://jruby.org.s3.amazonaws.com/downloads/${JRUBY_VERSION}/jruby-bin-${JRUBY_VERSION}.tar.gz \ + | tar -zxC /opt/jruby --strip-components=1 \ + && update-alternatives --install /usr/local/bin/ruby ruby /opt/jruby/bin/jruby 1 + +ENV PATH /opt/jruby/bin:$PATH + +RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc + +RUN gem install bundler -v 2.3.26 +RUN gem install jruby-openssl -v ${JRUBY_OPENSSL_VERSION} +RUN gem install buildr -v ${BUILDR_VERSION} +RUN gem install rspec-expectations -v ${RSPEC-EXPECTATIONS} +RUN gem install rspec-mocks -v ${RSPEC-MOCKS} +RUN gem install rspec-core -v ${RSPEC-CORE} +RUN gem install rspec -v ${RSPEC} +RUN gem install nokogiri -v ${NOKOGIRI} + +# make /tmp available to all users. +RUN chmod 777 -R /tmp && chmod o+t -R /tmp + +RUN update-alternatives --install /usr/local/bin/buildr buildr /opt/jruby/bin/buildr 1 \ +&& update-alternatives --install /usr/local/bin/jruby jruby /opt/jruby/bin/jruby 1 + +ENV WORKSPACE /workspace +VOLUME /workspace +WORKDIR /workspace + +ENTRYPOINT [ "buildr" ] diff --git a/.github/workflows/docker_image.yml b/.github/workflows/docker_image.yml new file mode 100644 index 000000000..ca677cc2e --- /dev/null +++ b/.github/workflows/docker_image.yml @@ -0,0 +1,56 @@ +name: Push docker images to the GitHub registry + +on: + push: + tags: + - "v*.*.*" + workflow_dispatch: + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build_push: + runs-on: ubuntu-latest + services: + registry: + image: registry:2 + ports: + - 5000:5000 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver-opts: network=host + - name: Build Apache Buildr + uses: docker/build-push-action@v4 + with: + context: .github/workflows + platforms: linux/amd64,linux/arm64 + push: true + tags: localhost:5000/sathwik/apache-buildr:latest-jruby-jdk8 + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Login to GitHub registry + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v4 + with: + context: . + file: Dockerfile-workflow + platforms: linux/amd64,linux/arm64 + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 7fe15087e..55e656b6f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,7 @@ RUN jruby -S bundler install --gemfile=/workspace/Gemfile \ FROM tomcat:8.5-jre8 LABEL maintainer "Johannes Wettinger , Michael Wurster , Michael Hahn " -ARG DOCKERIZE_VERSION=v0.3.0 +ARG DOCKERIZE_VERSION=v0.6.1 ENV TOMCAT_USERNAME admin ENV TOMCAT_PASSWORD admin @@ -39,6 +39,8 @@ ADD server.xml.tpl ${CATALINA_HOME}/conf/server.xml.tpl ADD axis2.xml.tpl ${CATALINA_HOME}/webapps/ode/WEB-INF/conf/axis2.xml.tpl ADD log4j2.xml.tpl ${CATALINA_HOME}/webapps/ode/WEB-INF/classes/log4j2.xml.tpl +RUN mkdir ${CATALINA_HOME}/webapps/manager + EXPOSE 9763 CMD dockerize -template ${CATALINA_HOME}/conf/tomcat-users.xml.tpl:${CATALINA_HOME}/conf/tomcat-users.xml \ diff --git a/Dockerfile-workflow b/Dockerfile-workflow new file mode 100644 index 000000000..3ff99864f --- /dev/null +++ b/Dockerfile-workflow @@ -0,0 +1,66 @@ +FROM localhost:5000/sathwik/apache-buildr:latest-jruby-jdk8 as builder + +ENV JAVA_OPTS="-Xmx1024M -XX:MaxPermSize=512M" +ENV BUILDR_ARGS="-f Rakefile clean package test=no JAVADOC=off" + +RUN apt-get update -qq && apt-get install -qqy \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +COPY . /workspace + +RUN jruby -S bundler install --gemfile=/workspace/Gemfile \ + && buildr $BUILDR_ARGS \ + && mkdir /build \ + && cp /workspace/axis2-war/target/ode-axis2-war-1.3.8-SNAPSHOT.war /build/ode.war \ + && unzip /build/ode.war -d /build/ode + + +FROM tomcat:8.5-jre8 +LABEL maintainer "Johannes Wettinger , Michael Wurster , Michael Hahn " + +ARG DOCKERIZE_VERSION=v0.6.1 + +ENV TOMCAT_USERNAME admin +ENV TOMCAT_PASSWORD admin +ENV ENGINE_PLAN_PORT 9763 +ENV LOG_LEVEL info + +RUN rm /dev/random && ln -s /dev/urandom /dev/random \ + && wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \ + && rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz + +COPY --from=builder /build/ode ${CATALINA_HOME}/webapps/ode + +ADD tomcat-users.xml.tpl ${CATALINA_HOME}/conf/tomcat-users.xml.tpl +ADD manager.xml ${CATALINA_HOME}/conf/Catalina/localhost/manager.xml +ADD server.xml.tpl ${CATALINA_HOME}/conf/server.xml.tpl +ADD axis2.xml.tpl ${CATALINA_HOME}/webapps/ode/WEB-INF/conf/axis2.xml.tpl +ADD log4j2.xml.tpl ${CATALINA_HOME}/webapps/ode/WEB-INF/classes/log4j2.xml.tpl + +RUN mkdir ${CATALINA_HOME}/webapps/manager + +EXPOSE 9763 + +CMD dockerize -template ${CATALINA_HOME}/conf/tomcat-users.xml.tpl:${CATALINA_HOME}/conf/tomcat-users.xml \ + -template ${CATALINA_HOME}/conf/server.xml.tpl:${CATALINA_HOME}/conf/server.xml \ + -template ${CATALINA_HOME}/webapps/ode/WEB-INF/conf/axis2.xml.tpl:${CATALINA_HOME}/webapps/ode/WEB-INF/conf/axis2.xml \ + -template ${CATALINA_HOME}/webapps/ode/WEB-INF/classes/log4j2.xml.tpl:${CATALINA_HOME}/webapps/ode/WEB-INF/classes/log4j2.xml \ + ${CATALINA_HOME}/bin/catalina.sh run + +# +# Manually build by running: +# +# docker build -t opentosca/ode:local . +# +# Run ODE container: +# +# docker run -d -p 9763:9763 --name ode opentosca/ode:local +# +# Set a logging level different than "warn", e.g., for debugging process executions. +# Possible values are: all, trace, debug, info, warn, error, fatal, off. +# Visit Apache Log4j2 website for more details: https://logging.apache.org/log4j/2.x/. +# +# docker run -d -p 9763:9763 -e "LOG_LEVEL=debug" --name ode opentosca/ode:local +# diff --git a/README b/README index 69746cd4e..1cc722deb 100644 --- a/README +++ b/README @@ -1,6 +1,4 @@ -============== - Apache ODE -============== +# Apache ODE Apache ODE is a WS-BPEL compliant web services orchestration engine. It organizes web services calls following a process description @@ -34,3 +32,13 @@ Finally here is a non exhaustive but representative features list: with virtually any communication layer or even embed it. +## Docker +### Build image on M1 Processor + +Clone the repo https://github.com/sathwik/docker-buildr go to the folder `jruby-jdk8` build the image with: + +`docker build -t sathwik/apache-buildr:latest-jruby-jdk8 .` + +Go to the ODE folder and build the image with: + +`docker build -t opentosca/ode:latest .` diff --git a/server.xml.tpl b/server.xml.tpl index 00abc4013..e24195655 100644 --- a/server.xml.tpl +++ b/server.xml.tpl @@ -90,7 +90,7 @@ + maxSwallowSize="-1" secretRequired="false" />