Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Commit

Permalink
prod import data from s3
Browse files Browse the repository at this point in the history
  • Loading branch information
skylenet committed Sep 7, 2023
1 parent 8f58614 commit caae6f4
Show file tree
Hide file tree
Showing 6 changed files with 143 additions and 0 deletions.
23 changes: 23 additions & 0 deletions environments/production/s3-import-xfs/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
6 changes: 6 additions & 0 deletions environments/production/s3-import-xfs/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.5.1
digest: sha256:3588c89621170f198d4938664d3ea4c469bd91fd78183c83cfcf63f474d348c4
generated: "2023-08-10T15:36:00.179305+02:00"
14 changes: 14 additions & 0 deletions environments/production/s3-import-xfs/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v2
name: s3-import-xfs
home: https://github.com/sourcifyeth/docs
type: application
version: 0.0.1
kubeVersion: ">=1.22.0-0"
maintainers:
- name: skylenet
email: [email protected]
dependencies:
- name: common
repository: https://bjw-s.github.io/helm-charts
version: 1.5.1
Binary file not shown.
47 changes: 47 additions & 0 deletions environments/production/s3-import-xfs/templates/common.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
{{- include "bjw-s.common.loader.init" . }}

{{- define "app-template.nameOverride" -}}
# Set the nameOverride based on the release name if no override has been set
{{ if not .Values.global.nameOverride }}
global:
nameOverride: "{{ .Release.Name }}"
{{ end }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "app-template.nameOverride" . | fromYaml) -}}

{{- define "app-template.hardcodedValues"}}
# Disable service
service:
main:
enabled: false

# Disable probes
probes:
liveness:
enabled: false
readiness:
enabled: false
startup:
enabled: false

# Disable ingress
ingress:
main:
enabled: false

# Populate env from secret
{{- if .Values.secrets.secretenv.enabled }}
envFrom:
- secretRef:
name: {{ include "bjw-s.common.lib.chart.names.fullname" . }}-secretenv
{{- with .Values.envFrom }}
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}

{{- $_ := mergeOverwrite .Values (include "app-template.hardcodedValues" . | fromYaml) -}}

{{/* Render the templates */}}
{{ include "bjw-s.common.loader.generate" . }}
53 changes: 53 additions & 0 deletions environments/production/s3-import-xfs/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
image:
repository: peakcom/s5cmd
tag: v2.1.0
pullPolicy: IfNotPresent

##
## Application
##

command:
- /s5cmd
- sync
- s3://sourcify-backup-s3/stable/repository/contracts/*
- /data/contracts

controller:
type: cronjob
restartPolicy: Never
cronjob:
concurrencyPolicy: Forbid
schedule: "50 12 * * *"
startingDeadlineSeconds: 30
successfulJobsHistory: 1
failedJobsHistory: 1
backoffLimit: 6

##
## Data source
##

persistence:
data:
enabled: true
type: pvc
existingClaim: sourcify-repository-xfs
mountPath: /data

##
## Environment configuration
##

env: {}

##
## Secrets
##

secrets:
secretenv:
enabled: true
stringData:
AWS_ACCESS_KEY_ID: "<path:/secrets/clusters/sourcify/shared/shared.enc.yaml#S3_SYNC_AWS_ACCESS_KEY_ID>"
AWS_SECRET_ACCESS_KEY: "<path:/secrets/clusters/sourcify/shared/shared.enc.yaml#S3_SYNC_AWS_SECRET_ACCESS_KEY>"

0 comments on commit caae6f4

Please sign in to comment.