Skip to content

A simple console for running labs on Babylon infrastructure for events such as Red Hat Summit.

Notifications You must be signed in to change notification settings

redhat-cop/babylon-events-console

Repository files navigation

Babylon Events Console

This project provides a simple interface for running a lab environments on babylon for events where users are not expected to have authentication credentials. The Babylon events console automatically provisions a unique lab environment to each user that connects to the console interface and provides an administrative interface for those running the lab.

Deploying the Events Console

This project includes an OpenShift template, deploy-template.yaml, for configuring and deploying the babylon events console.

The following template parameters are used to configure the console:

Parameter Default Description

NAME

"babylon-events-console"

Name to apply to OpenShift resources (deployment, service, route, etc.).

ACCESS_PASSWORD

none

Optional access password if event users need to provide an access code to begin a lab.

ACCESS_IP_NETWORKS

none

Optional comma separated list of permitted IP networks in CIDR format.

ADMIN_PASSWORD

generated string

Administrative password. Users with this password may manage lab environments for all users.

BOOKBAG_IMAGESTREAM_NAME

none

Image Stream with Bookbag image for lab. If provided then bookbag pods will be created automatically.

BOOKBAG_IMAGESTREAM_NAMESPACE

none

Image Stream namespace for Bookbag image stream. If not provided then deployment namespace will be used.

BOOKBAG_TEMPLATE_NAME

bookbag

Bookbag deployment template. Only used if image stream is provided.

BOOKBAG_TEMPLATE_NAMESPACE

openshift

Bookbag deployment template namespace.

CATALOG_TEMPLATE_NAME

none

Babylon AgnosticV catalog item template name to provision for users. If not provided then lab environment data must be provided manually.

CATALOG_TEMPLATE_NAMESPACE

`openshift'

Babylon AgnosticV catalog item template namespace.

CATALOG_TEMPLATE_PARAMETERS

{}

Parameters to pass to template when creating user lab environments. Provide parameters as a JSON or YAML dictionary.

CATALOG_TEMPLATE_QUOTA

5

Limit applied to number of catalog items that can be provisioned through the UI.

HOSTNAME

none

Hostname for events ui route. Route hostname will be generated if not provided.

OPERATOR_IMAGE

quay.io/redhat-cop/babylon-events-console-operator:latest

Image for babylon events operator.

OPERATOR_IMAGE_PULL_POLICY

IfNotPresent

OPERATOR_CPU_LIMIT

500m

Operator container cpu limit.

OPERATOR_MEMORY_LIMIT

1500Mi

Operator container memory limit.

OPERATOR_CPU_REQUESTS

100m

Operator container cpu request.

OPERATOR_MEMORY_REQUESTS

1500Mi

Operator container memory request.

UI_IMAGE

quay.io/redhat-cop/babylon-events-console:latest

UI_IMAGE_PULL_POLICY

IfNotPresent

UI_CPU_LIMIT

500m

UI container cpu limit.

UI_MEMORY_LIMIT

512Mi

UI container memory limit.

REDIS_IMAGE

registry.redhat.io/rhscl/redis-32-rhel7:latest

Image for Redis database used for UI session tracking.

REDIS_PASSWORD

generated string

Password for the Redis database. Care should be taken to explictly provide the redis password if reapplying template to avoid changing this value.

REDIS_CPU_LIMIT

500m

Redis container cpu limit.

REDIS_MEMORY_LIMIT

512Mi

Redis container memory limit.

REDIS_VOLUME_CAPACITY

1Gi

Volume space available for session data, e.g. 512Mi, 2Gi.

LAB_ENV_PREASSIGNMENT

false

Whether lab environments are pre-assigned, disabling dynamic assignment. Value must be "true" or "false"

LAB_START_TIME

none

Datetime string in iso8601 format for lab start time.

These are the primary parameters for using the template. Additional parameters for advanced usage are available and documented within the template.

To deploy the Babylon events console from the command line:

oc process --local -f deploy-template.yaml \
  -p NAME="babylon-events" \
  -p CATALOG_TEMPLATE_NAMESPACE="gpte" \
  -p CATALOG_TEMPLATE_NAME="tests.babylon-empty-config.dev" \
  -p ACCESS_PASSWORD="MySecret" \
  -p ADMIN_PASSWORD="AdminSecret" \
  -p LAB_ENV_PREASSIGNMENT="true" \
  -p LAB_START_TIME="2020-04-21T00:00:00Z" \
| oc apply -f -

+ NOTE: You should pass ADMIN_PASSWORD and REDIS_PASSWORD parameters if deploying repeatedly to avoid the auto-generation of values from the template defaults.

Once deployed, get the route hostname for the lab console. The same hostname should be provided to each student.

oc get route babylon-events-console -o custom-columns=HOST:{.spec.host}

If you deployed the console without an access password then you should keep this hostname secret until it is time for the start of the lab. A separate lab console in a separate namespace should be used for each lab session.

Building the Events Console

  1. Use the ocp4-disconnected-lab namespace.

    oc project ocp4-disconnected-lab
  2. Create events console build configuration

    oc process --local -f build-template.yaml | oc apply -f -
  3. Build events ui image

    oc start-build babylon-events-ui --from-dir=. -F
  4. Build events operator image

    oc start-build babylon-events-operator --from-dir=. -F
  5. Deploy events console from build image.

    OPERATOR_IMAGE=$(oc get imagestream babylon-events-operator -o jsonpath='{.status.tags[?(@.tag=="latest")].items[0].dockerImageReference}')
    UI_IMAGE=$(oc get imagestream babylon-events-ui -o jsonpath='{.status.tags[?(@.tag=="latest")].items[0].dockerImageReference}')
    oc process --local -f deploy-template.yaml \
      -p NAME="babylon-events" \
      -p BOOKBAG_IMAGESTREAM_NAME="bookbag" \
      -p CATALOG_TEMPLATE_NAMESPACE="gpte" \
      -p CATALOG_TEMPLATE_NAME="tests.babylon-empty-config.dev" \
      -p ADMIN_PASSWORD="r3dh4t1!" \
      -p REDIS_PASSWORD="r3d1sS3cr3t" \
      -p OPERATOR_IMAGE="${OPERATOR_IMAGE}" \
      -p UI_IMAGE="${UI_IMAGE}" \
      -p LAB_ENV_PREASSIGNMENT="true" \
      -p LAB_START_TIME="2020-04-23T00:00:00Z" \
    | oc apply -f -
    Note
    You should pass ADMIN_PASSWORD and REDIS_PASSWORD parameters if deploying repeatedly to avoid the auto-generation of values from the template defaults.

About

A simple console for running labs on Babylon infrastructure for events such as Red Hat Summit.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published