Perform following steps to configure Trino plugin:
-
SSH into the instance where Privacera Manager is installed.
-
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
|
- Modify the following properties:
- In the
vars.trino.opensource.yml
file, update the following properties with the appropriate values: Bash |
---|
| TRINO_USER_HOME: "<PLEASE_CHANGE>"
TRINO_INSTALL_DIR_NAME: "<PLEASE_CHANGE>"
TRINO_CONFIG_DIR: "/etc/trino"
|
-
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_setup.sh
and privacera_trino_plugin_conf.zip
to the same location as the Dockerfile.
-
Edit privacera_trino_setup.sh
file to comment out wget
and add curl
command as shown below:
Bash |
---|
| #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
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 |
---|
| cd ~/privacera-trino-plugin
vi Dockerfile
|
- Add the following content in the Dockerfile:
Bash |
---|
| # Define Trino version
ARG TRINO_VERSION=<trino_version>
# Use a base image to install necessary packages
FROM registry.access.redhat.com/ubi9/ubi:latest AS downloader
# Install the necessary packages
RUN dnf install -y zip findutils
# Trino base image
FROM trinodb/trino:${TRINO_VERSION}
# Set the user
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
# Copy Privacera Trino Plugin configuration and setup script
COPY privacera_trino_setup.sh /home/trino
COPY privacera_trino_plugin_conf.zip /home/trino
# Set permissions and ownership
RUN chmod +x /home/trino/privacera_trino_setup.sh
RUN chown trino:trino /home/trino/privacera_trino_setup.sh
RUN chown trino:trino /home/trino/privacera_trino_plugin_conf.zip
# Create ranger directory
RUN mkdir -p /etc/ranger
RUN chown -R trino:trino /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"]
# Set the user
USER trino:trino
|
Enable Trino Application
- In PrivaceraCloud, navigate to Settings -> Applications.
- On the Applications screen, select Trino.
- Enter the application Name and Click Save. You can choose any name, for example,
Trino
. - Enable the Access Management option with toggle button.
- Click on Save button.
Create entrypoint.sh script
Create Dockerfile
Create the file in the same location as the entrypoint.sh
script.
- Run the following command to create and edit Dockerfile:
Bash |
---|
| cd ~/privacera-trino-plugin
vi Dockerfile
|
-
To obtain the PCLOUD_PLUGIN_SCRIPT_URL
, log in to PrivaceraCloud and navigate to Settings -> API Keys Click on the info ℹ️ icon, and you will see the option to copy the Plugins Setup Script URL.
-
Add the following content in the Dockerfile:
Bash |
---|
| # Define Trino version
ARG TRINO_VERSION=<trino_version>
# Use a base image to install necessary packages
FROM registry.access.redhat.com/ubi9/ubi:latest AS downloader
# Install the necessary packages
RUN dnf install -y zip findutils wget
# Trino base image
FROM trinodb/trino:${TRINO_VERSION}
# Set the user
USER root
## Declare required environment variables
ENV PLUGIN_TYPE="trino"
ENV TRINO_HOME_FOLDER=/usr/lib/trino
ENV TRINO_CONFIG_DIR=/etc/trino
## URL to download the Privacera Trino Plugin setup script.
ENV PCLOUD_PLUGIN_SCRIPT_URL="<PCLOUD_PLUGIN_SCRIPT_URL>"
## 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
## wget
COPY --from=downloader /usr/bin/wget /usr/bin/
RUN wget --version
## Download Privacera Trino Plugin setup script
RUN wget ${PCLOUD_PLUGIN_SCRIPT_URL} -O /home/trino/privacera_plugin.sh
# Set permissions and ownership
RUN chmod +x /home/trino/privacera_plugin.sh
RUN chown trino:trino /home/trino/privacera_plugin.sh
# Create ranger directory
RUN mkdir -p /etc/ranger
RUN chown -R trino:trino /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"]
# Set the user
USER trino:trino
|