Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Integrate ras rm print file (#136)
Browse files Browse the repository at this point in the history
* Initial commit

* Integration with google pubsub

* temp ignore

* updating topic name

* Update versions

* Log more info about pub sub

* Add file name and remove upload to sftp/gcs

* Removing template, gcs and sftp services from the export processor

* delete everything related to sftp, redis and freemarker

* Removing the event publisher

* Remove template mapping service

* fix missing rabbit template bean

* Delteing unused classes

* Drop template mapping table

* incorrectly changed release 21

* Removing feedback publisher and cancel action functionality

* renaming cron jobs to match helm chart convention

* Removing commented out test

* Removing integration test as it no longer makes sense
  • Loading branch information
warrenbailey authored Sep 29, 2020
1 parent 500f104 commit 9963d19
Show file tree
Hide file tree
Showing 57 changed files with 341 additions and 1,735 deletions.
4 changes: 2 additions & 2 deletions _infra/helm/action-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 1.2.0
version: 1.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 12.3.12
appVersion: 12.4.0
52 changes: 4 additions & 48 deletions _infra/helm/action-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,58 +186,14 @@ spec:
value: "$(DB_USERNAME)"
- name: SPRING_DATASOURCE_PASSWORD
value: "$(DB_PASSWORD)"
- name: SFTP_HOST
{{- if .Values.sftp.test.enabled }}
value: "$(SFTP_SERVICE_HOST)"
{{- else }}
value: {{ .Values.sftp.host }}
{{- end }}
- name: SFTP_PORT
value: "22"
- name: SFTP_USERNAME
valueFrom:
secretKeyRef:
name: sftp-secret
key: sftp-actionexporter-user
- name: SFTP_PASSWORD
valueFrom:
secretKeyRef:
name: sftp-secret
key: sftp-actionexporter-password
- name: SFTP_DIRECTORY
value: "{{ .Values.sftp.directory }}"
- name: REDIS_HOST
{{- if .Values.database.managedRedis }}
valueFrom:
configMapKeyRef:
name: redis-config
key: redis-host
{{- else }}
value: "$(REDIS_MASTER_SERVICE_HOST)"
{{- end }}
- name: REDIS_PORT
{{- if .Values.database.managedRedis }}
valueFrom:
configMapKeyRef:
name: redis-config
key: redis-port
{{- else }}
value: "$(REDIS_MASTER_SERVICE_PORT)"
{{- end}}
- name: DATA_GRID_ADDRESS
value: "$(REDIS_HOST):$(REDIS_PORT)"
- name: FREEMARKER_DELAYFORNEWTEMPLATES
value: "3600000"
- name: DATA_GRID_LOCK_TIME_TO_LIVE_SECONDS
value: "45"
- name: LOGGING_LEVEL_uk.gov.ons.ctp.response.action.export.scheduled
value: "WARN"
- name: LOGGING_LEVEL_com.jcraft.jsch
value: "DEBUG"
- name: GCS_ENABLED
value: "{{ .Values.gcs.enabled }}"
- name: GCS_BUCKET
value: "{{ .Values.gcs.bucket }}"
- name: GCP_PROJECT
value: "{{ .Values.gcp.project }}"
- name: GCP_TOPIC
value: "{{ .Values.gcp.topic }}"
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /var/secrets/google/credentials.json
resources:
Expand Down
11 changes: 3 additions & 8 deletions _infra/helm/action-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,9 @@ resources:
requests:
memory: "256Mi"

sftp:
directory: /home/demo/sftp
test:
enabled: true

managedRabbitMQ:
enabled: false

gcs:
bucket: "example"
enabled: false
gcp:
project: ras-rm-sandbox
topic: print-file-jobs
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>libraries-bom</artifactId>
<version>9.1.0</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down Expand Up @@ -223,6 +230,10 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-pubsub</artifactId>
</dependency>
<!-- Third party end -->

<!-- Testing -->
Expand Down
49 changes: 0 additions & 49 deletions src/main/java/uk/gov/ons/ctp/common/util/InputStreamUtils.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
import com.google.cloud.storage.Storage;
import com.google.cloud.storage.StorageOptions;
import java.time.Clock;
import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down Expand Up @@ -63,21 +60,6 @@ public CustomObjectMapper customObjectMapper() {
return new CustomObjectMapper();
}

/**
* Bean used to create and configure Redisson Client
*
* @return the Redisson client
*/
@Bean
public RedissonClient redissonClient() {
Config config = new Config();
config
.useSingleServer()
.setAddress(appConfig.getDataGrid().getAddress())
.setPassword(appConfig.getDataGrid().getPassword());
return Redisson.create(config);
}

@Bean
public Clock clock() {
return Clock.systemDefaultZone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
@Data
public class AppConfig {
private Rabbitmq rabbitmq;
private ExportSchedule exportSchedule;
private DataGrid dataGrid;
private Logging logging;
private GCS gcs;
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package uk.gov.ons.ctp.response.action.export.config;

import com.google.cloud.pubsub.v1.Publisher;
import com.google.pubsub.v1.TopicName;
import java.io.IOException;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Log4j
@Configuration
public class PubsubConfig {

@Bean
public Publisher publisherSupplier(
@Value("${gcp.project}") String project, @Value("${gcp.topic}") String topic)
throws IOException {
log.info("creating pubsub publish for topic " + topic + " in project " + project);
TopicName topicName = TopicName.of(project, topic);
return Publisher.newBuilder(topicName).build();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9963d19

Please sign in to comment.