Git Product home page Git Product logo

hub's Introduction

CDAP Hub

Setup

Since this repo stores jar files, it is required that you use git-lfs. See https://git-lfs.github.com/ for information on installing and settting up git-lfs.

Directory Structure

The Hub repository requires this directory structure:

packages/<name>/<version>/spec.json
packages/<name>/<version>/icon.jpg
packages/<name>/<version>/license.txt
packages/<name>/<version>/<other files>

Anything that falls under 'other files' will be zipped up by the packager into an 'archive.zip' file.

Local Hub Setup

Read the LOCALSETUP guide to setup CDAP Hub locally on your machine

Packager

To build the packager:

cd packager
mvn clean package
cd ..

The packager can be used to create the packages.json catalog file, create 'archive.zip' files, sign package specs and archives, and push the package files to s3. You can see the help manual by running:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Tool

The packager uses PGP to sign archives and specs. It is therefore compatible with keyrings created with GnuPG. For example:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Tool build -k ~/.gnupg/secring.gpg -i 499BC990789824FD -p mypassword

This will go through the files under the 'packages' directory, adding a 'packages.json' catalog at the top level and adding 'spec.json.asc', 'archive.zip', and 'archive.zip.asc' files:

packages.json
packages/<name>/<version>/spec.json
packages/<name>/<version>/spec.json.asc
packages/<name>/<version>/icon.jpg
packages/<name>/<version>/license.txt
packages/<name>/<version>/<file1>
packages/<name>/<version>/<file1>.asc
packages/<name>/<version>/<file2>
packages/<name>/<version>/<file2>.asc

To build all the packages and also push them to s3:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Tool publish -k <gpg keyring file> -i <keyid> -p <key password> -s3b <s3 bucket> -s3a <s3 access key> -s3s <s3 secret key>

This will build and sign all packages, as well as push anything that has changed to s3. The tool will use the md5 and file size to determine whether an object has changed or not. Signatures will only be pushed if the corresponding file has changed.

Package specs

The spec.json file must be a JSON Object with this format:

{
  "specVersion": "1.0",
  "label": "<label>",
  "description": "<description>",
  "author": "<author>",
  "org": "<org>",
  "created": <timestamp in seconds>,
  "categories": [ <categories> ],
  "cdapVersion": "<cdap version range>" (for example: "[4.0.0,4.1.0)")
  "actions": [
    {
      "type": "create_stream" | "create_app" | "create_artifact" | "create_dataset" | "load_datapack",
      "arguments": [
        {
          "name": "<arg name>",
          "value": <arg value>
        },
        ...
      ]
    },
    ...
  ]
}

Generator

The generator is a tool used to generate new packages from existing packages. It is useful if almost everything about the package is the same except for the CDAP version and plugin version (for pipelines).

To generate new packages:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Generator -cv <cdap-version> -gv <plugins-version> -pv <package-version> -bv <base-version> generate

For example:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Generator -cv 4.1.0-SNAPSHOT -gv 1.6.0-SNAPSHOT -pv 1.1.0 -bv 1.0.1 generate

will generate new 1.1.0 packages from existing 1.0.1 packages. The cdapVersion of the new packages will be 4.1.0-SNAPSHOT, and the artifact version for plugins in pipeline configs will be 1.6.0-SNAPSHOT.

By default, the tool will ignore any beta packages and will only create new packages for those with category 'usecase' or 'pipeline'. To do this for different categories, use the '-c' option. To include beta packages, use the '-b' option.

The generator can also modify existing packages instead of creating new packages. For example:

java -cp packager/target/*:packager/target/lib/* io.cdap.hub.Generator -cv 4.1.0 -gv 1.6.0 -pv 1.1.0 modify

will modify all 1.1.0 packages to use 4.1.0 as the cdapVersion and 1.6.0 as the plugin version.

hub's People

Contributors

curiousvini avatar albertshau avatar meseifan avatar bdmogal avatar cdap-apps avatar yaojiefeng avatar rmstar avatar chtyim avatar sagarkapare avatar elfenheart avatar ajainarayanan avatar rohitsinha54 avatar ibarbashov avatar anwar6953 avatar russorat avatar shiva-cirus avatar seanzhougoogle avatar anew avatar fernst avatar jayfjin avatar gsps1 avatar nitinmotgi avatar itsankit-google avatar greeshmaswaminathan avatar sheivin avatar hsiaoching avatar dli357 avatar shifuxu0301 avatar vravish avatar snehalakshmisha 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.