Skip to content
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

Drop requirement to provide marquez.yml for seed cmd #2094

Merged
merged 2 commits into from
Aug 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions api/src/main/java/marquez/cli/SeedCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import com.fasterxml.jackson.core.type.TypeReference;
import com.google.common.collect.ImmutableList;
import io.dropwizard.cli.ConfiguredCommand;
import io.dropwizard.cli.Command;
import io.dropwizard.setup.Bootstrap;
import io.openlineage.client.OpenLineage;
import io.openlineage.client.OpenLineageClient;
Expand All @@ -18,7 +18,6 @@
import lombok.NonNull;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import marquez.MarquezConfig;
import net.sourceforge.argparse4j.inf.Namespace;
import net.sourceforge.argparse4j.inf.Subparser;

Expand All @@ -37,7 +36,7 @@
* For example, to override the {@code url}:
*
* <pre>{@code
* java -jar marquez-api.jar seed --url http://localhost:5000 --metadata metadata.json marquez.yml
* java -jar marquez-api.jar seed --url http://localhost:5000 --metadata metadata.json
* }</pre>
*
* <p>where, {@code metadata.json} contains metadata for run {@code
Expand Down Expand Up @@ -93,7 +92,7 @@
* <p><b>Note:</b> The {@code seed} command requires a running instance of Marquez.
*/
@Slf4j
public final class SeedCommand extends ConfiguredCommand<MarquezConfig> {
public final class SeedCommand extends Command {
/* Default URL for HTTP backend. */
private static final String DEFAULT_OL_URL = "http://localhost:8080";

Expand All @@ -109,7 +108,6 @@ public SeedCommand() {
/* Configure seed command. */
@Override
public void configure(@NonNull final Subparser subparser) {
super.configure(subparser);
subparser
.addArgument("--url")
.dest("url")
Expand All @@ -126,10 +124,7 @@ public void configure(@NonNull final Subparser subparser) {
}

@Override
protected void run(
@NonNull Bootstrap<MarquezConfig> bootstrap,
@NonNull Namespace namespace,
@NonNull MarquezConfig config) {
public void run(@NonNull Bootstrap<?> bootstrap, @NonNull Namespace namespace) {
final String olUrl = namespace.getString(CMD_ARG_OL_URL);
final String olMetadata = namespace.getString(CMD_ARG_OL_METADATA);
// Use HTTP transport.
Expand Down
7 changes: 1 addition & 6 deletions docker/seed.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,4 @@

set -e

if [[ -z "${MARQUEZ_CONFIG}" ]]; then
MARQUEZ_CONFIG='marquez.dev.yml'
echo "WARNING 'MARQUEZ_CONFIG' not set, using development configuration."
fi

java -jar marquez-api-*.jar seed --url "${MARQUEZ_URL:-http://localhost:5000}" --metadata metadata.json "${MARQUEZ_CONFIG}"
java -jar marquez-api-*.jar seed --url "${MARQUEZ_URL:-http://localhost:5000}" --metadata metadata.json