Giter Club home page Giter Club logo

ovirt-optimizer's Introduction

INSTALL

Make sure you have Oracle Java 7 or OpenJDK >= 1.7 installed.

Install ovirt-optimizer for jboss or jetty using:

yum install ovirt-optimizer-jetty
or
yum install ovirt-optimizer-jboss

Unpack the Optaplanner 6.2.0 to /usr/share/java which should create a directory
/usr/share/java/optaplanner-distribution-6.2.0.Final

You can download Optaplanner from http://download.jboss.org/optaplanner/release/6.2.0.Final/optaplanner-distribution-6.2.0.Final.zip

Or you can use the script ovirt-optimizer-setup that will try to do that
for you.

HTTP REVERSE PROXY

JBoss is listening on 127.0.0.1 in its default configuration and has no SSL configured. It is common to setup
a reverse proxy using httpd or nginx to forward the traffic to the web container running optimizer.

- Apache -

cat >/etc/httpd/conf.d/00-optimizer.conf <<EOF
<VirtualHost *:443>
    SSLEngine on
    SSLCertificateFile /etc/pki/tls/certs/optimizer.crt
    SSLCertificateKeyFile /etc/pki/tls/keys/optimizer.key

    <Location /ovirt-optimizer>
        ProxyPassMatch http://127.0.0.1:8080 timeout=3600 retry=5
        <IfModule deflate_module>
            AddOutputFilterByType DEFLATE text/javascript text/css text/html text/xml text/json application/xml application/json application/x-yaml
        </IfModule>
    </Location>
</VirtualHost>
EOF

If you are using httpd reverse proxy on RHEL 7.1 with enabled SELinux, you will have to allow
it to connect to the optimizer service:

setsebool -P httpd_can_network_relay=true

- Nginx -

server {
    server_name fqdn;
    listen 443;

    ssl on;
    ssl_certificate /etc/nginx/ssl/optimizer.crt;
    ssl_certificate_key /etc/nginx/ssl/optimizer.key;

    location /ovirt-optimizer {
        proxy_pass http://localhost:8080;

        gzip            on;
        gzip_min_length 1000;
        gzip_proxied    expired no-cache no-store private auth;
        gzip_types      text/plain application/xml application/json;
    }
}


RUN (USING RPM DISTRIBUTION)

service ovirt-optimizer-jboss start
systemctl start ovirt-optimizer-jboss

or start Jetty (using its own service files)


RUN (USING SOURCE  DISTRIBUTION)

1. using jetty:

1.1. quick developer mode -

    OVIRT_OPTIMIZER_CONFIG=/home/ovirt/ovirt-optimizer.properties \
    mvn jetty:run -pl ovirt-optimizer-jetty/

1.2. service mode (forked the bg, with debug port 5005 and 'stop' port 1353) -

    OVIRT_OPTIMIZER_CONFIG=/home/ovirt/ovirt-optimizer.properties \
    mvn -Prun -pl ovirt-optimizer-jetty/

#sample ovirt-optimizer.properties
org.ovirt.optimizer.sdk.protocol=http
org.ovirt.optimizer.sdk.server=dockerhost
org.ovirt.optimizer.sdk.port=8080
org.ovirt.optimizer.sdk.username=admin@internal
org.ovirt.optimizer.sdk.password=PASSWORD
org.ovirt.optimizer.sdk.ca.store=/etc/ovirt-optimizer/ovirt-optimizer.truststore

org.ovirt.optimizer.solver.steps=20
org.ovirt.optimizer.solver.timeout=30
org.ovirt.optimizer.solver.data.refresh=60
org.ovirt.optimizer.solver.cluster.refresh=300
#end of ovirt-optimizer.properties

a sample of the file is also under PROJECT-ROOT/ovirt-optimizer-core/src/main/resources


RELEASE

How to prepare a release:

1. update the version and changelog in the spec file:

1.1. change project_version and changelog in the spec
    - run
      mvn versions:set -DnewVersion=<new version>

2. run:
   git archive --format=tgz HEAD >ovirt-optimizer-{version}.tar.gz

BUILDING RPM

This shell script can be used to prepare a properly versioned RPM

sed -i -e 's/mvn --offline /mvn /g' ovirt-optimizer.spec

# downloads and installs the necessary jars
mvn help:evaluate -Dexpression=project.version 

# Prepare the version string (with support for SNAPSHOT versioning)
# $VERSION contains the version and ${VERSION[1]} the release if it is needed
VERSION=$(mvn help:evaluate -Dexpression=project.version 2>/dev/null | grep -v "^\[")
VERSION=${VERSION/-SNAPSHOT/-0.$(git rev-list HEAD --count).$(date +%04Y%02m%02d%02H%02M)}
IFS='-' read -ra VERSION <<< "$VERSION"

git archive --format=tar HEAD | gzip -9 >$HOME/rpmbuild/SOURCES/ovirt-optimizer-$VERSION.tar.gz
rpmbuild --define "_version $VERSION" --define "_release ${VERSION[1]-1}" -ba --nodeps ovirt-optimizer.spec

ovirt-optimizer's People

Contributors

david-caro avatar marsik avatar rgolangh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.