-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sbt-paradox docs #139
Merged
Merged
Add sbt-paradox docs #139
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
-XX:+IgnoreUnrecognizedVMOptions | ||
--add-opens java.base/java.lang=ALL-UNNAMED | ||
--illegal-access=permit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Application | ||
|
||
Guardian also becomes packaged as various application/s that lets you run it using a CLI interface. Currently, the | ||
binaries provided are | ||
|
||
* restore: A continuously running binary that performs the restore operation. | ||
* backup: A binary which when executed allows you to restore an existing backup. | ||
|
||
The CLI follows POSIX guidelines which means you can use `--help` as an argument to provide information on all of the | ||
parameters. | ||
|
||
## Package formats | ||
|
||
Guardian is currently packaged using [sbt-native-packager](https://github.com/sbt/sbt-native-packager) to provide the | ||
following formats by using the sbt shell. | ||
|
||
* `rpm` | ||
* restore: `cliRestore/rpm:packageBin`. Created `rpm` file will be contained | ||
in `cli-restore/target/rpm/RPMS/noarch/` | ||
* backup: `cliBackup/rpm:packageBin`. Created `rpm` file will be contained in `cli-backup/target/rpm/RPMS/noarch/` | ||
NOTE: In order to build packages you need to have the [rpm-tools](https://rpm.org/) (specifically `rpmbuild`) | ||
installed and available on `PATH`. Please consult your Linux distribution for more info | ||
* `zip` | ||
* restore: `cliRestore/universal:packageBin`. Created `zip` file will be contained | ||
in `cli-restore/target/universal/` | ||
* backup: `cliBackup/universal:packageBin`. Created `zip` file will be contained in `cli-backup/target/universal/` | ||
* `tar` | ||
* restore: `cliRestore/universal:packageZipTarball`. Created `tar` file will be contained | ||
in `cli-restore/target/universal/` | ||
* backup: `cliBackup/universal:packageZipTarball`. Created `tar` file will be contained | ||
in `cli-backup/target/universal/` | ||
* `Xz` | ||
* restore: `cliRestore/universal:packageXzTarball`. Created `xz` file will be contained | ||
in `cli-restore/target/universal/` | ||
* backup: `cliBackup/universal:packageXzTarball`. Created `xz` file will be contained | ||
in `cli-backup/target/universal/` | ||
|
||
Note that for these packages formats you need to have JRE installed on your system to run the package. For more details | ||
about packaging read the [docs](https://sbt-native-packager.readthedocs.io/en/latest/) | ||
|
||
## Design | ||
|
||
Each application is contained within a corresponding sbt submodule, i.e. the application for `backup` is contained | ||
within the `cli-backup` sbt submodule. The `core-cli` sbt submodule contains common cli arguments (i.e. `kafka-topics`). | ||
|
||
Scala packaging has been disabled for these submodules which means that when publishing/packaging Guardian it won't push | ||
any built `.jar` files. This is because its unnecessary since you are meant to run these applications as a binary and | ||
not include it as a library. By the same token this also means that the cli modules are built with global inlining | ||
using `"-opt-inline-from:**"`, see [here](https://www.lightbend.com/blog/scala-inliner-optimizer) for more info. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Configuration | ||
|
||
## Reference | ||
|
||
@@snip (/core-backup/src/main/resources/reference.conf) | ||
|
||
Scala API doc @apidoc[kafka.backup.configs.Backup] | ||
|
||
## Explanation | ||
|
||
* `kafka-group-id`: The group id for the Kafka consumer that's used in restore tool | ||
* `time-configuration`: How to slice the persisted keys/files based by time | ||
* `type`: The type of time configuration. Either `period-from-first` or `chrono-unit-slice` | ||
* `period-from-first`: Guardian will split up the backup keys/files determined by the `duration` specified. The | ||
key/filename will be determined by the timestamp of the first message received from the Kafka consumer with | ||
each further key/filename being incremented by the configured `duration`. If guardian is shut down then it | ||
will terminate and complete stream with the final element in the JSON array being a `null` | ||
* This is done so it's possible to determine if a backup has been terminated by shut down of Guardian and | ||
also because it's not really possible to resume using arbitrary durations. | ||
* `chrono-unit-slice`: Guardian will split up the backup keys/files determined by the `chrono-unit` which | ||
represent intervals such as days and weeks. As such when using this setting its possible for Guardian to | ||
resume from a previous uncompleted backup. | ||
* `duration`: If configuration is `period-from-first` then this determines max period of time for each time slice. | ||
* `chrono-unit`: if configuration is `chrono-unit-slice` the `chrono-unit` determines |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do you need
-XX:+IgnoreUnrecognizedVMOptions
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that file some options only apply to specific versions of JVM and by default if you pass an option into the JVM that doesn't exist it will immediately terminate.
--illegal-access=permit
only works on JVM 16 and--add-opens java.base/java.lang=ALL-UNNAMED
only works on JVM 17There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be we could do better?
Why I am concerned: we should not silence invalid JVM command line options / flags, the users should be aware of any mismatches here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought of this originally but the issue here is the typical way/s that SBT is used. For example a lot of people (myself included) use Intellij's SBT integration when working with Scala projects. When using sbt like this the only possible way to pass JVM arguments is with
.jvmopts
since Intellij behind the scenes uses the sbt directly via a jar for its integration. The same applies to the official sbt launcher script which is included when you install sbt via your operating systems package manager (homebrew, apt, pacman etc etc).Ideally sbt should have support for dynamically supporting different JVM options depending the JVM option but this doesn't exist yet. Note the complication here is that the JVM args are designed for the build tool, not the runtime of the project that gets compiled. Its trivial for SBT to support different JVM arguments when you run tests/programs compiled by SBT (sbt supports forking the JVM with different JVM args when running tests) but in this case the JVM arguments are actually needed for the build tool itself (the document generation is done via a SBT plugin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 all set!