Git Product home page Git Product logo

openaf / openaf Goto Github PK

View Code? Open in Web Editor NEW
11.0 11.0 6.0 521.11 MB

A Java & Javascript based "swiss-army knife" scripting DevOps tool for different automation challenges with minimal requirements and footprint, extensible through packages (opacks).

Home Page: https://openaf.io

License: Apache License 2.0

JavaScript 64.39% CSS 0.05% Java 35.33% Handlebars 0.24%
openaf opack ojob odoc oaf obook devops javascript

openaf's Introduction

OpenAF

Build and Test asserts tests

Installing

Operating system install

On an empty folder:

OS Command/Instructions
Windows Download and execute:
https://openaf.io/win64/install.bat
Mac Execute on a Terminal:
wget -O - https://openaf.io/mac64/install.sh | sh
Unix x86 Execute on a shell:
wget -O - https://openaf.io/unix64/install.sh | sh
Unix arm32 Execute on a shell:
wget -O - https://openaf.io/arm32/install.sh | sh
Unix arm64 Execute on a shell:
wget -O - https://openaf.io/arm64/install.sh | sh

Docker container

Use the docker container:

docker run -ti openaf/openaf

(see more in openaf-dockers)

Download JAR file

Download just the Java JAR file:

Build URL
Latest stable build https://openaf.io/openaf.jar
Latest nightly build https://openaf.io/nightly/openaf.jar

and the execute on an empty folder:

java -jar openaf.jar --install

Minimum requirements

  • Java: JRE 1.8
  • Memory: 128MB (for installing and updating, runtime can be lower)
  • Storage: around 160MB (for installing and updating, runtime can be 64MB)

(storage requirements can be made lower if needed, tbc)

How to run a script

How to run a "Hello World" script

Step Instruction Sample
1 Create a "hello.js" file print("Hello World!");
2 Execute on the same folder as the "hello.js" file $ openaf -f hello.js

How to run in-line code

Windows

PS > openaf -c "print('Hello World!');"

Unix

$ openaf -c 'print("Hello World!");'

Update and uninstall

Update

openaf --update

Uninstall

Just delete the original empty folder where you executed the install command.

Documentation

Building

After cloning the repository locally execute:

ojob build.yaml

Testing a build

After building, on the tests sub-folder, the recommend way is to use the just openaf just built:

ojob autoTestAll.yaml

But you can use a previous stable openaf build if the ow.test and ojob functionality could be broken by your changes.

Links

openaf's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar leandrofernandes5 avatar mhfatmobileum avatar nmaguiar avatar nmsaguiar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openaf's Issues

ow.test improvements

  • Be able to remove or not the log output for test results (should improve testing loops)
  • Keep max and min times on the internal __profile
  • toMarkdown should aggregated results for multiple runs

oPack genpack yaml logging

When using oPack genpack for yaml package file generation the logging seems to leave unwanted characters once the command finishes.

oPack script creation

This opack command for script, daemon and ojob documentation should be documented and tested after a first phase of tests.

DB: retrieving null dates

When using a DB object with convertDates(true) and the SQL query returns a null date an exception is thrown. A possible workaround is to use a NVL like function on SQL.

Audit auth access to channels

Optionally it should be possible to audit all authorized (and none anonymous) access to an OpenAF channel. This should include the info for which key was changed/deleted by a specific access.

oJob: Better handling of duplicated jobs in todo

In oJob, whenever the same job appears twice on a todo list, it should be handle either be creating an extra execution for that job or ignoring and warning that a new job should be added to provide the same functionality:

jobs:
   - name: myjob

   - name: job1
     to: myjob

   - name: job2
     to: myjob

jobs:
   - job1
   - job2

Log warnings on openaf-console

The nightly build produces the following error when starting the openaf-console:

java.util.logging.LogManager$RootLogger log
SEVERE: Failed to resolve default logging config file: config/java.util.logging.properties

io.gzip/io.gunzip: conversion from java byte array

In the following situation:

var a = Packages.org.apache.commons.io.IOUtils.toByteArray(anInputStream);
var s = af.fromBytes2String(io.gunzip(a));

The io.gunzip will receive a as a NativeJavaArray instead of a B[]. So the NativeJavaArray needs to be "unwrapped" in both io.gunzip and io.gzip if instance of NativeJavaArray.

Error handling on load/loadLib

The load and loadLib functions should be reviewed further on how they make a distinction between FileNotFound exceptions. In some cases it's difficult to assess which is the cause of loading failure.

sh/af.sh gets stuck with large outputs

When executing a command with sh/af.sh that outputs a "large content" (>1KB) the sh/af.sh seems to get stuck (even with timeout). But if executed with inheritIO = true it works perfectly.

Java >=9 issues

Solving or working around Java 9 GA compiling and execution issues:

  • Automated tests fail for gzip native to byte array
  • Automated tests warnings on read/writeFileStreamBytes
  • Deprecation warnings on building
  • Repack operation fails
  • jdeps -jdkinternals openaf.jar
  • Rhino issue: mozilla/rhino#352

DB: convert oracle timestamps

When using the DB object and setting convertDates(true) the timestamps fields are not being properly converted. Instead the value is shown as "oracle.sql.TIMESTAMPTZ@1234567". As a possible workaround a trunc is enough to convert back to a date.

ow.ch: Implement a MVS channel type

Implement a channel type using H2 MVStore with options to be persisted in memory or disk, map with a single name or based on a function, optional map housekeeping with a function, compression options, etc.
Then probably some ow.ch.utils functions to provide map names and housekeeping based on date and housekeeping based on number of records. This would be useful for a new output on nattrmon.

opack: Alert when .opack.db has wrong permissions

Whenever .opack.db loses reading permissions for the user running a openaf script using libraries from opacks, there isn't any warning or exception to remember that .opack.db has the wrong reading permissions.

oJob dependencies onSuccess and onFail exec blocks

The default behaviour is for a job that has dependencies to only execute the exec block if and when all dependencies are successfully executed. But when a job dependency fails the job will wait for any successful re execution of the job dependency. It would help if a exec block for onFail of a dependency could be created and also decided (by returning false or true?) if the job should wait for a re execution or also fail.

 - name      : My results
   deps      :
       - name     : My first job
         onSuccess: print("Great, first job done.");
         onFail   : print("I really need the first job"); return true; /* return true for the "My results" job to fail */

       - name     : My wrong job
         onSuccess: print("Great, wrong job went ok.");
         onFail   : print("Wrong job failed but actually it's optional. Just to warn you."); /* returns false by default so "My results" job doesn't fail */

    exec      : |
       if (args.__deps['My wrong job']) { ... }

ow.template: addFormatHelpers and addConditionalHelpers not working

After the last revision of ow.template to use require the addFormatHelpers and addConditionalHelpers no longer work as expected since a subsequent call to parse, for example, won't consider these helpers. Additionally more automated tests for this should be added.

As a workaround you can use HandleBars directly but it kinda defeats the propose.

opack install should return 0

Executing "opack install" should return exit code 0 instead of a non-zero code. This would be specially helpful when building docker images, for example.

Organize the js folder with sub-folders

As the js folder increases in size it would be better organized if it was divided into sub-folders. That means changes on the build and load process to be assessed.

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.