0

I tried to use the "alternatives" key in my parcels.json. However, Cloudera's parcel validiator kicked it out with:

==> Unrecognized field "scripts.alternatives". Recognized fields are "[defines, _defines]"

My parcel.json file is:

{
  "schema_version": 1,
  "name": "Runtime",
  "version": "2",
  "setActiveSymlink": true,

  "depends": "",
  "replaces": "MATLAB_Runtime",
  "conflicts": "",

  "provides": [
    "mine"
  ],

  "scripts": {
    "defines": "env.sh",
    "alternatives": "alternatives.json"
  },

  "packages": [
    { "name"   : "Runtime",
      "version": "2"
    }
  ],

  "components": [
    { "name"       : "mine",
      "version"    : "2",
      "pkg_version": "2",
      "pkg_release": "2"
    }
  ],

  "users":{},

  "groups":[]
}

The json validates fine without the "alternatives" key.

The schema for parcels.json is described in One Engineer’s Experience with Parcel.

And the validates.json contents are described in The alternatives.json file

dudepro
  • 73
  • 1
  • 7

1 Answers1

2

Accordingly to this: https://github.com/cloudera/cm_ext/wiki/The-parcel.json-file

Scripts Currently, there is only one script that can be specified and used by Cloudera Manager, although that may change in the future. defines: This script is sourced into the environment of each process that the parcel affects (based on the tags). Even if a parcel doesn't require any environment variables to be defined, this script must be provided (the script itself can be empty). The 'defines' script does the real work to make a parcel's contents accessible to processes. This is a substantial topic, discussed [here](The Parcel Defines Script).

There can be only defines option inside scripts block. alternatives.json file, accordingly to this (https://github.com/cloudera/cm_ext/wiki/The-alternatives.json-file) is optional and will be silently consumed by scm agent.

Use validator (https://github.com/cloudera/cm_ext/tree/master/validator) with -a option to make sure your file is correct.

-a,--alternatives-json <FILE> The alternatives.json file to validate