Commit Graph

77 Commits

Author SHA1 Message Date
Takuya ASADA
6ae1559bcd dist/redhat: avoid hardcoding GPG key file path on scylla-jmx-epel-7-x86_64.cfg
Since we want to support cross building, we shouldn't hardcode GPG file path,
even these files provided on recent version of mock.

This fixes build error on some older build environment such as CentOS-7.2.

See scylladb/scylla#3002

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1512668704-6775-1-git-send-email-syuu@scylladb.com>
2017-12-08 17:37:21 +02:00
Takuya ASADA
0f38eb221e dist/debian: requires root privilege to wipe build directory
Since we run pbuilder as root, .deb packages owned by root user so we need to
run 'rm -rf build' as root as well.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1512373941-7018-1-git-send-email-syuu@scylladb.com>
2017-12-04 10:04:46 +02:00
Amos Kong
01ba660fe7 sysconfig: correct the assignment in env file of systemd
This commit e80a5e3cb3 introduced an issue,
it wrongly passes an empty string to scylla-jmx cmdline, which causes
scylla-jmx script stuck. The cmdline real executes is:

  # scylla-jmx -l /usr/lib/scylla/jmx ""

Wrapped quotation marks of env variable can't be parsed away if we use
${SCYLLA_PARAMS} in ExecStart cmdline, but $SCYLLA_PARAMS works.

Another problem is the variable can't be re-used insider env file,
reference: [1]. Let's split the parameters to multiple env variables,
and combine them in ExecStart cmdline.

[1] https://unix.stackexchange.com/questions/358998/systemd-environmentfile-re-using-variables-how

Fixes scylladb/scylla#2935

Signed-off-by: Amos Kong <amos@scylladb.com>
Message-Id: <c983103c08a3f901037fd282a14df5bb7f85dddd.1510494507.git.amos@scylladb.com>
2017-11-12 15:57:43 +02:00
Fred de Villamil
e80a5e3cb3 Make more configuration options available for sysconfig
Using systemd to run scylla-jmx won't load params from
/etc/defaults/scylla-jmx because it expects params to be sent using the
command line.

This patch enhances the sysconfig file by adding the available options
(commented) and passes the right options to systemd `ExecStart` when
defined. That way scylla-jmx is ran with the params defined into
/etc/defaults/scylla-jmx.

Maybe not the most elegant way to do it, but 1/ it works 2/ I didn't
find a better solution to fix that problem.

Message-Id: <20170927085236.6704-1-fdevillamil@synthesio.com>
2017-10-09 15:52:35 +03:00
Takuya ASADA
631605eff1 dist/debian: append postfix '~DISTRIBUTION' to scylla package version
We are moving to aptly to release .deb packages, that requires debian repository
structure changes.
After the change, we will share 'pool' directory between distributions.
However, our .deb package name on specific release is exactly same between
distributions, so we have file name confliction.
To avoid the problem, we need to append distribution name on package version.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1502351777-11559-1-git-send-email-syuu@scylladb.com>
2017-08-10 11:39:19 +03:00
Glauber Costa
566a4f2639 default to our in-tree mock config when building on CentOS
scylla.git does a similar thing, albeit in a more complicated fashion,
testing for whether or not a rebuild is asked for and etc.

For us, the build process is a lot simpler, so it is better to just
point to the file when we detect that we are on CentOS and no explicit
target is given.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2017-07-27 16:02:16 +00:00
Glauber Costa
7416bc79cf provide mock configuration file
This adds the ability to build CentOS packages from Fedora - scylla
already has it. Aside from that, this guarantees that the build will
work in any system. In particular, by default rpmbuild is not given
network access in some of the systems I tested, causing the build to
fail as it tries to contact the maven repo.

This file is just a copy of the one provided by Centos' mock, with
the option to allow rpmbuild network added.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2017-07-27 16:02:16 +00:00
Takuya ASADA
81b0d12dfe dist/debian: use correct variable to detect distribution version
Since we switched to pbuilder and supported cross build, we no longer able to
use $DISTRIBUTION and $RELEASE in the script.
Use $TARGET instead.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1500540534-27951-1-git-send-email-syuu@scylladb.com>
2017-07-20 12:00:52 +03:00
Takuya ASADA
8c32e4f8a4 dist/debian: add more versions of Debian/Ubuntu releases
This will add Debian 9(stretch) support, and also non-official support of
Debian testing/unstable and Ubuntu non-LTS versions.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1500501275-8419-1-git-send-email-syuu@scylladb.com>
2017-07-20 10:32:44 +03:00
Takuya ASADA
9147faed36 dist/debian: append 'scylla-jmx' prefix to pbuilder tgz and directories
We want to allocate pbuilder chroot image and build directories for each
scylla repository to make sure build environment is always clean.

So append 'scylla-jmx' prefix for them.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1497902645-29487-2-git-send-email-syuu@scylladb.com>
2017-07-20 10:32:24 +03:00
Takuya ASADA
2b33ce558d dist/debian: no need to rm -rf non-existent file
This line copied from scylla-tools-java, and conf/hotspot_compiler does not
exist on scylla-jmx, so drop the entry.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1497902645-29487-1-git-send-email-syuu@scylladb.com>
2017-07-20 10:32:23 +03:00
Takuya ASADA
956eac3972 dist/debian: add 'sudo' for run yum on redhat variants
Since this script allows to run in non-root mode, sudo is required for yum.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1497891211-26574-2-git-send-email-syuu@scylladb.com>
2017-06-19 20:01:06 +03:00
Takuya ASADA
2a74a394a4 dist/debian: drop unused code for old versioning scheme
Since development version specified as "666.development", this code won't called anymore, so drop it.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1497891211-26574-1-git-send-email-syuu@scylladb.com>
2017-06-19 20:01:06 +03:00
Takuya ASADA
2ca07ac215 dist/debian: drop meaningless lines on build script
These lines comes from scylla-tools-java's build_deb.sh, but does nothing.
So drop them.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <20170616035130.16580-1-syuu@scylladb.com>
2017-06-19 12:31:52 +03:00
Takuya ASADA
8d404d8e9f dist/debian: Use pbuilder for Ubuntu/Debian debs
Enable pbuilder for Ubuntu/Debian to prevent build enviroment dependent issues.
Also support cross building by pbuilder.
(cross-building from Fedora 25 and Ubuntu 16.04 are tested)

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <20170615100230.18239-1-syuu@scylladb.com>
2017-06-15 13:51:59 +03:00
Takuya ASADA
fa72ea29d3 dist/redhat: Use mock for CentOS/RHEL rpms
Enable mock for CentOS/RHEL, also support cross building by mock.

See scylladb/scylla#630

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <20170522081759.8574-1-syuu@scylladb.com>
2017-05-23 12:09:03 +03:00
Takuya ASADA
962a42dbd5 dist/debian: install ca-certificates-java/jessie-backports for Debian8
openjdk-8-jre-headless/jessie-backports requires
ca-certificates-java/jessie-backports, but apt doesn't override
ca-certificates-java/jessie by default.

So install it before installing openjdk-8.

Fixes #40

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1487269613-21196-1-git-send-email-syuu@scylladb.com>
2017-02-16 23:22:34 +02:00
Takuya ASADA
db711b4b53 dist/debian: install python for git-archive-all
Since git-archive-all is python script, we need to install python if it's
unavailable.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1487054303-11556-1-git-send-email-syuu@scylladb.com>
2017-02-14 09:08:52 +02:00
Takuya ASADA
7f63fabeee dist: rename dist/ubuntu to dist/debian
Now we supported both Ubuntu and Debian on dist/ubuntu, and Ubuntu is one of
Debian variant, so dist/debian is better naming.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1486547332-3247-1-git-send-email-syuu@scylladb.com>
2017-02-08 17:31:24 +02:00
Pekka Enberg
557b346c07 dist/redhat: Require Java 8
The build requires Java 8 since commit
9c2d6cec51 ("Remove yammer/codehale
dependencies and augumentations").

Message-Id: <1485437777-23626-1-git-send-email-penberg@scylladb.com>
2017-01-26 16:52:04 +02:00
Takuya ASADA
79b3f989fc dist/ubuntu: generate Ubuntu/Debian revision correctly
Ubuntu Packaging Guide says if there's no upstream package (means it's not
ported from Debian), revision should be "0ubuntu1", not "ubuntu1" which is we
currently using.

On Debian, Debian Policy Manual says it's conventional to restart revision from 1 when upstream version increased, so we should specify it to "1".

To do it in single script, we will generate the revision on building time.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1483499161-22557-1-git-send-email-syuu@scylladb.com>
2017-01-09 09:46:21 +02:00
Takuya ASADA
ee0e460b26 dist/ubuntu: Fix package build error on Ubuntu 14.04/Debian 8
Since we moved to Java 8, we need to provide additional repository for
distributions which doesn't have Java 8 on default repository.

Fixes #37

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1483377878-17987-1-git-send-email-syuu@scylladb.com>
2017-01-02 19:37:53 +02:00
Takuya ASADA
7f936862d2 dist/ubuntu: check existance of build tools
It normally won't be problem because scylla-jmx usually build after scylla building.
However some tools we required for build_deb.sh doesn't installed on minimal installation, so we should check and install it.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1483004036-2824-1-git-send-email-syuu@scylladb.com>
2016-12-30 10:25:32 +02:00
Pekka Enberg
954f40e550 Revert "scylla-jmx.service.in: Depend on scylla-server"
This reverts commit 4672cd360f.

Fixes #34
2016-10-31 14:02:22 +02:00
Amnon Heiman
4672cd360f scylla-jmx.service.in: Depend on scylla-server
The correct dependency between the jmx and the scylla-server is:
The scylla-jmx should not run if the scylla-server is not running, it
should shutdown when the scylla-server shuts down.

Starting the scylla-jmx should not start the scylla-server, instead, if
the scylla-server is not running it should fail to start.

This patch changes the setup to do so.

Signed-off-by: Amnon Heiman <amnon@scylladb.com>
Message-Id: <1467184319-3395-1-git-send-email-amnon@scylladb.com>
2016-06-29 11:36:43 +03:00
Pekka Enberg
36ae2fcfd7 dist: Execute Maven in batch mode
The batch mode produces much more readable logs because it's designed
for non-interactive builds and doesn't have the fancy download progress
meters.
Message-Id: <1464770158-32482-1-git-send-email-penberg@scylladb.com>
2016-06-06 16:19:22 +03:00
Pekka Enberg
c6edab5990 dist/redhat: Fix RPM package build
Commit 12daaf5 ("dist/redhat: fix rpm build error") did not fix the
error, at least not on our Jenkins build machines.

Looking at the RPM build logs, we create the build directory:

+ cd /builddir/build/BUILD
+ mkdir build

but then change directory to "scylla-jmx-1.2.rc1":

+ cd /builddir/build/BUILD
+ cd scylla-jmx-1.2.rc1
+ mvn install

and therefore fail the copy:

+ cp dist/common/systemd/scylla-jmx.service.in build/scylla-jmx.service
cp: cannot create regular file 'build/scylla-jmx.service': No such
file or directory

I don't know why Takuya put the "mkdir" in the "prep" section but
something like this should unblock the build.
2016-06-01 10:59:52 +03:00
Takuya ASADA
12daaf546d dist/redhat: fix rpm build error
Since build/ is not exist, 'cp dist/common/systemd/scylla-jmx.service.in build/scylla-jmx.service' will fail.
So create build/ before starting build stage.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1464164524-20867-1-git-send-email-syuu@scylladb.com>
2016-05-25 13:24:04 +03:00
Takuya ASADA
225d8ace17 dist/ubuntu: chmod a+rx on build_deb.sh
Add permission to execute build_deb.sh

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1464083473-1701-2-git-send-email-syuu@scylladb.com>
2016-05-24 12:53:15 +03:00
Takuya ASADA
e3c5acfcad dist: Support systemd for Ubuntu 15.10/16.04
Since Ubuntu 15.10/16.04 has moved to systemd, share CentOS/Fedora's systemd unit file with Ubuntu.

Fixes scylladb/scylla#1283

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1464083473-1701-1-git-send-email-syuu@scylladb.com>
2016-05-24 12:53:15 +03:00
Avi Kivity
f6710465ef dist: change scylla-jmx process name from 'java' to 'scylla-jmx'
Helps in top, pgrep and friends.  Unfortunately the only reasonable way
to do it is to create a symlink to /usr/bin/java and run that.
Message-Id: <1463580254-8369-1-git-send-email-avi@scylladb.com>
2016-05-20 13:38:28 +03:00
Takuya ASADA
19a0e72752 dist/ubuntu: fix build error on Ubuntu 16.04 2016-04-30 07:51:07 +00:00
Takuya ASADA
72aae6bf3b dist/ubuntu: resolve build time dependency by mk-build-deps command
Resolve dependency packages from debian/control, intead of doing apt-get manually.
2016-04-30 07:44:25 +00:00
Takuya ASADA
d8d3023334 dist/ubuntu: generate correct distribution codename on debian/changelog
Since we supported more than one version of Ubuntu, need to generate each codename on changelog.
2016-04-30 07:42:35 +00:00
Takuya ASADA
ef15d95416 dist: #!/bin/bash for all scripts
Like we did on scylla-server, switch to bash.
2016-04-30 07:40:42 +00:00
Takuya ASADA
a2ec7f2f60 dist/ubuntu: drop classical sysv init script, only support Upstart for Ubuntu 14.04LTS
Drop sysv init script on scylla-jmx.
Same as a5bb6c4b1b

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1459346746-3433-2-git-send-email-syuu@scylladb.com>
2016-03-30 18:10:18 +03:00
Takuya ASADA
0c5c1debde dist: do not auto-start scylla-server job on Ubuntu package install time
Same as f1d18e9980
Fixes scylladb/scylla#1134

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1459346746-3433-1-git-send-email-syuu@scylladb.com>
2016-03-30 18:10:17 +03:00
Pekka Enberg
524763cfed dist/ubuntu: Use tilde for release candidate builds
The version number ordering rules are different for rpm and deb. Use
tilde ('~') for the latter to ensure a release candidate is ordered
_before_ a final version.
2016-03-22 12:23:48 +02:00
Pekka Enberg
d7e3dae323 dist/ubuntu: Relax Java dependencies
The requirement for Java 7 is too strict, especially as it's end-of-life.

Fixes #1029.
Message-Id: <1458132593-25935-1-git-send-email-penberg@scylladb.com>
2016-03-21 14:43:08 +02:00
Takuya ASADA
af8ce2d2ea dist: run as scylla on Ubuntu as well
Fixes #873

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1454607403-28849-1-git-send-email-syuu@scylladb.com>
2016-02-07 10:19:29 +02:00
Avi Kivity
24cebcc9a1 dist: do not always restart jmx on shutdown
Restart=always leads to the following loop:

 1. scylla terminates abnormally
 2. scylla-jmx sees that, and terminates
 3. systemd sees that scylla-jmx terminated, and restarts it.
 4. scylla-jmx requires scylla, so systemd starts it.
 5. goto 1.

To prevent the loop, set Restart=on-abnormal; systemd will restart scylla-jmx
if some JVM bug got it killed, but not otherwise.

The downside to this patch is that if scylla-server goes down, so does
scylla-jmx, but if scylla-server is then restarted, scylla-jmx stays down.
To get scylla and scylla-jmx to start together, we need to create
scylla.service that requires both of them.
2016-01-07 09:11:51 +02:00
Pekka Enberg
4dfa0737ac Rename urchin-mbean.jar to scylla-jmx.jar
Urchin is an obsolete working name for Scylla. Rename the Jar file to
scylla-jmx.jar.

Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-12-17 09:27:58 +02:00
Pekka Enberg
7c34fb8ce0 dist/ubuntu: Remove unneeded startup parameters
Fixes #19.

Signed-off-by: Pekka Enberg <penberg@scylladb.com>
2015-12-16 17:56:07 +02:00
Takuya ASADA
c25a844410 dist: remove unneeded parameters
Since scylla-jmx supports to read configuration from scylla.yaml, we
don't need to pass these parameters from program arguments.

Fixes #17.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
2015-12-14 11:29:28 +02:00
Takuya ASADA
18674d67b0 dist: do not overwirte sysconfig file on 'yum update' 2015-12-02 01:27:47 +09:00
Takuya ASADA
bdc7f3fb57 dist: export SCYLLA_HOME, SCYLLA_CONF 2015-12-02 01:26:13 +09:00
Takuya ASADA
bcc99b274f dist: drop dist/common/scripts/jmx_run, use scripts/scylla-jmx 2015-12-02 01:19:03 +09:00
Takuya ASADA
473702845f dist: fix 'ancient-standards-version 3.9.2 (current is 3.9.5)' message on building ubuntu package 2015-11-25 19:43:38 +09:00
Takuya ASADA
abb1838845 dist: fix 'init.d-script-not-included-in-package etc/init.d/scylla-jmx' message on building ubuntu package 2015-11-25 19:43:38 +09:00
Takuya ASADA
2310eb6844 dist: cleanup dependency-reduced-pom.xml when rebuilding ubuntu package 2015-11-25 19:43:38 +09:00