d2iq-archive / marathon-pkg

Packaging utilities for Marathon.
17 stars 10 forks source link

Can not build marathon-1.5 #32

Open timp87 opened 6 years ago

timp87 commented 6 years ago

Hello. I've followed the instruction described in README.md of this repository. I've managed to build latest marathon-1.4.11, but I'm unable to build marathon-1.5.5. Looks like Makefile has inappropriate for 1.5.5 steps relying on assembly which is not used in marathon 1.5.5.

[root@hostname 1.5.5-git]# git clone https://github.com/mesosphere/marathon-pkg.git
Cloning into 'marathon-pkg'...
remote: Counting objects: 253, done.
remote: Total 253 (delta 0), reused 0 (delta 0), pack-reused 253
Receiving objects: 100% (253/253), 42.55 KiB | 0 bytes/s, done.
Resolving deltas: 100% (140/140), done.

[root@hostname 1.5.5-git]# cd marathon-pkg/

[root@hostname marathon-pkg]# git submodule init
Submodule 'marathon' (https://github.com/mesosphere/marathon.git) registered for path 'marathon'

[root@hostname marathon-pkg]# git submodule update
Cloning into 'marathon'...
remote: Counting objects: 94317, done.
remote: Compressing objects: 100% (93/93), done.
remote: Total 94317 (delta 40), reused 17 (delta 5), pack-reused 94218
Receiving objects: 100% (94317/94317), 32.49 MiB | 8.55 MiB/s, done.
Resolving deltas: 100% (53838/53838), done.
Submodule path 'marathon': checked out '22a00d46fa1741e5c237f2e70e4180d53b3b127b'

[root@hostname marathon-pkg]# cd marathon

[root@hostname marathon]# git checkout v1.5.5
Previous HEAD position was 22a00d4... Setting version to 0.7.5
HEAD is now at 419fb2a... switching to contravariance for security of the plugin. resulting in discovery of incorrect auth on group (#5841)
[root@hostname marathon]# cd ..

[root@hostname marathon-pkg]# git add marathon

[root@hostname marathon-pkg]# make rpm
cat: version.sbt: No such file or directory
cat: version.sbt: No such file or directory
cd marathon && sbt assembly && bin/build-distribution
Getting org.scala-sbt sbt 0.13.13  (this may take some time)...
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.13.13/jars/sbt.jar ...
        [SUCCESSFUL ] org.scala-sbt#sbt;0.13.13!sbt.jar (3842ms)
downloading https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.6/scala-library-2.10.6.jar ...
        [SUCCESSFUL ] org.scala-lang#scala-library;2.10.6!scala-library.jar (318ms)
downloading https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.13.13/jars/main.jar ...
        [SUCCESSFUL ] org.scala-sbt#main;0.13.13!main.jar (7086ms)

...
downloading https://repo1.maven.org/maven2/org/scala-sbt/template-resolver/0.1/template-resolver-0.1.jar ...
        [SUCCESSFUL ] org.scala-sbt#template-resolver;0.1!template-resolver.jar (8ms)
:: retrieving :: org.scala-sbt#boot-app
        confs: [default]
        50 artifacts copied, 0 already retrieved (17645kB/48ms)
Getting Scala 2.10.6 (for sbt)...
downloading https://repo1.maven.org/maven2/org/scala-lang/jline/2.10.6/jline-2.10.6.jar ...
        [SUCCESSFUL ] org.scala-lang#jline;2.10.6!jline.jar (19ms)
downloading https://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
        [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (12ms)
:: retrieving :: org.scala-sbt#boot-scala
        confs: [default]
        5 artifacts copied, 0 already retrieved (24494kB/40ms)
[info] Loading project definition from /root/build-dir/1.5.5-git/marathon-pkg/marathon/project
[info] Updating {file:/root/build-dir/1.5.5-git/marathon-pkg/marathon/project/}marathon-build...
...
[info]  [SUCCESSFUL ] com.fasterxml.jackson.datatype#jackson-datatype-jsr310;2.5.4!jackson-datatype-jsr310.jar(bundle) (10ms)
[info] downloading https://repo1.maven.org/maven2/org/scala-stm/scala-stm_2.10/0.7/scala-stm_2.10-0.7.jar ...
[info]  [SUCCESSFUL ] org.scala-stm#scala-stm_2.10;0.7!scala-stm_2.10.jar (29ms)
[info] downloading https://repo1.maven.org/maven2/com/typesafe/config/1.3.0/config-1.3.0.jar ...
[info]  [SUCCESSFUL ] com.typesafe#config;1.3.0!config.jar(bundle) (16ms)
[info] Done updating.
[info] Compiling 8 Scala sources to /root/build-dir/1.5.5-git/marathon-pkg/marathon/project/target/scala-2.10/sbt-0.13/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.10.6. Compiling...
[info]   Compilation completed in 5.503 s
[info] Set current project to marathon (in build file:/root/build-dir/1.5.5-git/marathon-pkg/marathon/)
[error] Not a valid command: assembly
[error] Not a valid key: assembly
[error] assembly
[error]         ^
make: *** [marathon-runnable.jar] Error 1
timp87 commented 6 years ago

Looks like this git repo is abandoned. But it helped me anyway. Also official marathon repo stopped providing packages for new versions so I built it manually.

This was done on CentOS 7.2

You need a machine with at least 8GB of RAM.

Add SBT repo like described here http://www.scala-sbt.org/release/docs/Installing-sbt-on-Linux.html

[root@localhost ~]# curl https://bintray.com/sbt/rpm/rpm | sudo tee /etc/yum.repos.d/bintray-sbt-rpm.repo

Install all needed packages like described in thisrepository:

[root@localhost ~]# yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel git ruby ruby-devel rpm-build sbt

Install additional packages to build ruby gems

[root@localhost ~]# yum install libffi libffi-devel gcc

Install FPM ruby gem

[root@localhost ~]# gem install fpm

Clone official marathon git repo

[root@localhost ~]# git clone https://github.com/mesosphere/marathon.git

Got to the git root dir

[root@localhost ~]# cd marathon/

Check out needed git tag (marathon release version)

[root@localhost marathon]# git checkout v1.5.5

Build packages

[root@localhost marathon]# sbt packageLinux

Here are various rpm and deb packages for SysV and SystemD based distros

[root@localhost marathon]# ls -1 target/packages/
systemd-marathon-1.5.5-1.noarch.rpm
systemd-marathon_1.5.5_all.deb
systemv-marathon-1.5.5-1.noarch.rpm
systemv-marathon_1.5.5_all.deb
upstart-marathon_1.5.5_all.deb

Something like this should be documented in official marathon documentation.