Coder Social home page Coder Social logo

ligoj / plugin-prov Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 4.0 5.15 MB

Ligoj plugin for provisioning : design and execution with Terraform

Home Page: https://ligoj.io

License: MIT License

Java 66.83% JavaScript 24.05% HTML 7.15% CSS 1.97% HCL 0.01%
aws azure finops ligoj ligoj-plugin spring terraform

plugin-prov's Introduction

๐Ÿ”— Ligoj - API Docker API - UI Docker UI

alt text FOSSA Status

A web application to centralize the related tools of your projects, a dynamic connection management with security and data collection.

More technical details can be found in the subdirectories ligoj-api and ligoj-ui.

Coverage Codacy Badge Maintainability CodeFactor License Sauce Test Status

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

Get started

curl https://raw.githubusercontent.com/ligoj/ligoj/master/docker-compose.yml -o docker-compose.yml -s && docker-compose up

Open your browser at : Ligoj Home User/password for administrator role : ligoj-admin and ligoj-user for a regular user

You can install the plug-ins for RBAC security : plugin-id,plugin-id-ldap,plugin-id-ldap-embedded

Dev section

See Wiki page

See each container ligoj-api and ligoj-ui.

License

FOSSA Status

Installation guides

One script rebuild and run

Docker, compose and git install, then build, then run.

sudo yum install -y docker git
sudo pip3 install docker-compose
sudo usermod -a -G docker ec2-user
sudo systemctl enable docker.service
sudo systemctl start docker.service
git clone https://github.com/ligoj/ligoj.git
cd ligoj
mkdir -p "$(pwd)/.ligoj"
echo "LIGOJ_HOME=$(pwd)/.ligoj
PODMAN_USERNS=keep-id" > .env
docker-compose -p ligoj up -d --build
open http://localhost:8080/ligoj

Publish to AWS ECR

AWS_ACCOUNT="$(aws sts get-caller-identity --query "Account" --output text)"
AWS_REGION="$(curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone | sed 's/\(.*\)[a-z]/\1/')"
ECR_REGISTRY=$AWS_ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com
docker image tag ligoj/ligoj-api:4.0.0 $ECR_REGISTRY/ligoj/ligoj-api:4.0.0
docker image tag ligoj/ligoj-ui:4.0.0 $ECR_REGISTRY/ligoj/ligoj-ui:4.0.0
aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $ECR_REGISTRY
docker push $ECR_REGISTRY/ligoj/ligoj-api:4.0.0
docker push $ECR_REGISTRY/ligoj/ligoj-ui:4.0.0

Advanced deployments with compose

Custom Docker Compose variables

Variable Service Phase Default Note
LIGOJ_HOME api RUN /home/ligoj To map a persistent home
LIGOJ_REGISTRY * BUILD To push to your registry. When provided, must ends with /.
LIGOJ_VERSION app-* BUILD (version of application)
LIGOJ_WEB_PORT web RUN 8080 Internal WEB port
LIGOJ_PORT web RUN 8080 Exposed port
LIGOJ_API_JAVA_OPTIONS api RUN -Duser.timezone=UTC
LIGOJ_WEB_JAVA_OPTIONS web RUN -Duser.timezone=UTC -Dsecurity=Rest
LIGOJ_API_CRYPTO api RUN -Dapp.crypto.password=public Double encryption feature, see core-context-common.xml
LIGOJ_WEB_CRYPTO web RUN -Dapp.crypto.password=public Double encryption feature, see core-context-common.xml
LIGOJ_API_CUSTOM_OPTS api RUN `` Additional Java properties LIGOJ_API_JAVA_OPTIONS
LIGOJ_WEB_CUSTOM_OPTS web RUN `` Additional Java properties, merged with LIGOJ_WEB_JAVA_OPTIONS
LIGOJ_BUILD_PLATFORM app-* BUILD linux/amd64 Docker build platform.
LIGOJ_TARGET_PLATFORM app-* BUILD linux/amd64 Docker run platform.

Sample .env file:

LIGOJ_HOME=/var/data/ligoj
PODMAN_USERNS=keep-id
LIGOJ_BUILD_PLATFORM=linux/arm64
LIGOJ_TARGET_PLATFORM=linux/arm64
LIGOJ_REGISTRY=nexus.sample.local/
LIGOJ_API_PREPARE_BUILD='export HTTP_PROXY=192.168.0.254:8000 && export HTTPS_PROXY=192.168.0.254:8000'

Custom Docker Compose discovered scripts

Source Service Destination Phase Note
prepare-build.sh app-* WORKDIR BUILD Additional Bash commands executed inside the builder , before mvn but after MAVEN_OPTS is set.
prepare-run.sh app-* WORKDIR RUN Additional Bash commands executed inside the final image, before java
.m2/ app-* /root/.m2/ BUILD Custom Maven configuration: proxy, mirror, dependencies,...

Sample prepare-build.sh file:

export http_proxy=192.168.0.254:8000
export https_proxy=192.168.0.254:8000

Persistent Ligoj home

By default, with Docker compose, the home is persistent it contains:

  • plugins installation
  • logs of containers
  • database data
mkdir -p "$(pwd)/.ligoj"
echo "LIGOJ_HOME=$(pwd)/.ligoj
PODMAN_USERNS=keep-id" > .env

Use MySQL or PostgreSQL databases

By default, the Docker compose overrides is loaded from compose.override.yml and contains MySQL configuration.

For MySQL, the docker-compose command is:

export BUILDAH_FORMAT=docker
podman-compose -p ligoj build
podman-compose -p ligoj -f compose.yml  -f compose.override.yml up -d
podman-compose -p ligoj down

For PostgreSQL, the docker-compose command is:

export BUILDAH_FORMAT=docker
podman-compose -p ligoj build
podman-compose -p ligoj -f compose.yml  -f compose-postgres.yml up -d
podman-compose -p ligoj -f compose.yml  -f compose-postgres.yml down

API Description

API is only available from a valid session.

Plugin management

Ligoj is massively based on plugin management.

All plugins are deployed in Maven central

To build and deploy a plugin, more information are available in plugin-api repository.

Custom UI

Ligoj comes with a modular approach. For custom UI, the solutions are:

  • Rebuild plugin-ui, with specific assets, and deploy this plugin in a custom Maven repository, or upload it with /system/plugin/{artifact}/{version} API
  • Create your own plugin plugin-ui-company, with you specific assets: overrides and additions. Then install this plugin as above solution
  • Copy you specific assets in the Ligoj home directory such as /home/ligoj/META-INF/resources/webjars, $(pwd)/.ligoj/META-INF/resources/webjars, depending on your runtime. For sample:
    # With Ligoj CLI
    ligoj configuration set --id "ligoj.file.path" --value "^/home/ligoj/META-INF/resources/webjars/.*,^/home/ligoj/statics/themes/.*"
    ligoj file put --from /path/to/icon.png  --path "/home/ligoj/META-INF/resources/webjars/home/img/logo.png"
    ligoj file put --from /path/to/bg1.jpg  --path "/home/ligoj/statics/themes/bootstrap-material-design/img/bg1.jpg"
    
    # With local access of Ligoj home folder
    mkdir -p "${LIGOJ_HOME}/META-INF/resources/webjars/home/img" && cp /path/to/icon.png "$_/logo.png"
    mkdir -p "${LIGOJ_HOME}/statics/themes/bootstrap-material-design/img" && cp /path/to/bg1.jpg "$_/bg1.jpg"

plugin-prov's People

Contributors

acleret69 avatar alocquet avatar fdaugan avatar julienmunio avatar ligoj avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugin-prov's Issues

Auto-scale flag with min/max

Auto-scale flag with min/[max] amount
-min>=0 >= quantity (see #1 ) and maybe merged with quantity
-max>=min, nullable (no limit)

Predefined rate based usage

Rate based usage with slider for UI.
Over this slider some fixed thicks should be visible. For sample :

  • 100% : 24/7
  • 71% : Monday to Friday
  • 36% : Monday to Friday, half time 8h-20h
  • 30% : Monday to Friday, 9h-19h
  • 23% : Monday to Friday, 9h-12h,13h-18h

The compute price is updated in live when the value change

Repoening a view generate an error when a filter is set in datatables

To reproduce:

  • type a filter in a datatables
  • back to subscription of the project
  • reopen the previous prov subscription

Uncaught TypeError: Cannot read property 'oPreviousSearch' of null at Object.getFilteredData (prov.js?bust=1550143789606:2648) at Object.computeUsage (prov.js?bust=1550143789606:2685) at Object.updateUiCost (prov.js?bust=1550143789606:2472) at prov.js?bust=1550143789606:351
image

Add derived catalog

A derived catalog is a view based on another catalog, derived or not, and include filters.
A derived catalog can be deleted when it is unused.

Add full catalog update

Currently, the catalog prices are updated with increment without updating the specification of the underlying instances, storages etc. type.
Catalog update should provide a full reload option, or be integrated in the current mode.

Usage chart is not updated when there is not cost update

Precondition:

  • A default usage is defined for the quote
  • All costed resources are independent of the usage (fixed price)

When another default usage is selected, the cost does not vary (as expected), but the usage chart still display the previous rate.

Expected:
The chart must reflect the current rate.

Support currency conversion

Support currency conversion. This is a simple currency conversion without changing the actual bill's currency.
Conversion rates will use cache and download from the a well known referencial.

Add home link to the account

To perform this, we may :

  • either add a dependendy to ligoj/plugin-vm-aws, ligoj/plugin-vm-azure, ... And these plugins would maintain the "account" parameter. This allow plugin-prov-x to create dynamically on subscription for each instance to the related plugin-vm-x plugin.
  • either add the "account" parameter on this plugin-prov. The good part is the separate life cycle for this plugin, on the other side, there is no relation with the plugin-vm-x plugins. So unable to create dynamically the subscriptions to these plugins. But we could "import" plugin-prov-x instances from the plugin-vm-x.

Efficiency for each storage

In addition of global efficiency, add the detailed efficiency of each storage. Some cloud providers use fixed size storage.

JS error while creating a new usage

JS error while creating a new usage from the popup.
Cannot read property 'min' of undefined at Object.reloadAsNeed (prov.js?bust=1515452678994:75)
The usage is well created, the UI still responsive and working as normal but this new usage cannot be used and no mode more usage can be be created from this page until a refresh of the page.

Show the upfront price

Show the upfront price in the computed prices in addition of the blended prices.
This feature would open the financial analysis based on the available cash in the budget.

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.