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

chore(dependencies): Autobump Front50 Version #1848

Merged
merged 6 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
clouddriverVersion=5.71.1
fiatVersion=1.26.0
front50Version=2.21.0
korkVersion=7.99.1
front50Version=2.22.0
org.gradle.parallel=true
spinnakerGradleVersion=8.10.1
targetJava11=true
Expand Down
2 changes: 2 additions & 0 deletions halyard-config/halyard-config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ dependencies {
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

// TODO(plumpy): remove version once added to kork
implementation "com.google.cloud:google-cloud-storage:1.108.0"
implementation "com.netflix.spinnaker.clouddriver:clouddriver-api:$clouddriverVersion"
implementation "com.netflix.spinnaker.clouddriver:clouddriver-docker:$clouddriverVersion"
implementation "com.netflix.spinnaker.clouddriver:clouddriver-google:$clouddriverVersion"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@

package com.netflix.spinnaker.halyard.config.validate.v1.canary.google;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.cloud.storage.Storage;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.netflix.spectator.api.Registry;
import com.netflix.spinnaker.clouddriver.google.security.GoogleNamedAccountCredentials;
import com.netflix.spinnaker.front50.model.GcsStorageService;
import com.netflix.spinnaker.front50.model.StorageService;
import com.netflix.spinnaker.halyard.config.model.v1.canary.google.GoogleCanaryAccount;
import com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemSetBuilder;
import com.netflix.spinnaker.halyard.config.validate.v1.canary.CanaryAccountValidator;
Expand All @@ -28,6 +30,8 @@
import com.netflix.spinnaker.halyard.core.secrets.v1.SecretSessionManager;
import com.netflix.spinnaker.halyard.core.tasks.v1.DaemonTaskHandler;
import java.nio.file.Path;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.StringUtils;
Expand All @@ -40,6 +44,7 @@ public class GoogleCanaryAccountValidator extends CanaryAccountValidator<GoogleC
private String halyardVersion;

private Registry registry;
private Storage googleCloudStorage;
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this field initialized? I assume it should be different for each GoogleCanaryAccount, which is passed in validate


TaskScheduler taskScheduler;

Expand Down Expand Up @@ -73,24 +78,23 @@ public void validate(ConfigProblemSetBuilder p, GoogleCanaryAccount n) {
Path jsonPath = validatingFileDecryptPath(n.getJsonPath());

try {
StorageService storageService =
ExecutorService executor =
Executors.newCachedThreadPool(
new ThreadFactoryBuilder()
.setNameFormat(GcsStorageService.class.getName() + "-%s")
.build());
GcsStorageService storageService =
new GcsStorageService(
googleCloudStorage,
n.getBucket(),
n.getBucketLocation(),
n.getRootFolder(),
n.getProject(),
jsonPath != null ? jsonPath.toString() : "",
"halyard",
connectTimeoutSec,
readTimeoutSec,
maxWaitInterval,
retryIntervalBase,
jitterMultiplier,
maxRetries,
taskScheduler,
registry);
new ObjectMapper(),
executor);

storageService.ensureBucketExists();

} catch (Exception e) {
p.addProblem(
Severity.ERROR,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,19 @@

package com.netflix.spinnaker.halyard.config.validate.v1.persistentStorage;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.cloud.storage.Storage;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import com.netflix.spectator.api.Registry;
import com.netflix.spinnaker.front50.model.GcsStorageService;
import com.netflix.spinnaker.front50.model.StorageService;
import com.netflix.spinnaker.halyard.config.model.v1.node.Validator;
import com.netflix.spinnaker.halyard.config.model.v1.persistentStorage.GcsPersistentStore;
import com.netflix.spinnaker.halyard.config.problem.v1.ConfigProblemSetBuilder;
import com.netflix.spinnaker.halyard.config.services.v1.AccountService;
import com.netflix.spinnaker.halyard.core.problem.v1.Problem.Severity;
import java.nio.file.Path;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.stereotype.Component;
Expand All @@ -36,6 +40,7 @@ public class GCSValidator extends Validator<GcsPersistentStore> {
@Autowired private Registry registry;

@Autowired TaskScheduler taskScheduler;
private Storage googleCloudStorage;
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment as above


private int connectTimeoutSec = 45;
private int readTimeoutSec = 45;
Expand All @@ -48,22 +53,20 @@ public class GCSValidator extends Validator<GcsPersistentStore> {
public void validate(ConfigProblemSetBuilder ps, GcsPersistentStore n) {
Path jsonPath = validatingFileDecryptPath(n.getJsonPath());
try {
StorageService storageService =
ExecutorService executor =
Executors.newCachedThreadPool(
new ThreadFactoryBuilder()
.setNameFormat(GcsStorageService.class.getName() + "-%s")
.build());
GcsStorageService storageService =
new GcsStorageService(
googleCloudStorage,
n.getBucket(),
n.getBucketLocation(),
n.getRootFolder(),
n.getProject(),
jsonPath != null ? jsonPath.toString() : "",
"halyard",
connectTimeoutSec,
readTimeoutSec,
maxWaitInterval,
retryIntervalbase,
jitterMultiplier,
maxRetries,
taskScheduler,
registry);
new ObjectMapper(),
executor);

storageService.ensureBucketExists();
} catch (Exception e) {
Expand Down