Skip to content

Commit

Permalink
feat(plugins): Use SpinnakerExtensionPoint for orca-api extension poi…
Browse files Browse the repository at this point in the history
…nts, skipping Task for now (#3649)

* feat(plugins): Use SpinnakerExtensionPoint where for extension points, skipping Task for now

* fix(plugins): use latest kork version

* chore(dependencies): Autobump keikoVersion (#3653)

Co-authored-by: root <root@bc779c563dc7>

* feat(queue): support for dynamic activation of the queue shovel (#3630)

* feat(queue): support for dynamic action of the queue shovel

This makes it possible to have a QueueShovel bean enabled by default, but not active.

Once the `queue.shovel.active` flag becomes true, it will start actively shoveling messages for some time then stop and check again.

* chore(queue-shovel): switch to a fixed rate direct execution

Instead of spawning threads with a fixed delay. Also:
- add a log message when the shovel becomes active
- derive the work duration from the execution rate (i.e. strive to work for a slightly shorter duration than the scheduled rate)
- make isActive() responsible for checking both the property and the activator status
- only check the activator in `isActive` instead of in every invocation of `migrateSome`

* Update orca-queue/src/main/kotlin/com/netflix/spinnaker/orca/q/QueueShovel.kt

Co-Authored-By: Mark Vulfson <markvu@live.com>

* fix(config): add missing SqlQueueShovelConfiguration

Co-authored-by: Mark Vulfson <markvu@live.com>

* fix(plugins): tests help you catch dumb mistakes

* fix(plugins): Back out change ot Task and TaskResolver, need to spend time thinking about these orca unit test failures

Co-authored-by: spinnakerbot <spinbot@spinnaker.io>
Co-authored-by: root <root@bc779c563dc7>
Co-authored-by: Daniel Reynaud <reynaud.daniel@gmail.com>
Co-authored-by: Mark Vulfson <markvu@live.com>
  • Loading branch information
5 people committed May 5, 2020
1 parent a1f6f39 commit 7ad04ab
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
enablePublishing=false
fiatVersion=1.18.3
keikoVersion=3.6.1
korkVersion=7.41.1
korkVersion=7.41.3
kotlinVersion=1.3.71
org.gradle.parallel=true
spinnakerGradleVersion=8.0.6
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode.GraphType.FULL;

import com.netflix.spinnaker.kork.annotations.Beta;
import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint;
import com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode.TaskGraph;
import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution;
import java.lang.annotation.ElementType;
Expand All @@ -30,7 +31,6 @@
import java.util.Collection;
import java.util.Collections;
import javax.annotation.Nonnull;
import org.pf4j.ExtensionPoint;

/**
* Provides a low-level API for building stages.
Expand All @@ -41,7 +41,7 @@
* stages.
*/
@Beta
public interface StageDefinitionBuilder extends ExtensionPoint {
public interface StageDefinitionBuilder extends SpinnakerExtensionPoint {

default @Nonnull TaskGraph buildTaskGraph(@Nonnull StageExecution stage) {
Builder graphBuilder = Builder(FULL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
package com.netflix.spinnaker.orca.api.preconfigured.jobs;

import com.netflix.spinnaker.kork.annotations.Beta;
import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint;
import java.util.List;
import org.pf4j.ExtensionPoint;

/** Extension point for provisioning preconfigured Job stages. */
@Beta
public interface PreconfiguredJobConfigurationProvider extends ExtensionPoint {
public interface PreconfiguredJobConfigurationProvider extends SpinnakerExtensionPoint {

/**
* Provides list of job configurations that gets launched from PreConfigured job stage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package com.netflix.spinnaker.orca.api.simplestage;

import com.netflix.spinnaker.kork.annotations.Beta;
import org.pf4j.ExtensionPoint;
import com.netflix.spinnaker.kork.plugins.api.internal.SpinnakerExtensionPoint;

/**
* Allows the creation of the most simple stage possible: One with a single task.
Expand All @@ -26,7 +26,7 @@
* fields that are required for the stage to run.
*/
@Beta
public interface SimpleStage<T> extends ExtensionPoint {
public interface SimpleStage<T> extends SpinnakerExtensionPoint {
/**
* When this stage runs, the execute method gets called. It takes in a class that is created that
* has the data needed by the stage. It returns a class that contains the status of the stage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ public Task getTask(@Nonnull Class<? extends Task> taskType) {
@Nonnull
public Class<? extends Task> getTaskClass(@Nonnull String taskTypeIdentifier) {
try {
return getTask(taskTypeIdentifier).getClass();
Task task = getTask(taskTypeIdentifier);
return (Class<? extends Task>) task.getClass();
} catch (IllegalArgumentException e) {
if (!allowFallback) {
throw e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package com.netflix.spinnaker.orca.pipeline;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.spinnaker.kork.plugins.proxy.ExtensionClassProvider;
import com.netflix.spinnaker.orca.api.pipeline.Task;
import com.netflix.spinnaker.orca.api.pipeline.TaskResult;
import com.netflix.spinnaker.orca.api.pipeline.models.ExecutionStatus;
Expand Down Expand Up @@ -47,7 +46,7 @@ public SimpleTask(@Nullable SimpleStage simpleStage) {

private SimpleStageInput getStageInput(StageExecution stage, ObjectMapper objectMapper) {
try {
Class<?> extensionClass = ExtensionClassProvider.getExtensionClass(simpleStage);
Class<?> extensionClass = simpleStage.getExtensionClass();
List<Class<?>> cArg = Arrays.asList(SimpleStageInput.class);
Method method = extensionClass.getMethod("execute", cArg.toArray(new Class[0]));
Type inputType = ResolvableType.forMethodParameter(method, 0).getGeneric().getType();
Expand Down

0 comments on commit 7ad04ab

Please sign in to comment.