Skip to content

[WTD 2021] Quickstart for Trino with Docker#7744

Closed
erikhopf wants to merge 4 commits intotrinodb:masterfrom
erikhopf:try-it-wtd2021
Closed

[WTD 2021] Quickstart for Trino with Docker#7744
erikhopf wants to merge 4 commits intotrinodb:masterfrom
erikhopf:try-it-wtd2021

Conversation

@erikhopf
Copy link

[Part of WTD Writing Day]

Issue/Work Item: #7743

Thoughts:

  • A guide to quickly kick the tires and run Trino before getting deep into the current installation guide would have helped me out, and I think its an easy value add.
  • I would place this above installation and let folks skip it if it doesn't apply.

Open items:

  • Need to fix linking. The initial PR is using the fully qualified URL: https://....
  • Title - Would love feedback here, but some thoughts:
    • "Quickstart"
    • "Try Trino with Docker"
    • "Get started with Docker"
  • To get this up into a reviewable state, I threw it into a converter. If I need to update the code block syntax, let me know and I can tweak this pretty quickly.

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Erik Hopf.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@mosabua mosabua added the docs label Apr 25, 2021
@cla-bot
Copy link

cla-bot bot commented Apr 25, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Erik Hopf.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@mosabua
Copy link
Member

mosabua commented Apr 25, 2021

If you get a chance to hop on for Writing Day again, we should chat there.. otherwise I will review/chime directly here after writing day. Excellent start in either case!

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Erik Hopf.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@mosabua mosabua added the WIP label Apr 25, 2021
@martint
Copy link
Member

martint commented Apr 25, 2021

@cla-bot check

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Erik Hopf.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot
Copy link

cla-bot bot commented Apr 25, 2021

The cla-bot has been summoned, and re-checked this pull request!

@erikhopf
Copy link
Author

@martint - Do I need to close/open to get the automated checks to pass?

Prerequisites
-------------

Trino runs best on Linux. Our Docker container is built on
Copy link
Member

@Ordinant Ordinant Apr 26, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. This page's title promises me a Quickstart for Trino with Docker, so I want to know what Docker runs best on. What Trino runs on in the container is assumed to be ready to run, or it wouldn't be offered as a runnable container. It's true but out of place to say that Trino runs best on Linux. The important point for this page is that you can get it running from any OS starting point.

Rework this paragraph to convey:

  • Our Docker container encapsulates Trino on Linux for 64-bit Intel platforms
  • For evaluation, testing, and quick start purposes, you can run the Trino container on macOS or Windows hosts
  • Run the Trino container only on a Linux host for a production environment

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we call out the distro here? I think it might be a good idea if we can say that the container runs on Ubuntu X.X LTS or Redhat X.X.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a shot at fixing this, but not sure I love it.


.. code-block:: shell

docker run -p 8080:8080 --name trino trinodb/trino
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's please change the handle of the server instance to something other than "trino" to avoid newbie confusion about whether they're addressing the container instance or the CLI or the server:
docker run -p 8080:8080 --name trindock trinodb/trino

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I called it trino-container but if you have strong opinions trindock is fine.

.. code-block:: shell

docker run -p 8080:8080 --name trino trinodb/trino

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A successful docker run just reports a GUID. To see the SERVER STARTED command, you must run docker logs:

"Review the Docker log output continuously to confirm that the server has started:

.. code-block:: text
docker trindock logs
...
docker trindock logs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the success message with the command listed.

Copy link
Member

@Ordinant Ordinant May 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see what's wrong. Fairly standard practice is to have the docker run command have a -d option to run in the background, which returns that terminal for use. Also, the point of the --name argument is to be a handle for the container that is quick to type instead of typing its entire GUID. Using a very long name for this handle defeats the purpose. My "trindock" is a fast 8 chars to type. Thus, line 53 should be:
docker run -d -p 8080:8080 --name trindock trinodb/trino

With this change, you now must use docker logs trindock to see the success message. Try your steps out with these changes, please.

To use these scripts, download the book’s samples from their `GitHub
location <https://github.com/trinodb/presto-the-definitive-guide>`__
either as a zip file or a git clone.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are several steps left out here.

  • Once the zip is downloaded, it must be unzipped locally.
  • If the reader copies the Git URL of the book sample's project, s/he must use a git clone command to get a local copy
  • cd into the tpch directory of the local unzipped or cloned set
  • Replace filename.sql with nations.sql

Only then can the book's sample script work. Otherwise, we might as well just post a short sample.sql on this page for readers to download and run.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Ordinant - For simplicity sake, can we pass in a URI to a SQL script?

Copy link
Member

@Ordinant Ordinant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you immensely for getting this going. You definitely have an eye for how to get newbies up to speed quickly.

I know this looks like I slashed and burned, red pen red sword in hand, but most of the edits are just to align your excellent draft with the Google Style Guide we follow (present tense, no future tense; no "you should") or with our standard word usage.

Thanks!

@erikhopf
Copy link
Author

@Ordinant - Appreciate the comprehensive review. This is what I was looking for after a writing day exercise. Sometimes you don't want to slow down and get stuck on words. Power to the editor haha.

@cla-bot
Copy link

cla-bot bot commented Apr 26, 2021

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Erik Hopf.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@mosabua
Copy link
Member

mosabua commented May 10, 2021

Let me know if/when I should jump in here to help @Ordinant

@colebow
Copy link
Member

colebow commented Nov 30, 2022

👋 @erikhopf - this PR has become inactive. If you're still interested in working on it, please let us know, and we can try to get reviewers to help with that.

We're working on closing out old and inactive PRs, so if you're too busy or this has too many merge conflicts to be worth picking back up, we'll be making another pass to close it out in a few weeks.

@ebyhr
Copy link
Member

ebyhr commented Dec 9, 2022

The documentation for docker was added in #13193. Please feel free to send a new PR if the page needs improvement.

@ebyhr ebyhr closed this Dec 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

8 participants