Skip to content

Setup for Access Management for Starburst Trino

Configure

Perform following steps to configure Starburst Trino plugin:

  1. SSH into the instance where Privacera Manager is installed.

  2. Run the following command to navigate to the /config directory and copy yml files:

    Bash
    cd ~/privacera/privacera-manager/config
    cp sample-vars/vars.trino.opensource.yml custom-vars/vars.trino.opensource.yml
    

  3. Modify the following properties:
    • In the vars.trino.opensource.yml file, update the following properties with the appropriate values:
      Bash
      1
      2
      3
      TRINO_USER_HOME: "<PLEASE_CHANGE>"
      TRINO_INSTALL_DIR_NAME: "<PLEASE_CHANGE>"
      TRINO_CONFIG_DIR: "/etc/starburst"
      
  4. After configuring the properties, start the connector by executing the following instructions:

    Step 1 - Setup which generates the helm charts. This step usually takes few minutes.

    Bash
    cd ~/privacera/privacera-manager
    ./privacera-manager.sh setup
    
    Step 2 - Apply the Privacera Manager helm charts.
    Bash
    cd ~/privacera/privacera-manager
    ./pm_with_helm.sh upgrade
    
    Step 3 - Post-installation step which generates Plugin tar ball, updates Route 53 DNS and so on.

    Bash
    cd ~/privacera/privacera-manager
    ./privacera-manager.sh post-install
    

Copy Privacera Trino Plugin configuration files

  1. Run the following command to copy required configuration files:

    Bash
    1
    2
    3
    4
    5
    mkdir ~/privacera-starburst-trino-plugin
    cd ~/privacera-starburst-trino-plugin
    
    cp ~/privacera/privacera-manager/output/trino-opensource/privacera_trino_setup.sh ~/privacera-starburst-trino-plugin/
    cp ~/privacera/privacera-manager/output/trino-opensource/privacera_trino_plugin_conf.zip ~/privacera-starburst-trino-plugin/
    

  2. Edit privacera_trino_setup.sh file to comment out wget and add curl command as shown below:

    Bash
    1
    2
    3
    #wget ${PRIVACERA_BASE_DOWNLOAD_URL}/${PRIVACERA_PKG_NAME} -O ${PRIVACERA_PKG_NAME}
    
    curl ${PRIVACERA_BASE_DOWNLOAD_URL}/${PRIVACERA_PKG_NAME} -o ${PRIVACERA_PKG_NAME}
    

Create entrypoint.sh script

  • Run the following command to create and edit entrypoint.sh file:

    Bash
    cd ~/privacera-starburst-trino-plugin
    vi entrypoint.sh
    

  • Add the following content in the entrypoint.sh file:

    Bash
    #!/bin/bash
    set -eo pipefail
    set -x
    
    STARBURST_CONFIG_FILE="/etc/starburst/config.properties"
    
    # Check if the file exists
    if [ ! -e "$STARBURST_CONFIG_FILE" ]; then
        echo "File not found: $STARBURST_CONFIG_FILE"
        exit 1
    fi
    
    cd /home/starburst/
    
    # Check if the coordinator node and install the plugin
    if grep -q "^coordinator=true$" "$STARBURST_CONFIG_FILE"; then
        echo "It is a coordinator node, Installing trino plugin"
        ./privacera_trino_setup.sh
    fi
    
    # Start the trino server
    /usr/lib/starburst/bin/run-starburst
    
    set -- tail -f /dev/null
    exec "$@"
    

Create Dockerfile

Create the file in the same directory as the entrypoint.sh script.

  • Run the following command to create and edit the Dockerfile:

    Bash
    1
    2
    3
    cd ~/privacera-starburst-trino-plugin
    
    vi Dockerfile
    

  • Add the following content in the Dockerfile:

    Bash
    # Define starburst version
    ARG SB_TRINO_VERSION=<SB_TRINO_VERSION>
    
    # Use a base image to install necessary packages
    FROM registry.access.redhat.com/ubi9/ubi AS downloader
    
    # Install the necessary packages
    RUN dnf install -y zip findutils
    
    # starburst image
    FROM harbor.starburstdata.net/starburstdata/starburst-enterprise:${SB_TRINO_VERSION}-e
    
    # Switch to root user to install packages
    USER root
    
    ## curl
    COPY --from=downloader /usr/bin/curl /usr/bin/
    COPY --from=downloader /usr/lib64/ /usr/lib64/
    COPY --from=downloader /etc/pki/tls/certs/ca-bundle.trust.crt /etc/pki/tls/certs/
    COPY --from=downloader /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/
    RUN curl --version
    
    ## zip
    COPY --from=downloader /usr/bin/zip /usr/bin/
    RUN zip --version
    
    ## unzip
    COPY --from=downloader /usr/bin/unzip /usr/bin/
    RUN unzip
    
    ## gzip
    COPY --from=downloader /usr/bin/gzip /usr/bin/
    RUN gzip --version
    
    ## findutils
    COPY --from=downloader /usr/bin/find /usr/bin/
    COPY --from=downloader /usr/bin/xargs /usr/bin/
    RUN find --version
    
    ## sed
    COPY --from=downloader /usr/bin/sed /usr/bin/
    RUN sed --version
    
    ## grep
    COPY --from=downloader /usr/bin/grep /usr/bin/
    RUN grep --version
    
    ## awk
    COPY --from=downloader /usr/bin/awk /usr/bin/
    RUN awk --version
    
    RUN mkdir -p /var/log/trino/ && chown -R starburst:root /var/log/trino/
    
    RUN mkdir -p /home/starburst/
    
    # Copy Privacera Trino Plugin configuration and setup script
    COPY privacera_trino_setup.sh /home/starburst/
    COPY privacera_trino_plugin_conf.zip /home/starburst/
    
    # Set permissions and ownership
    RUN chown starburst:root -R /home/starburst/privacera_trino_setup.sh
    RUN chown starburst:root -R /home/starburst/privacera_trino_plugin_conf.zip
    
    RUN mkdir -p /etc/ranger 
    RUN chown -R starburst:root /etc/ranger 
    
    # Create entrypoint directory
    RUN mkdir /entrypoint
    
    # Copy the entrypoint script
    COPY entrypoint.sh /entrypoint
    
    # Set execute permissions for the entrypoint script
    RUN chmod +x /entrypoint/entrypoint.sh
    
    # Set the entrypoint
    ENTRYPOINT ["/entrypoint/entrypoint.sh"]
    
    USER starburst:root
    

Build the Docker image

  • Run the following command to build the Docker image:
    Bash
    docker build -t privacera-starburst-trino:latest .
    

Push the Docker image to the remote HUB

  • Please use your internal HUB to publish the image.

Create a namespace

  • Run the following command to create a namespace.
    Bash
    kubectl create namespace <STARBURST_TRINO_NAMESPACE>
    

Create docker image secret:

  • To create an image secret, please use and run the command according to your requirements.

Create Starburst License Secret

  • Create a file containing Starburst license details, add the license key and save the file.
    Bash
    cd ~/privacera-starburst-trino-plugin
    vi starburstdata.license
    

Create .yaml deployment file to override the default values

  • Run the following command to create and edit the values.yaml file:

    Bash
    cd ~/privacera-trino-plugin
    vi values.yaml
    

  • Add the following content in the values.yaml file:

    Bash
    image:
        repository: <STARBURST_TRINO_IMAGE_REPOSITORY>
        pullPolicy: Always
        # Overrides the image tag whose default is the chart version.
        # Same value as Chart.yaml#appVersion
        tag: <STARBURST_TRINO_IMAGE_TAG>
    
    
    # Optional
    imagePullSecrets:
    - name: <STARBURST_TRINO_IMAGE_PULL_SECRET_NAME>
    
    #license
    starburstPlatformLicense: starburstlicense
    
    worker:
      replicas: 1
    

Install Starburst Trino on kubernetes cluster

  1. Upgrade an existing Helm release or install it if not present using the chart, version, and values file.
    Bash
    1
    2
    3
    4
    5
    helm upgrade my-sep oci://harbor.starburstdata.net/starburstdata/charts/starburst-enterprise \
    --version <SBT_VERSION_TAG> \
    --install \
    --values ./values.yaml \
    --namespace ${MY_NS}
    

Comments