Package Configuration

The following instructions are applicable to Manifold instances that were installed via the omnibus packages (.pkg, .deb).

Overview

The omnibus packages install Manifold and all requirements into /opt/manifold. Any files in this directory may be overwritten when you upgrade Manifold to a new version. Consequently, files in /opt/manifold should not be modified. Any customizations to your instance or persistent data is stored outside of the installation directory. To adjust how the various component services work, make changes to /etc/manifold/manifold.rb. Each of the services may be managed through the settings in this file.

CLI Interfaces

There are two primary command line interfaces for interacting with the installation on the server: manifold-ctl and manifold-api.

Using manifold-ctl

The manifold-ctl command includes a number of subcommands:

[root@centos7-install ~]$ manifold-ctl help
cleanse
  Delete *all* manifold data, and start from scratch.
uninstall
  Kill all processes and uninstall the process supervisor (data will be preserved).
upgrade
  Run migrations after a package upgrade
General Commands:
  cleanse
    Delete *all* manifold data, and start from scratch.
  help
    Print this help message.
  reconfigure
    Reconfigure the application.
  show-config
    Show the configuration that would be generated by reconfigure.
  uninstall
    Kill all processes and uninstall the process supervisor (data will be preserved).
Service Management Commands:
  graceful-kill
    Attempt a graceful stop, then SIGKILL the entire process group.
  hup
    Send the services a HUP.
  int
    Send the services an INT.
  kill
    Send the services a KILL.
  once
    Start the services if they are down. Do not restart them if they stop.
  restart
    Stop the services if they are running, then start them again.
  service-list
    List all the services (enabled services appear with a *.)
  start
    Start services if they are down, and restart them if they stop.
  status
    Show the status of all the services.
  stop
    Stop the services, and do not restart them.
  tail
    Watch the service logs of all enabled services.
  term
    Send the services a TERM.

Reconfiguring Manifold Services

Anytime you change the manifold configuration file at /etc/manifold/manifold.rb, you will need to run manifold-ctl reconfigure. The reconfigure command will adjust service configuration based on your settings.

Viewing Status and Starting/Stopping Services

The various service commands can be used to manage individual services. Use manifold-ctl status to see the status of each service:

[root@centos7-install ~]$ sudo manifold-ctl status
run: cable: (pid 19207) 9273s; run: log: (pid 6280) 81309s
run: client: (pid 19212) 9273s; run: log: (pid 6106) 81327s
run: clockwork: (pid 19225) 9272s; run: log: (pid 6151) 81321s
run: elasticsearch: (pid 19245) 9270s; run: log: (pid 5914) 81345s
run: logrotate: (pid 20806) 2069s; run: log: (pid 6056) 81333s
run: nginx: (pid 19272) 9269s; run: log: (pid 5996) 81339s
run: postgresql: (pid 19286) 9269s; run: log: (pid 5609) 81368s
run: puma: (pid 19305) 9268s; run: log: (pid 6221) 81315s
run: redis: (pid 19308) 9267s; run: log: (pid 5498) 81374s
run: sidekiq: (pid 19344) 9256s; run: log: (pid 5731) 81362s

Restart all services with manifold-ctl restart:

[root@centos7-install manifold]# manifold-ctl restart
ok: run: cable: (pid 21661) 0s
ok: run: client: (pid 21666) 0s
ok: run: clockwork: (pid 21675) 1s
ok: run: elasticsearch: (pid 21698) 0s
ok: run: logrotate: (pid 21723) 1s
ok: run: nginx: (pid 21738) 0s
ok: run: postgresql: (pid 21756) 0s
ok: run: puma: (pid 21826) 0s
ok: run: redis: (pid 21829) 0s
ok: run: sidekiq: (pid 21834) 0s
[root@centos7-install manifold]#

Or restart a single service by name:

[root@centos7-install manifold]# manifold-ctl restart nginx
ok: run: nginx: (pid 21892) 1s
[root@centos7-install manifold]#

Viewing Logs

Use manifold-ctl tail [service-name] to tail the log of a particular service. For example:

[root@centos7-install ~]# manifold-ctl tail client
2018-09-12_20:27:20.69625 🔔  Client server will proxy /build requests to /opt/manifold/embedded/src/client/dist/manifold/www/build.
2018-09-12_20:27:20.69627 🔔  Client server will proxy /static requests to /opt/manifold/embedded/src/client/dist/manifold/www/static.
2018-09-12_20:27:20.70075 🔔  Client server is starting up.
2018-09-12_20:27:20.70722 ✊  Client server is listening on a socket at /var/opt/manifold/client/sockets/client.sock.

Manifold stores all logs in /var/log/manifold, and logs are rotated by the embedded logrotate service.

Persistent Data

Data that persists across upgrades are stored in /var/opt/manifold. Some of these files may be changed when the manifold-ctl reconfigure command is run.

Using manifold-api

Manifold also ships with a manifold-api command line tool. Manifold’s API is a Ruby on Rails app, and the manifold-api executable is a wrapper around that applications Rails/Rake commands. For example, you can access the Rails console and interact with your data using manifold-api console command:

[root@centos7-install manifold]# manifold-api console
Loading production environment (Rails 5.0.6)
[1] pry(main)> Project.pluck(:title)
=> ["Test Project"]

A number of rake tasks are also exposed through this interface:

# Loads one text into Manifold and creates a corresponding project
manifold:dev:load_text[path,log_level]
# Ensure that every project has a published text
manifold:dev:publish_project_texts
# Imports all projects in a directory into Manifold
manifold:import:projects[path,include_texts,log_level]
# Queue all projects for tweet fetching
manifold:job:queue_fetch_all_tweets                                         
# Fetch the project's tweets
manifold:project:fetch_tweets[project_id]
# Import a project form a JSON definition
manifold:project:import[path,include_texts]
# Imports a projects resource into Manifold from Google Drive
manifold:project:import:drive:resources[project_id,drive_sheet,drive_dir]
# Ingest a project text
manifold:project:ingest[project_id,path]
# Reindex searchable models
manifold:search:reindex
# Reindex collection models
manifold:search:reindex:collection
# Reindex event models
manifold:search:reindex:event
# Reindex maker models
manifold:search:reindex:maker
# Reindex project models
manifold:search:reindex:project
# Reindex resource models
manifold:search:reindex:resource
# Reindex subject models
manifold:search:reindex:subject
# Reindex user models
manifold:search:reindex:user
# Update searchable text nodes
manifold:search:update_text_indexes
# Regenerate all Manifold thumbnails
manifold:thumbnails:regenerate
# Regenerate Manifold collection thumbnails
manifold:thumbnails:regenerate:collection
# Regenerate Manifold maker thumbnails
manifold:thumbnails:regenerate:maker
# Regenerate Manifold project thumbnails
manifold:thumbnails:regenerate:project
# Regenerate Manifold resource thumbnails
manifold:thumbnails:regenerate:resource
# Regenerate Manifold user thumbnails
manifold:thumbnails:regenerate:user
# Upgrades an installation of Manifold to the latest version
manifold:upgrade[force]
# Create a new manifold user
manifold:user:create[email,password,first_name,last_name,role]
# Create a new manifold admin user
manifold:user:create:admin[email,password,first_name,last_name,role]