Building Marathon - linux-on-ibm-z/docs GitHub Wiki

Building Marathon

The instructions provided below specify the steps to build Marathon version 1.8.222 on Linux on IBM Z for the following distributions:

  • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
  • SLES (12 SP5, 15 SP2)
  • Ubuntu (18.04, 20.04)

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Step 1: Install Apache Mesos

Apache Mesos is a pre-requisite for using Marathon.

If you want to build and install Apache Mesos using manual steps, please refer to the build instructions here. Otherwise, use the following commands to use the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/ApacheMesos/1.11.0/build_mesos.sh

# Build mesos
bash build_mesos.sh   [Provide `-j openjdk` option for executing build using OpenJDK]
  • Note: The script installs mesos in the /usr/share/ directory. Marathon is verified using Mesos v1.11.0 at the time of creation of these build instructions.

Step 2: Build using script

If you want to build Marathon using manual steps, go to STEP 3.

Use the following commands to build Marathon using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/Marathon/1.8.222/build_marathon.sh

# Build marathon
bash build_marathon.sh   [Provide -o option for executing build using OpenJDK]

If the build completes successfully, go to STEP 4. In case of error, check logs for more details or go to STEP 3 to follow manual build steps.

Step 3: Build Marathon

Marathon can be built from source or can be installed using pre-built package

  export SOURCE_ROOT=/<source_root>/

3.1) Build from source

  • Install dependencies

    • RHEL (7.8, 7.9)

      • With IBM-SDK
       sudo yum install git tar wget java-1.8.0-ibm-devel patch which
      • With OpenJDK
       sudo yum install git tar wget java-1.8.0-openjdk-devel patch which
    • RHEL (8.1, 8.2, 8.3)

      • With OpenJDK
       sudo yum install git tar wget java-1.8.0-openjdk-devel patch which
    • SLES (12 SP5, 15 SP2)

      • With IBM-SDK
       sudo zypper install git wget tar java-1_8_0-ibm-devel patch which
      • With OpenJDK
       sudo zypper install git wget tar java-1_8_0-openjdk-devel patch which
    • Ubuntu (18.04, 20.04)

      • With IBM-SDK
       sudo apt-get install git tar wget patch

      To install IBM Java 8, download IBM Java 8 SDK binary from IBM Java 8 and follow the instructions as per given in the link.

      • With OpenJDK
       sudo apt-get install git tar wget openjdk-8-jdk patch
  • Set environment variables

export JAVA_HOME=<path to java>
export JAVA_TOOL_OPTIONS='-Xmx2048M'
export PATH=$JAVA_HOME/bin:$PATH
  • Install sbt
cd $SOURCE_ROOT
wget https://github.com/sbt/sbt/releases/download/v1.2.7/sbt-1.2.7.tgz
tar -zxvf sbt-1.2.7.tgz
export PATH=$PWD/sbt/bin:$PATH
  • Download source code and build
cd $SOURCE_ROOT
git clone https://github.com/mesosphere/marathon.git
cd marathon
git checkout v1.8.222
sbt stage

Launcher script and libs will be available at $SOURCE_ROOT/marathon/target/universal/stage. NOTE: If build fails with error Cannot allocate memory or Failed to allocate default memory space set the below sbt parameter and build again.

export SBT_OPTS="-Xmx2g"
  • Package Marathon into a tarball (optional)
sbt universal:packageZipTarball

The packaged Marathon tarball will be available at $SOURCE_ROOT/marathon/target/universal/marathon-1.8.222.tgz.

3.2) Install from pre-built package

  • Install dependencies.

    • RHEL (7.8, 7.9, 8.1, 8.2, 8.3)
     sudo yum install tar wget
    • SLES (12 SP5, 15 SP2)
     sudo zypper install wget tar
    • Ubuntu (18.04, 20.04)
     sudo apt-get install tar wget
  • Get pre-built package

cd $SOURCE_ROOT
wget https://downloads.mesosphere.io/marathon/builds/1.8.222-86475ddac/marathon-1.8.222-86475ddac.tgz
mkdir marathon/
tar xzf marathon-1.8.222-86475ddac.tgz -C marathon/ --strip-components=1
rm marathon-1.8.222-86475ddac.tgz

Step 4: Start Marathon

4.1) Start the Zookeeper service

cd /<path to mesos>/build/3rdparty/zookeeper-3.4.8   # /usr/share/mesos/ in case of using script
cp conf/zoo_sample.cfg conf/zoo.cfg
sudo env PATH=$PATH ./bin/zkServer.sh start

4.2) Start Apache Mesos

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
mesos-local --ip=<ip_address>

4.3) Start Marathon master

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib
cd $SOURCE_ROOT/marathon
  • If you built and installed using the script or manually:
sbt 'run --master <ip_address>:5050 --zk zk://<ip_address>:2181/marathon'
  • If you installed using the pre-built package:
./bin/marathon --master <ip_address>:5050 --zk zk://<ip_address>:2181/marathon

4.4) Access Web UI

  • Access UI http://<ip_address>:8080 in your browser.

References:

For more information on how to run Marathon in production and configuration options, see the Marathon docs.

⚠️ **GitHub.com Fallback** ⚠️