You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Next »

Overview

Order of Operations

  1. MongoDB must be running first
  2. Next, start the RabbitMQ
  3. Then, start Clowder itself
  4. Optional: Finally, start any extractors that you want
    1. You may need to give Clowder 10-15 minutes to discover this change.
  5. Verify that the extractors are registered to Clowder by navigating to: CLOWDER_URL:PORT/api/status
    1. You should see the extractors show up in their respective section after several minutes.

Required Environment Variables

Default / acceptable values are in paranethesis.

These values are already specified inside of the controllers/*-controller.yaml files.

 

Clowder

The following environment variables MUST BE SET in order to start Clowder:

  • SMTP_HOST: (smtp.ncsa.illinois.edu) The SMTP server that Clowder should use to send e-mail
  • CLOWDER_BRANCH: (CATS-CORE0) Which branch should Clowder use to execute?
  • CLOWDER_BUILD: (latestSuccessful) Which build should Clowder use to execute?
  • CLOWDER_UPDATE: (NO) Whether or not to push updates back upstream
  • MONGO_URI: (mongodb://[user[:password]@]MONGO_SERVICE_IP_ADDR:PORT/clowder) The URI that should be used to connect to MongoDB
  • RABBITMQ_URI: (amqp://guest:guest@RABBIT_SERVICE_IP_ADDR:PORT/%2F) The URI that should be used to connect to RabbitMQ
  • RABBITMQ_EXCHANGE: (clowder) The name of the RabbitMQ exchange that should be used
  • RABBITMQ_MGMT_PORT: (15672) The port that should be used to access the management web UI for RabbitMQ

Extractors

The following environment variables MUST BE SET in order to start the extractors:

  • RABBITMQ_URI: (amqp://guest:guest@RABBIT_SERVICE_IP_ADDR:PORT/%2F) The URI that should be used to connect to RabbitMQ
  • RABBITMQ_EXCHANGE: (clowder) The name of the RabbitMQ exchange that should be used
  • RABBITMQ_VHOST: (%2F) The virtual host (URI segment) of RabbitMQ
  • RABBITMQ_QUEUE: (varies) The queue that this extractor should watch for work to do
  • RABBITMQ_PORT_5672_TCP_ADDR: (SERVICE_IP_ADDR) The address of RabbitMQ's message bus
  • RABBITMQ_PORT_5672_TCP_PORT: (5672) The port that RabbitMQ is using for its message bus
  • RABBITMQ_PORT_15672_TCP_ADDR: (SERVICE_IP_ADDR) The address of RabbitMQ's management interface
  • RABBITMQ_PORT_15672_TCP_PORT: (15672) The port that RabbitMQ is using for its management interface

Bootstrapping Clowder in Kubernetes

Step 0: Clone Source Repository

git clone https://github.com/nds-org/nds-labs
cd nds-labs/
git fetch --all
git checkout lambert-dev

TODO: Once this is pushed up to master, remove the "checkout" step.

Step 1: Bring up all services

This step MUST be done before the controllers can be started. Create the 3 necessary services using the following command:

kubectl create -f services/

Starting these services creates a bunch of environment variables containing ip/port/protocol of the service that are then injected into controllers/pods that match the selector. Any pods started after these services will have these environment variables injected into their pod's environment. This allows us to set values in the controller specification like this:

        - name: RABBITMQ_URI
          value: "amqp://guest:guest@$(CLOWDER_RABBITMQ_PORT_5672_TCP_ADDR):$(CLOWDER_RABBITMQ_PORT_5672_TCP_PORT)/%2F"

Step 2: Bring up any controllers (in order)

1.)  To bring up a MongoDB controller and pod, run the following command:

kubectl create -f controllers/mongodb-controller.yaml

 

2a.)  Run this command to start ElasticSearch

kubectl create -f controllers/elasticsearch-controller.yaml

 

2b.)  Run this command to start RabbitMQ:

kubectl create -f controllers/rabbitmq-controller.yaml

 

3.)  (Optional) After starting RabbitMQ, run commands similar to the following in order to start your extractors:

kubectl create -f controllers/EXTRACTOR-1-controller.yaml
kubectl create -f controllers/EXTRACTOR-2-controller.yaml
   .   .   .
kubectl create -f controllers/EXTRACTOR-N-controller.yaml

 

4.)  Run this command last to bring up Clowder itself:

kubectl create -f controllers/clowder-controller.yaml

Tip and Tricks

Scaling Extractors

Use the following command to scale up or down an extractor on the fly:

kubectl scale --current-replicas=1 --replicas=2 rc clowder-image-preview

NOTE: --current-replicas is optional, but highly recommended when scaling down a controller.

NOTE: --replicas=0 is an acceptable value, allowing you to start a controller without starting its pods right away.

Hot-swapping Extractors

As you bring up and take down extractors, they will (every few minutes or so) automagically register / unregister themselves from Clowder. Based on the behavior, this is likely done via a polling process. 

If you are trying to modify which extractors you are currently using, be sure to give Clowder up to 15 minutes to discover the change.

 

  • No labels