Running a script to install local object storage buckets and create data connections

For convenience, we are providing a script that will:

  • create a minio instance in your project

  • create 2 buckets in that minio instance

  • generate a random user id and password for your minio instance

  • create 2 Data Connections in your data science project

    • one for each bucket

    • both using the same credentials

This script is based on a quick tutorial for installing Minio (available here).
In addition it will install some necessary network policies for service mesh functionality.

Prerequisite

You must know the OpenShift resource name for your data science project so that you run the provided script in the correct project.
To get the project’s resource name:

  • In the OpenShift AI dashboard,

  • select Data Science Projects

  • click the ? icon next to the project name

  • A text box appears with information about the project, including its resource name:

    Project list resource name
  • Make sure to note that resource name

Procedure

  1. In the OpenShift AI dashboard, click the application launcher icon and then select the OpenShift Console option.

    OpenShift Console Link
  2. In the OpenShift console, click + in the top navigation bar.

    Add resources Icon
  3. Select your project from the list of projects.

    Select a project
  4. Verify that you selected the correct project. (In the next step you will import the YAML)

    Selected project
  5. Copy the following code and paste it into the Import YAML editor.

    ---
    apiVersion: v1
    kind: ServiceAccount
    metadata:
      name: demo-setup
    ---
    apiVersion: rbac.authorization.k8s.io/v1
    kind: RoleBinding
    metadata:
      name: demo-setup-edit
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: ClusterRole
      name: edit
    subjects:
      - kind: ServiceAccount
        name: demo-setup
    ---
    apiVersion: batch/v1
    kind: Job
    metadata:
      name: create-s3-storage
    spec:
      selector: {}
      template:
        spec:
          containers:
            - args:
                - -ec
                - |-
                  echo -n 'Setting up Minio instance and data connections'
                  oc apply -f https://raw.githubusercontent.com/rh-aiservices-bu/test-drive/main/setup/setup-s3-no-sa.yaml
              command:
                - /bin/bash
              image: image-registry.openshift-image-registry.svc:5000/openshift/tools:latest
              imagePullPolicy: IfNotPresent
              name: create-s3-storage
          restartPolicy: Never
          serviceAccount: demo-setup
          serviceAccountName: demo-setup
  6. Click Create.

Verification

You should see a "Resources successfully created" message and the following resources listed:

  • demo-setup

  • demo-setup-edit

  • create s3-storage