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:rsync based file transfer #879

Merged
merged 4 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions deployment/k3s/files/rsyncd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
use chroot = true

transfer logging = true
log file = /dev/stdout
log format = %h %o %f %l %b

[maps]
comment = Public Share
path = /home/maps
read only = yes
list = yes
uid = nobody
gid = nogroup
15 changes: 11 additions & 4 deletions deployment/k3s/templates/deployments/maps/maps-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,19 @@ spec:
failureThreshold: 6
periodSeconds: 10
- name: tileserver-src # serve tileserver-vol at /maps/vol/...
image: nginx:1.25
image: alpine:18
imagePullPolicy: IfNotPresent
command:
- sh
- -c
- "apk add --no-cache rsync && rsync --daemon --no-detach --config=/etc/rsyncd.conf"
ports:
- containerPort: 80
name: http
- containerPort: 873
name: rsync
volumeMounts:
- name: tileserver-vol
mountPath: /usr/share/nginx/html/maps/vol
mountPath: /home/maps/vol
readOnly: true
- name: tileserver-config
mountPath: /etc/rsyncd.conf
subPath: rsyncd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ metadata:
data:
osm-liberty.json: |-
{{ .Files.Get "files/maps/osm-liberty.json" | indent 4 }}
rsyncd.conf: |-
{{ .Files.Get "files/maps/rsyncd.conf" | indent 4 }}
config.json: |-
{
"options": {
Expand Down
2 changes: 1 addition & 1 deletion deployment/k3s/templates/networking/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
match: Host(`{{ $.Values.url }}`) && PathPrefix(`/maps/vol/`)
services:
- name: maps-svc
port: 7771
port: 873
- kind: Rule
match: Host(`{{ $.Values.url }}`) && PathPrefix(`/maps/`)
services:
Expand Down
4 changes: 2 additions & 2 deletions deployment/k3s/templates/networking/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ spec:
port: 3001
targetPort: 8080
- name: src
port: 7771
targetPort: 80
port: 873
targetPort: 873
---
apiVersion: v1
kind: Service
Expand Down
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
tileserver-init-src:
image: alpine:latest
restart: on-failure
command: wget -P /map --continue https://nav.tum.de/maps/vol/output.mbtiles
command: rsync --update --compress --progress --partial --human-readable --stats rsync://nav.tum.de/maps/vol/output.mbtiles /map/output.mbtiles
volumes:
- ./map:/map
tileserver:
Expand All @@ -58,6 +58,15 @@ services:
condition: service_completed_successfully
tileserver-init-src:
condition: service_completed_successfully
tileserver-rsync-deamon-src:
image: alpine:3.18
restart: always
command: sh -c "apk add --no-cache rsync && rsync --daemon --no-detach --config=/etc/rsyncd.conf"
volumes:
- ./deployment/k3s/files/rsyncd.conf:/etc/rsyncd.conf:ro
- ./map/output.mbtiles:/home/maps/vol/output.mbtiles:ro
ports:
- "873:873"
# cdn
data:
image: ghcr.io/tum-dev/navigatum-cdn:latest
Expand Down
Loading