diff --git a/docker-compose.override.yaml b/docker-compose.override.yaml index ea8bf77085..195e3bdcdc 100644 --- a/docker-compose.override.yaml +++ b/docker-compose.override.yaml @@ -9,7 +9,7 @@ services: - '/home/saveu/configs/TestSuitesToken:/workspace/BOOT-INF/classes/TestSuitesToken' command: [ "-c", - 'mkdir -p /home/cnb/files/ && mkdir -p /home/cnb/config && mkdir -p /home/cnb/certificates && + 'mkdir -p /home/cnb/config && mkdir -p /home/cnb/certificates && for cert in /home/cnb/certificates/*; do find /layers -name jre -type d -exec {}/bin/keytool -keystore {}/lib/security/cacerts -storepass changeit -noprompt -trustcacerts -importcert -alias $${cert%.*} -file $$cert \; ; done && /cnb/process/web' diff --git a/docker-compose.yaml b/docker-compose.yaml index 934afacb08..78515477ff 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -46,7 +46,6 @@ services: volumes: - "/var/run/docker.sock:/var/run/docker.sock" - /home/saveu/configs/sandbox:/home/cnb/config - - save-fs-storage:/home/cnb/files - save-tmp-resources:/tmp extra_hosts: - "host.docker.internal:host-gateway" @@ -62,7 +61,6 @@ services: - db_username - db_password volumes: - - save-fs-storage:/home/cnb/files - /home/saveu/configs/backend:/home/cnb/config ports: - "5800:5800" @@ -82,7 +80,6 @@ services: - "SPRING_PROFILES_ACTIVE=${PROFILE}" volumes: - save:/home/cnb/ - - save-fs-storage:/home/cnb/files - /home/saveu/configs/preprocessor:/home/cnb/config ports: - "5200:5200" @@ -179,7 +176,6 @@ networks: volumes: save: - save-fs-storage: grafana-storage: prometheus-storage: loki-storage: diff --git a/save-backend/build.gradle.kts b/save-backend/build.gradle.kts index aac89fb701..f33de4e118 100644 --- a/save-backend/build.gradle.kts +++ b/save-backend/build.gradle.kts @@ -1,9 +1,6 @@ -import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform -import org.gradle.testing.jacoco.plugins.JacocoTaskExtension -import java.nio.file.Files.isDirectory -import java.nio.file.Paths +import org.gradle.testing.jacoco.plugins.JacocoTaskExtension plugins { id("com.saveourtool.save.buildutils.kotlin-jvm-configuration") @@ -38,42 +35,6 @@ tasks.register("copyLiquibase") { into("$buildDir/resources/test/db") } -tasks.register("cleanupDbAndStorage") { - dependsOn(":liquibaseDropAll") - val profile = properties["save.profile"] as String? - - val userHome = System.getProperty("user.home") - val isWindows = DefaultNativePlatform.getCurrentOperatingSystem().isWindows - - val storagePath = when (profile) { - "win" -> "$userHome/.save-cloud/cnb/files" - "mac" -> "/Users/Shared/.save-cloud/cnb/files" - else -> when { - isWindows -> "$userHome/.save-cloud/cnb/files" - else -> "/home/cnb/files" - } - }.let(Paths::get) - - /* - * No idea why we should rely on running external commands in order to - * delete a directory, since this can be done in a platform-independent way. - */ - val args = if (profile != "win" && !isWindows) { - arrayOf("rm", "-rf") - } else if (isDirectory(storagePath)) { - /* - * cmd.exe will set a non-zero exit status if the directory doesn't exist. - */ - arrayOf("cmd", "/c", "rmdir", "/s", "/q") - } else { - /* - * Run a dummy command. - */ - arrayOf("cmd", "/c", "echo") - } - commandLine(*args, storagePath) -} - dependencies { implementation(projects.saveCloudCommon) implementation(projects.authenticationService) diff --git a/save-cloud-charts/save-cloud/templates/_constants.tpl b/save-cloud-charts/save-cloud/templates/_constants.tpl index 39f9eca46e..e69de29bb2 100644 --- a/save-cloud-charts/save-cloud/templates/_constants.tpl +++ b/save-cloud-charts/save-cloud/templates/_constants.tpl @@ -1,7 +0,0 @@ -{{- define "backend.constants.storage" -}} -/home/cnb/files -{{- end }} - -{{- define "demo.constants.storage" -}} -/home/cnb/files -{{- end }} \ No newline at end of file diff --git a/save-cloud-charts/save-cloud/templates/backend-deployment.yaml b/save-cloud-charts/save-cloud/templates/backend-deployment.yaml index 130c3d7b77..ce18dfb278 100644 --- a/save-cloud-charts/save-cloud/templates/backend-deployment.yaml +++ b/save-cloud-charts/save-cloud/templates/backend-deployment.yaml @@ -33,8 +33,6 @@ spec: value: -XX:ReservedCodeCacheSize=48M volumeMounts: - {{ include "spring-boot.config-volume-mount" . | indent 14 | trim }} - - name: fs-storage - mountPath: {{ include "backend.constants.storage" . }} - name: database-secret mountPath: {{ .Values.mysql.dbPasswordFile }} - name: s3-secrets @@ -105,9 +103,6 @@ spec: {{ end }} volumes: - {{ include "spring-boot.config-volume" (dict "service" .Values.backend) | indent 10 | trim }} - - name: fs-storage - persistentVolumeClaim: - claimName: {{ .Values.backend.name }}-fs-storage - name: database-secret secret: secretName: db-secrets diff --git a/save-cloud-charts/save-cloud/templates/demo-configmap.yaml b/save-cloud-charts/save-cloud/templates/demo-configmap.yaml index e3c7781ac7..eeca88565c 100644 --- a/save-cloud-charts/save-cloud/templates/demo-configmap.yaml +++ b/save-cloud-charts/save-cloud/templates/demo-configmap.yaml @@ -4,7 +4,6 @@ metadata: name: {{ .Values.demo.name }}-config data: application.properties: | - demo.file-storage.location={{ include "demo.constants.storage" . }} management.endpoints.web.exposure.include=* management.server.port={{ .Values.demo.managementPort }} logging.level.org.springframework=DEBUG diff --git a/save-cloud-charts/save-cloud/templates/demo-deployment.yaml b/save-cloud-charts/save-cloud/templates/demo-deployment.yaml index 36b4b1aab6..237b648521 100644 --- a/save-cloud-charts/save-cloud/templates/demo-deployment.yaml +++ b/save-cloud-charts/save-cloud/templates/demo-deployment.yaml @@ -33,8 +33,6 @@ spec: value: -XX:ReservedCodeCacheSize=48M volumeMounts: - {{ include "spring-boot.config-volume-mount" . | indent 14 | trim }} - - name: fs-storage - mountPath: {{ include "demo.constants.storage" . }} - name: database-secret mountPath: {{ .Values.mysql.dbPasswordFile }} - name: s3-secrets @@ -102,9 +100,6 @@ spec: name: database-secret volumes: - {{ include "spring-boot.config-volume" (dict "service" .Values.demo) | indent 10 | trim }} - - name: fs-storage - persistentVolumeClaim: - claimName: {{ .Values.demo.name }}-fs-storage - name: database-secret secret: secretName: db-secrets diff --git a/save-cloud-charts/save-cloud/templates/fs-storage-pvc.yaml b/save-cloud-charts/save-cloud/templates/fs-storage-pvc.yaml deleted file mode 100644 index c3fdf6adbd..0000000000 --- a/save-cloud-charts/save-cloud/templates/fs-storage-pvc.yaml +++ /dev/null @@ -1,24 +0,0 @@ -{{- range tuple .Values.backend.name .Values.sandbox.name .Values.demo.name }} -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - io.kompose.service: {{ . }}-fs-storage - {{- with $.Values.storage.annotations }} - annotations: -{{ toYaml . | indent 4 }} - {{- end }} - name: {{ . }}-fs-storage -spec: - accessModes: - # FixMe: ReadWriteMany if there are many distributed pods; or better - migrate this data to S3. - - ReadWriteOnce - resources: - requests: - storage: {{ $.Values.storage.size }} -# NB: key `volumeName` is not needed here, otherwise provisioner won't attempt to create a PV automatically - {{- if $.Values.storage.storageClassName }} - storageClassName: {{ $.Values.storage.storageClassName }} - {{- end }} ---- -{{- end }} \ No newline at end of file diff --git a/save-cloud-charts/save-cloud/templates/sandbox-deployment.yaml b/save-cloud-charts/save-cloud/templates/sandbox-deployment.yaml index 5eca3cfc30..f218d26e8f 100644 --- a/save-cloud-charts/save-cloud/templates/sandbox-deployment.yaml +++ b/save-cloud-charts/save-cloud/templates/sandbox-deployment.yaml @@ -54,8 +54,6 @@ spec: fieldPath: spec.nodeName volumeMounts: - {{ include "spring-boot.config-volume-mount" . | indent 14 | trim }} - - name: fs-storage - mountPath: /home/cnb/files - name: database-secret mountPath: {{ .Values.mysql.dbPasswordFile }} - name: s3-secrets @@ -124,9 +122,6 @@ spec: name: database-secret volumes: - {{ include "spring-boot.config-volume" (dict "service" .Values.sandbox) | indent 10 | trim }} - - name: fs-storage - persistentVolumeClaim: - claimName: {{ .Values.sandbox.name }}-fs-storage - name: database-secret secret: secretName: db-secrets diff --git a/save-demo/src/main/resources/application.properties b/save-demo/src/main/resources/application.properties index bfde31856b..7aa0a8f5e4 100644 --- a/save-demo/src/main/resources/application.properties +++ b/save-demo/src/main/resources/application.properties @@ -10,7 +10,6 @@ spring.jpa.properties.hibernate.order_inserts=true spring.jpa.properties.hibernate.order_updates=true spring.liquibase.enabled=false logging.level.org.hibernate.engine.internal.StatisticalLoggingSessionEventListener=WARN -demo.fileStorage.location=/home/cnb/files demo.backend=http://backend:5800/internal demo.s3-storage.endpoint=${s3-storage.endpoint} demo.s3-storage.bucketName=${s3-storage.bucketName}