diff options
Diffstat (limited to 'controller-api/src/main/java')
11 files changed, 104 insertions, 51 deletions
diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/EnvironmentResource.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/EnvironmentResource.java index 812c4a60288..bea496c19d7 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/EnvironmentResource.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/EnvironmentResource.java @@ -36,8 +36,10 @@ public interface EnvironmentResource { String API_PATH = "environment"; + String APPLICATION_TEST_ZIP = "applicationTestZip"; String APPLICATION_ZIP = "applicationZip"; String DEPLOY_OPTIONS = "deployOptions"; + String SUBMIT_OPTIONS = "submitOptions"; @POST @Path("{environmentId}/region/{regionId}/instance/{instanceId}/deploy") diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitOptions.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitOptions.java new file mode 100644 index 00000000000..fb97a3c1004 --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitOptions.java @@ -0,0 +1,55 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.application.v4.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.yahoo.vespa.hosted.controller.api.identifiers.GitBranch; +import com.yahoo.vespa.hosted.controller.api.identifiers.GitCommit; +import com.yahoo.vespa.hosted.controller.api.identifiers.GitRepository; + +import java.util.Objects; + +/** + * Additional options to be sent along the application package and the application test package + * when submitting an application to the controller + * + * @author freva + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class SubmitOptions { + + public GitRepository repository; + public GitBranch branch; + public GitCommit commit; + + public static SubmitOptions from(String repository, String branch, String commit) { + SubmitOptions options = new SubmitOptions(); + options.repository = new GitRepository(repository); + options.branch = new GitBranch(branch); + options.commit = new GitCommit(commit); + return options; + } + + @Override + public String toString() { + return "SubmitOptions{" + + "repository=" + repository + + ", branch=" + branch + + ", commit=" + commit + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SubmitOptions that = (SubmitOptions) o; + return Objects.equals(repository, that.repository) && + Objects.equals(branch, that.branch) && + Objects.equals(commit, that.commit); + } + + @Override + public int hashCode() { + return Objects.hash(repository, branch, commit); + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitResult.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitResult.java new file mode 100644 index 00000000000..a7f136cf3ce --- /dev/null +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/application/v4/model/SubmitResult.java @@ -0,0 +1,37 @@ +// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +package com.yahoo.vespa.hosted.controller.api.application.v4.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +import java.util.Objects; + +/** + * Represents the response from application submit request + * + * @author freva + */ +@JsonIgnoreProperties(ignoreUnknown = true) +public class SubmitResult { + + public String version; + + @Override + public String toString() { + return "SubmitResult{" + + "version='" + version + '\'' + + '}'; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + SubmitResult that = (SubmitResult) o; + return Objects.equals(version, that.version); + } + + @Override + public int hashCode() { + return Objects.hash(version); + } +} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java index e91a5909f80..56c2ee8da6b 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/BuildService.java @@ -20,11 +20,6 @@ public interface BuildService { */ JobState stateOf(BuildJob buildJob); - /** - * Returns whether the given build job should be performed by this build service. - */ - default boolean builds(BuildJob buildJob) { return true; } - enum JobState { /** Job is not running, and may be triggered. */ diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/InvalidTokenException.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/InvalidTokenException.java deleted file mode 100644 index 967af1c553f..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/InvalidTokenException.java +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.api.integration.athenz; - -/** - * @author bjorncs - */ -public class InvalidTokenException extends RuntimeException { - public InvalidTokenException(String message) { - super(message); - } -} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsClient.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsClient.java index e8bc16ca271..3630748b10a 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsClient.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsClient.java @@ -3,8 +3,6 @@ package com.yahoo.vespa.hosted.controller.api.integration.athenz; import com.yahoo.vespa.athenz.api.AthenzDomain; import com.yahoo.vespa.athenz.api.AthenzIdentity; -import com.yahoo.vespa.athenz.api.AthenzPublicKey; -import com.yahoo.vespa.athenz.api.AthenzService; import com.yahoo.vespa.hosted.controller.api.identifiers.ApplicationId; import java.util.List; @@ -33,8 +31,4 @@ public interface ZmsClient { List<AthenzDomain> getDomainList(String prefix); - AthenzPublicKey getPublicKey(AthenzService service, String keyId); - - List<AthenzPublicKey> getPublicKeys(AthenzService service); - } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsKeystore.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsKeystore.java deleted file mode 100644 index b3dc9fd4fe1..00000000000 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/athenz/ZmsKeystore.java +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -package com.yahoo.vespa.hosted.controller.api.integration.athenz; - -import com.yahoo.vespa.athenz.api.AthenzService; - -import java.security.PublicKey; -import java.util.Optional; - -/** - * @author bjorncs - */ -public interface ZmsKeystore { - - Optional<PublicKey> getPublicKey(AthenzService service, String keyId); - - default void preloadKeys(AthenzService service) { /* Default implementation is noop */ } - -} diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java index b44e7f6f5e7..117dbd38a3b 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/ArtifactRepository.java @@ -21,10 +21,10 @@ public interface ArtifactRepository { /** Returns the system application package of the given version. */ byte[] getSystemApplicationPackage(ApplicationId application, ZoneId zone, Version version); - /** Stores the given tester application fat jar of the given version. */ - void putTesterJar(ApplicationId tester, String applicationVersion, byte[] fatTestJar); + /** Stores the given tester application package of the given version. Does NOT contain the services.xml. */ + void putTesterPackage(ApplicationId tester, String applicationVersion, byte[] testerPackage); - /** Returns the tester application fat jar of the given version. */ - byte[] getTesterJar(ApplicationId tester, String applicationVersion); + /** Returns the tester application package of the given version. Does NOT contain the services.xml. */ + byte[] getTesterPackage(ApplicationId tester, String applicationVersion); } diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java index c9c73c3844a..3d8fe06e9b0 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/JobType.java @@ -24,6 +24,7 @@ public enum JobType { productionApSoutheast1 ("production-ap-southeast-1" , ZoneId.from("prod" , "ap-southeast-1") , null ), productionEuWest1 ("production-eu-west-1" , ZoneId.from("prod" , "eu-west-1") , null ), productionAwsUsEast1a ("production-aws-us-east-1a" , ZoneId.from("prod" , "aws-us-east-1a") , null ), + productionAwsUsWest1b ("production-aws-us-west-1b" , ZoneId.from("prod" , "aws-us-west-1b") , null ), productionCdAwsUsEast1a("production-cd-aws-us-east-1a", null , ZoneId.from("prod" , "cd-aws-us-east-1a")), productionCdUsCentral1 ("production-cd-us-central-1" , null , ZoneId.from("prod" , "cd-us-central-1") ), productionCdUsCentral2 ("production-cd-us-central-2" , null , ZoneId.from("prod" , "cd-us-central-2") ); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/Testers.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java index dccc0e47ceb..f1d07fc9097 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/Testers.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/deployment/TesterCloud.java @@ -7,7 +7,7 @@ import java.net.URI; * * @author jonmv */ -public interface Testers { +public interface TesterCloud { /** Signals the tester to run its tests. */ void startTests(URI testerUrl, Suite suite, byte[] config); diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesters.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java index 021e4d7f293..c2199c284f3 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesters.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/stubs/MockTesterCloud.java @@ -1,16 +1,14 @@ package com.yahoo.vespa.hosted.controller.api.integration.stubs; -import com.yahoo.vespa.hosted.controller.api.integration.deployment.Testers; +import com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud; import java.net.URI; import java.util.Arrays; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.Testers.Status.FAILURE; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.Testers.Status.NOT_STARTED; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.Testers.Status.RUNNING; -import static com.yahoo.vespa.hosted.controller.api.integration.deployment.Testers.Status.SUCCESS; +import static com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud.Status.NOT_STARTED; +import static com.yahoo.vespa.hosted.controller.api.integration.deployment.TesterCloud.Status.RUNNING; -public class MockTesters implements Testers { +public class MockTesterCloud implements TesterCloud { private byte[] logs = new byte[0]; private Status status = NOT_STARTED; |