Configuration

Most of the configuration files for MCA can be found in /opt/mca/mca/api/config directory. At minimum, you need to configure the datasources for your instance before you can start using MCA.

Data Sources

datasource.js lists all sLS and global lookup service that host information is pulled from.

Global SLS

A sample datasource entry for Global SLS

"osg": {
    label: 'OSG',
    type: 'global-sls',
    activehosts_url: 'http://ps1.es.net:8096/lookup/activehosts.json',
    query: '?type=service&group-communities=OSG',
},
  • “osg” is used as internal key to identify this datasource. Pick one that’s unique.
  • label: is used to show the datasource name in the web UI
  • type: needs to be “global-sls” for Global SLS datasource.
  • activehosts_url: should always point to http://ps1.es.net:8096/lookup/activehosts.json unless you know a different global registry.
  • query: This query is passed to all sLS instances that are member of the global registry. For more detail on sLS query, please refer to sLS API Spec

So, the above sample datasource entry instructs mca-cache service to pull all service records (used to construct “hosts” for MCA) from the global lookup service (ps1.es.net) with community registered to “OSG”. If you don’t want any hosts from OSG, simply remove this section, or update the label and group-communities to something other than OSG.

As you may find in the default datasource.js, you can list as many datasources as you want. Make sure to use a unique key, and label.

sLS

If you have your private sLS instance, entering something like following

"wlcg": {
    label: 'WLCG',
    type: 'sls',
    url: 'https://soichi7.ppa.iu.edu/sls/lookup/records/?type=service&group-communities=WLCG',
    //exclude: [], //TODO - allow user to remove certain service from appearing in the UI
    cache: 1000*60*5, //refresh every 5 minutes (default 30 minutes)
},
  • “wlcg” is used as internal key to identify this datasource. Pick one that’s unique
  • label: is used to show the datasource name in the web UI
  • type: needs to be ‘sls’
  • url: URL for your private sLS instance. For type off queries, please refer to sLS API Spec
  • cache: refrequency of polling from this sLS in msec.

When you update this file, all meshconfig services will automatically restarts. Please monitor logs by “sudo -u mca pm2 logs”

Database

db.js is normally auto-generated by the setup script (please see Installation), but you can update this to point to an appropriate DB endpoint.

For example, to use mysql instead of postgres, update this to something like

module.exports = 'mysql://localhost:3306/database';

Or.. for SQLite

module.exports = {
    dialect: 'sqlite',
    storage: "/usr/local/tmp/meshconfig.sqlite",
}

MeshConfig Admin uses Sequelize which supports MySQL, MariaDB, SQLite, and PostgreSQL.

When you update this file, all meshconfig services will automatically restarts. Please monitor logs by “sudo -u mca pm2 logs”

Test Spec Default parameters

meshconfig.js contains default values for various test specification. Update this to your liking (please send us comments if we should be using a different default).

When you update this file, all meshconfig services will automatically restarts. Please monitor logs by “sudo -u mca pm2 logs”

Logging

logger.js contains logging related configuration. MCA uses Winston for logging. Please see Winston for more detail.

Others

index.js contains all other configuration such as ports and host names to bind MCA server and MCA publisher. It also contain information such as the location of JWT public key to verify token issued by SCA authentication service.

Authentication Service (sca-auth)

MCA uses authentication microservices developed by SCA (Scalable Computing Archive) group at IU. You can enable / disable various authentication methods provided by sca-auth by modifying /opt/mca/auth/api/config/ .

Certain features in MCA are restricted to only super-admin. In order to become a super-admin, you will need to run following as root via the command line.

cd /opt/mca/auth/bin
./auth.js modscope --username hayashis --add '{"mca": ["admin"]}'

You need to sign out & login again in order for this change to take effect.

Please refer to sca-auth gitrepo for more information.

Profile Service (sca-profile)

MCA uses profile microservices developed by SCA (Scalable Computing Archive) group at IU. Please refer to sca-profile gitrepo for more information.