-
Notifications
You must be signed in to change notification settings - Fork 17
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
Bc 5170 no preview for larger files #4457
Merged
Merged
Changes from all commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
1d5ff37
BC-5170 - wip v1
SevenWaysDP 46203c9
BC-5170 - wip v2
SevenWaysDP cd1ddfc
Merge branch 'main' into BC-5170-no-preview-for-larger-files
SevenWaysDP 2c73716
Adjust tests in file storage service and uc
bischofmax 8b7c957
Fix imports of testmodules
bischofmax 13a53c3
BC-5170 - fix api tests
SevenWaysDP ec15838
BC-5170 - add test + code review
SevenWaysDP 97daebc
Merge remote-tracking branch 'origin/main' into BC-5170-no-preview-fo…
SevenWaysDP c8999a4
BC-5170 devops code review
SevenWaysDP 9b2708b
Merge branch 'main' into BC-5170-no-preview-for-larger-files
SevenWaysDP 37bfd65
BC-5170 - code review
SevenWaysDP 75cb61c
BC-5170 - rename method
SevenWaysDP 7565814
BC-5170 - change logger
SevenWaysDP d609e9b
BC-5170 - add configmap
SevenWaysDP 1f4ab96
fixup! BC-5170 - add configmap
SevenWaysDP 6bad348
fixup! fixup! BC-5170 - add configmap
SevenWaysDP 1c63d61
BC-5170 - remove required envs
SevenWaysDP c827105
BC-5170 - add scaled object
SevenWaysDP 5939d0e
Merge branch 'main' into BC-5170-no-preview-for-larger-files
SevenWaysDP 9bda5ae
BC-5170 code review
SevenWaysDP 9af1a5a
Merge remote-tracking branch 'origin/BC-5170-no-preview-for-larger-fi…
SevenWaysDP 24d1440
BC-5170 - code review
SevenWaysDP ceef528
Merge remote-tracking branch 'origin/main' into BC-5170-no-preview-fo…
SevenWaysDP 25da0bd
BC-5170 - fix tests
SevenWaysDP cebb08b
BC-5170 - code review
SevenWaysDP 2f3f7fd
Merge remote-tracking branch 'origin/main' into BC-5170-no-preview-fo…
SevenWaysDP 711d1d6
BC-5170 - fix tests
SevenWaysDP 5e05e10
BC-5170 - fix lintner
SevenWaysDP 1623cd5
BC-5170 - change keda config
SevenWaysDP 36e4137
BC-5170 - code review
SevenWaysDP da6cd81
Update ansible/roles/schulcloud-server-core/tasks/main.yml
SevenWaysDP 588e022
Update ansible/roles/schulcloud-server-core/tasks/main.yml
SevenWaysDP 634db78
Update ansible/roles/schulcloud-server-core/tasks/main.yml
SevenWaysDP 26563ed
Update ansible/roles/schulcloud-server-core/tasks/main.yml
SevenWaysDP 6966569
Update ansible/roles/schulcloud-server-core/templates/preview-generat…
SevenWaysDP 20f5164
Merge remote-tracking branch 'origin/main' into BC-5170-no-preview-fo…
SevenWaysDP bfc70c9
BC-5170 - code review
SevenWaysDP bebde5c
Update ansible/roles/schulcloud-server-core/templates/preview-generat…
SevenWaysDP 44e0eaf
BC-5170 - add label
SevenWaysDP 4ebdb1d
BC-5170 - add configs
SevenWaysDP 96989b2
BC-5170 - code review
SevenWaysDP a5f0fb0
BC-5170 - change logic for file name
SevenWaysDP 5ea34cc
BC-5170 - because Cedric wishs ;o)
SevenWaysDP File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
ansible/roles/schulcloud-server-core/templates/preview-generator-configmap.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: preview-generator-configmap | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: preview-generator | ||
data: |
46 changes: 46 additions & 0 deletions
46
ansible/roles/schulcloud-server-core/templates/preview-generator-deployment.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: preview-generator-deployment | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: preview-generator | ||
spec: | ||
replicas: {{ AMQP_FILE_PREVIEW_REPLICAS|default("1", true) }} | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxSurge: 1 | ||
#maxUnavailable: 1 | ||
revisionHistoryLimit: 4 | ||
paused: false | ||
selector: | ||
matchLabels: | ||
app: preview-generator | ||
template: | ||
metadata: | ||
labels: | ||
app: preview-generator | ||
spec: | ||
securityContext: | ||
runAsUser: 1000 | ||
runAsGroup: 1000 | ||
fsGroup: 1000 | ||
runAsNonRoot: true | ||
containers: | ||
- name: preview-generator | ||
image: {{ SCHULCLOUD_SERVER_IMAGE }}:file-preview-{{ SCHULCLOUD_SERVER_IMAGE_TAG }} | ||
imagePullPolicy: IfNotPresent | ||
envFrom: | ||
- configMapRef: | ||
name: preview-generator-configmap | ||
- secretRef: | ||
name: preview-generator-secret | ||
command: ['npm', 'run', 'nest:start:preview-generator-amqp:prod'] | ||
resources: | ||
limits: | ||
cpu: {{ AMQP_FILE_PREVIEW_CPU_LIMITS|default("4000m", true) }} | ||
memory: {{ AMQP_FILE_PREVIEW_MEMORY_LIMITS|default("4000Mi", true) }} | ||
requests: | ||
cpu: {{ AMQP_FILE_PREVIEW_CPU_REQUESTS|default("100m", true) }} | ||
memory: {{ AMQP_FILE_PREVIEW_MEMORY_REQUESTS|default("250Mi", true) }} |
9 changes: 9 additions & 0 deletions
9
ansible/roles/schulcloud-server-core/templates/preview-generator-onepassword.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
apiVersion: onepassword.com/v1 | ||
kind: OnePasswordItem | ||
metadata: | ||
name: preview-generator-secret | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: preview-generator | ||
spec: | ||
itemPath: "vaults/{{ ONEPASSWORD_OPERATOR_VAULT }}/items/preview-generator" |
23 changes: 23 additions & 0 deletions
23
ansible/roles/schulcloud-server-core/templates/preview-generator-scaled-object.yml.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
apiVersion: keda.sh/v1alpha1 | ||
kind: ScaledObject | ||
metadata: | ||
name: preview-generator-rabbitmq-scaledobject | ||
namespace: {{ NAMESPACE }} | ||
labels: | ||
app: preview-generator | ||
spec: | ||
scaleTargetRef: | ||
name: preview-generator-deployment | ||
idleReplicaCount: {{ AMQP_FILE_PREVIEW_IDLE_REPLICA_COUNT|default("1", true) }} | ||
minReplicaCount: {{ AMQP_FILE_PREVIEW_MIN_REPLICA_COUNT|default("1", true) }} | ||
maxReplicaCount: {{ AMQP_FILE_PREVIEW_MAX_REPLICA_COUNT|default("5", true) }} | ||
triggers: | ||
- type: rabbitmq | ||
metadata: | ||
protocol: amqp | ||
queueName: generate-preview | ||
mode: QueueLength | ||
value: "1" | ||
authenticationRef: | ||
name: rabbitmq-trigger-auth |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* istanbul ignore file */ | ||
/* eslint-disable no-console */ | ||
import { PreviewGeneratorAMQPModule } from '@modules/files-storage/files-preview-amqp.module'; | ||
import { NestFactory } from '@nestjs/core'; | ||
import { install as sourceMapInstall } from 'source-map-support'; | ||
|
||
async function bootstrap() { | ||
sourceMapInstall(); | ||
|
||
const nestApp = await NestFactory.createMicroservice(PreviewGeneratorAMQPModule); | ||
await nestApp.init(); | ||
|
||
console.log('#############################################'); | ||
console.log(`### Start Preview Generator AMQP Consumer ###`); | ||
console.log('#############################################'); | ||
} | ||
void bootstrap(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
export * from './error.mapper'; | ||
export * from './copy-files-of-parent-param.builder'; | ||
export * from './files-storage-client.mapper'; | ||
export * from './files-storage-param.builder'; | ||
export * from './copy-files-of-parent-param.builder'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nestApp.useLogger(await nestApp.resolve(LegacyLogger));
müsste uns ermöglichen mit logger.alert oder so zu arbeiten? Sollten wir das hier machen, oder ist console.log + /* eslint-disable no-console */ ok für die bootstraps. Das ist zumindest der Bereich der unsauber sein darf.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ja, wir könne gerne umstellen, aber dann im anderen Ticket und überall im apps