yurishkuro / opentracing-tutorial

A collection of tutorials for the OpenTracing API
Apache License 2.0
1.57k stars 407 forks source link

Changed the code and steps to fit also in Katacoda's context #12

Closed jpkrohling closed 6 years ago

jpkrohling commented 6 years ago

Added small changes in order to get it better suitable for Katacoda.

Signed-off-by: Juraci Paixão Kröhling juraci@kroehling.de

jpkrohling commented 6 years ago

When doing the Katacoda scenarios, I found the following changes to greatly help the user to follow the steps. A controversial point is around the imports and "seed" files: there are unused imports in a lot of places, but those are mostly to help the user to just copy/paste relevant code. And I added seed files, so that they would just show up nicely on Katacoda. Those seed files at the "exercise" package of a lesson is usually a "solution" from the previous lesson.

This is currently WIP, but I wanted to get a first run "soon", to make sure those changes would be accepted.

jpkrohling commented 6 years ago

By the way: we might need to work on the wording. @JStickler could help us here (or point us to someone who can help)

yurishkuro commented 6 years ago

I'm not sure about including (almost) fully fleshed files under /exercise/, that seems to defeat the purpose of having people to code that stuff.

jpkrohling commented 6 years ago

I'm not sure about including (almost) fully fleshed files under /exercise/, that seems to defeat the purpose of having people to code that stuff.

I think I agree with you, I'm not sure the seed files should be that complete. But do take a look at the scenarios and see if having those help more than hurt (those are WIP as well!):

https://www.katacoda.com/jpkroehling/scenarios/opentracing-tutorial-lesson01

Note that each lesson is a scenario.

yurishkuro commented 6 years ago

https://www.katacoda.com/jpkroehling/scenarios/opentracing-tutorial-lesson01

seems like there's a bit of learning curve for katacoda. E.g. the text says "let's create lesson01/exercise/Hello.java", but it's not clear in which dir. The editor shows existing opentracing-tutorial, but the pwd in console is /home/scrapbook/tutorial

Regarding the seed files, katacoda has a handy "copy to editor" button

jpkrohling commented 6 years ago

I'm still working on the scenario, there are a few rough edges to smoothen. The idea is to have the editors open already, and the user would just need to click on "Copy to the editor" for the seed, and "Copy" on the snippets we provide.

jpkrohling commented 6 years ago

I just updated this PR, having the seed files similar to the current seed files or as empty classes. If this looks good as it is, I'd like to get it merged. There are a couple of issues I'm experiencing with Katacoda, but I would like to get a draft version of it out "soon". As of now, the Katacoda scenarios are using this branch, fetched from my fork of this repo.

jpkrohling commented 6 years ago

By the way: the lesson 4 only shows changes to the Formatter and Hello. Should the other classes in lesson04.exercise be filled by the user, or should the seed be equal to the solution?

If the seed is empty, the Katacoda scenario will have to show the full source code for them, even though they aren't mentioned anywhere in the lesson.

yurishkuro commented 6 years ago

Should the other classes in lesson04.exercise be filled by the user, or should the seed be equal to the solution?

the readme instructs the user to copy the solution from L3 into L4/exercise

cp src/main/java/lesson03/solution/*java src/main/java/lesson04/solution

(btw there is a typo, the target should be lesson04/exercise)

The alternative is to do that copy ourselves and check the files in.

jpkrohling commented 6 years ago

The alternative is to do that copy ourselves and check the files in.

All the files, or just the ones we don't expect the user to change?

yurishkuro commented 6 years ago

the original tutorial copied all the files.

jpkrohling commented 6 years ago

the original tutorial copied all the files.

I copied only the files that won't be changed, as I tend to agree with your first comment on this PR.

jpkrohling commented 6 years ago

The last commit is to get rid of mvn exec:java, which was really requiring far more memory than required (8G on my machine). Without it, I could get the lesson 3 to work on Katacoda.

image

jpkrohling commented 6 years ago

I applied the changes and tested the solution for lesson 4 as if it's the exercise, and it works for me. I'll merge it and watch the issues, just in case I missed something.

Would be nice if someone not "addicted" to this code to try this out, though.

PikBot commented 6 years ago

@jpkrohling I tried testing the code by following the tutorial locally. Getting the following error:

Error: Main method not found in class lesson01.exercise.Hello, please define the main method as:
   public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

What could be the reason for this?

jpkrohling commented 6 years ago

Just pinged you on Gitter, as it's easier to troubleshoot there.