Skip to content

[Website] Add new Java quickstart - #22747

Merged
damccorm merged 6 commits into
apache:masterfrom
VeronicaWasson:java-quickstart
Oct 3, 2022
Merged

damccorm merged 6 commits into
apache:masterfrom
VeronicaWasson:java-quickstart

Conversation

@VeronicaWasson

Copy link
Copy Markdown
Contributor

Adds a new quickstart for Java based on https://github.com/apache/beam-starter-java

This PR keeps the the original Java quickstart but renames it to "WordCount sample for Java"


To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI.

@VeronicaWasson

VeronicaWasson commented Aug 16, 2022 •

Copy link
Copy Markdown
Contributor Author

R: @davidcavazos

@VeronicaWasson

VeronicaWasson commented Aug 16, 2022 •

Copy link
Copy Markdown
Contributor Author

R: @kennknowles

@VeronicaWasson VeronicaWasson changed the title [WebSite] Add new Java quickstart [Website] Add new Java quickstart Aug 16, 2022
@davidcavazos

davidcavazos commented Aug 22, 2022 •

Copy link
Copy Markdown

It looks like the linter found some trailing spaces (spaces or tabs after the last non-space character in a line).

21:27:08 Running whitespacelint...
21:27:29 ./website/www/site/content/en/get-started/quickstart/java.md:87:54: W201 Trailing whitespace
21:27:41 ====================================================================================================
21:27:41 Whitespacelint has found above issues.
21:27:41 You can open the file with vim and remove trailing whitespaces by:
21:27:41 vim -es -c ":%s/\s\+$//e" -c ":wq" "./website/www/site/content/en/get-started/quickstart/java.md"
21:27:41 ====================================================================================================

It appears there are only trailing spaces in line 87.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Let's remove Java 8 since it's already end of life, so it's no longer supported.

https://endoflife.date/java

@kennknowles do you know if Beam already supports Java 17? From the docs it looks like it's not supported yet.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I personally use sdkman to install Java, it's a lot easier it install and it allows you to choose which vendor's SDK to install.

https://sdkman.io/

I believe their default choice is the Temurin flavor (not Oracle) since it's open source and production ready.

https://sdkman.io/jdks#tem

I would personally recommend this route since it's faster, easier, and the installation cannot go wrong.

# Install sdkman.
curl -s "https://get.sdkman.io" | bash

# Install Java 11.
sdk install java 11.0.12-tem

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I copied this section from our existing quickstart.

Qs:

  • Is it better to be agnostic about how customers install the JDK and Gradle/Maven? My assumption was anyone using Java already has a preference. OTOH your approach gives customers definite steps to follow.
  • If we show sdkman, will we have to keep the version # up-to-date?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I've gone through the manual installs and they're all pretty bad. The instructions are not consistent and it's easy to get something wrong (like not setting JAVA_HOME). Maven specifically has pretty bad documentation on how to install, Gradle isn't as bad.

I think it's best to give an opinionated approach to install them, especially since it's so much easier. We don't have to worry about keeping versions up to date, sdkman takes care of that. The only thing we have to make sure is that people install a compatible Java version (which I think it's currently only Java 11?).

If they're already using Java and already have a Java development environment set up, they can safely skip those steps. They're there mostly for people who don't have it ready. We can say something like "If you don't have Java installed, a simple way to install it is with sdkman", or something along those lines. What do you think?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. I rewrote this section to use sdkman. (It's definitely simpler!)

@davidcavazos

Copy link
Copy Markdown

Overall it's looking great! I made some questions and minor comments, but other than that it looks great! Thank you!

@pcoet pcoet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks great! Just left a few optional suggestions LGTM.

@davidcavazos davidcavazos left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This looks great! Thank you! 😊

@VeronicaWasson

Copy link
Copy Markdown
Contributor Author

R: @lukecwik

@github-actions

Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control

@kennknowles kennknowles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Checked out http://apache-beam-website-pull-requests.storage.googleapis.com/22747/index.html and it looks pretty good. Just two minor formatting things.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These highlight blocks have newlines before and after the listing making it look funny. Can they be removed?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe changing them to backtick blocks ``` would help? Maybe the {{< highlight >}} tag includes the newlines kind of like how <code> tags in HTML work?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

If you mean in the rendered page, that seems to be the built-in styling (e.g. compare https://beam.apache.org/get-started/quickstart-java/#get-the-example-code)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looking at the staged page
it looks like the backtick blocks ``` do remove the extra spaces, but the "copy contents" button at the top right disappear.

I don't think it's a big deal having the extra spaces. One thing to try could be having everything in the same line, but that would make the markdown a lot uglier.

-- Instead of
{{< highlight >}}
code here
{{< highlight >}}

-- Would be something like this
{{< highlight >}}code here{{< highlight >}}

I suspect it might be parsing the tags like HTML tags. That could be a workaround but it could be pretty ugly. I'm okay with having the extra spaces and having cleaner code. What are your thoughts on it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

my $0.02: The existing docs also render like this, and use the same markup, so I'd vote to keep it this way for consistency. (Seems like an issue with the highlight.html shortcode rather than the markup in the doc.)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yeah, no problem. Sounds good to me.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@davidcavazos Is there anything else needed on this PR or is it OK to merge?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think it's good to merge. This is great, thank you!

@davidcavazos

Copy link
Copy Markdown

Hi @kennknowles, this PR seems to be either ready to merge or very close. Are there any other comments on your side or are we good to merge? Thanks!

@kennknowles kennknowles left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Needs to resolve conflicts then g2g

@VeronicaWasson

Copy link
Copy Markdown
Contributor Author

Needs to resolve conflicts

Done!

@pcoet

pcoet commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

@pabloem @damccorm Can one of you help us merge this? We were waiting on approval from @kennknowles, and he signed off. @VeronicaWasson just fixed the outstanding merge conflict. Thanks!

@damccorm
damccorm merged commit d28a93e into apache:master Oct 3, 2022
@pcoet

pcoet commented Oct 3, 2022

Copy link
Copy Markdown
Contributor

Thanks @damccorm! And thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants