Skip to content

[ZEPPELIN-4619] Run a note from the commandline#3654

Closed
Leemoonsoo wants to merge 5 commits intoapache:masterfrom
Leemoonsoo:ZEPPELIN-4619
Closed

[ZEPPELIN-4619] Run a note from the commandline#3654
Leemoonsoo wants to merge 5 commits intoapache:masterfrom
Leemoonsoo:ZEPPELIN-4619

Conversation

@Leemoonsoo
Copy link
Copy Markdown
Member

What is this PR for?

This PR adds a command-line option to run a single note.
The code is pickled from #3356.

Usage is

bin/zeppelin.sh --run <noteId>

The command will launch a Zeppelin server and run a given note, and terminate on after all paragraph's successful run (with exit 0) or terminate on any paragraph error (with exit 1).

What type of PR is it?

Feature

What is the Jira issue?

https://issues.apache.org/jira/browse/ZEPPELIN-4619

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

}

private static void runNoteOnStart(ZeppelinConfiguration conf) throws IOException, InterruptedException {
String noteIdToRun = conf.getNotebookRunId();
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.

It's better to add logging here to show zeppelin server is running note after started.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Log message added.

}
}

public boolean runNote(String noteId,
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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I modified existing runAllParagraphs to return boolean value depends (that will be translated to exit value of the commandline). And added overloaded method to make it run without providing paragraph data. What do you think?

);
}

public boolean runAllParagraphs(String noteId,
Copy link
Copy Markdown
Contributor

@zjffdu zjffdu Feb 20, 2020

Choose a reason for hiding this comment

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

How about using the existing runAllParagraphs, and check whether paragraphs is empty, then use the paragraph in backend, otherwise use the paragraphs from frontend.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Addressed the comment. Please take a look updated code.

@zjffdu
Copy link
Copy Markdown
Contributor

zjffdu commented Feb 28, 2020

Thanks @Leemoonsoo LGTM

@Leemoonsoo
Copy link
Copy Markdown
Member Author

I removed a useless test. Thanks, @zjffdu for the review. I'll merge to master.

@asfgit asfgit closed this in 7c7d51a Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants